body {
    background-color: #0D1117;
    color: #F8F9FA;
    overflow-x: hidden;
    min-height: 100vh;
}

.header-title {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(90deg, #4a90e2, #a970ff);
    font-weight: 900;
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(169, 112, 255, 0.1) 100%);
}

/* Statistics grid - all cards same height */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card, .ad-card {
    background-color: #161B22;
    border: 1px solid #2D3748;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Ad card specific styles */
.ad-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #4a90e2;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

/* Ad content container */
.ad-card > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* AdSense ad styling */
.adsbygoogle {
    width: 100% !important;
    height: 100% !important;
    min-height: 120px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fallback ad styling */
.fallback-ad {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
}

.fallback-ad p {
    margin: 0;
}

.fallback-ad .text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
    margin-bottom: 0.5rem;
}

.fallback-ad .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 0.25rem;
}

.fallback-ad .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
}

.btn-neon {
    background: linear-gradient(45deg, #4a90e2, #a970ff);
    color: #F8F9FA;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-neon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn-metamask {
    background: linear-gradient(45deg, #f6851b, #e2761b);
    color: #F8F9FA;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-metamask:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(246, 133, 27, 0.3);
}

.btn-metamask.connected {
    background: linear-gradient(45deg, #4a90e2, #50fa7b);
}

.btn-secondary-dark {
    background-color: #161B22;
    color: #A0AEC0;
    border: 1px solid #334155;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary-dark:hover {
    background-color: #1f2937;
    color: #F8F9FA;
    border-color: #4a90e2;
}

.btn-tab {
    background-color: #161B22;
    color: #A0AEC0;
    border: 1px solid #334155;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-tab.active {
    background: linear-gradient(45deg, #4a90e2, #a970ff);
    color: #F8F9FA;
    border-color: #4a90e2;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #161B22;
    border: 1px solid #2D3748;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    width: 95%;
    max-width: 1400px;
}

.input-dark {
    background-color: #0D1117;
    border: 1px solid #334155;
    color: #F8F9FA;
    transition: all 0.2s ease;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.input-dark:focus {
    border-color: #4a90e2;
    outline: none;
}

#editor-canvas {
    image-rendering: pixelated;
    border: 2px solid #2D3748;
    background-color: #161B22;
    width: 100% !important;
    height: auto !important;
    max-width: 600px;
    max-height: 600px;
    cursor: pointer;
}

.art-card-link {
    transition: transform 0.2s ease;
    position: relative;
    cursor: pointer;
}

.art-card-link:hover {
    transform: scale(1.03);
}

.footer-gradient {
    background: linear-gradient(180deg, #0D1117 0%, #161B22 100%);
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-top: 15px;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #4a90e2;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-checkbox.checked {
    background-color: #4a90e2;
}

.custom-checkbox.checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Styles pour les messages d'alerte (désactivés) */
.alert-message {
    display: none !important;
}

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dashboard styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.user-artwork-item {
    background-color: #1a202c;
    border: 1px solid #2d3748;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.2s ease;
}

.user-artwork-item:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
}

/* Wallet connection indicator */
.wallet-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.wallet-indicator.connected {
    background-color: rgba(80, 250, 123, 0.2);
    color: #50fa7b;
}

.wallet-indicator.disconnected {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #161B22;
}

::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a970ff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* QR Code styling */
.qrcode-container canvas {
    max-width: 100%;
    height: auto;
}

/* Ensure art cards have consistent height */
.art-card-link canvas {
    width: 100%;
    height: 224px;
    object-fit: contain;
    background-color: #0D1117;
}

/* Pagination styling */
#pagination-container button {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modal art display sizing */
#modal-art-display canvas {
    width: 100%;
    height: 100%;
    background-color: #0D1117;
}

/* Hero canvas sizing */
#hero-canvas {
    width: 100%;
    height: 100%;
    background-color: #0D1117;
}

/* Form elements */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid #334155;
    border-radius: 6px;
}

/* Tool buttons in editor */
button[data-tool] {
    transition: all 0.2s ease;
}

button[data-tool].btn-neon {
    background: linear-gradient(45deg, #4a90e2, #a970ff);
    color: white;
}

/* Color palette buttons */
#color-palette button {
    transition: all 0.2s ease;
    transform: scale(1);
}

#color-palette button:hover {
    transform: scale(1.1);
}

/* Gallery empty state */
#empty-gallery-message {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer links */
footer a, footer button {
    transition: color 0.2s ease;
}

footer a:hover, footer button:hover {
    color: #4a90e2;
}

/* Canvas info text */
#canvas-info {
    font-size: 0.875rem;
    color: #A0AEC0;
    background-color: #161B22;
    border: 1px solid #2D3748;
    border-radius: 6px;
}

/* Share link input styling */
#share-link-input {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background-color: #0D1117;
    border: 1px solid #334155;
    color: #F8F9FA;
    padding: 8px 12px;
    border-radius: 6px;
}

/* Terms modal content */
#terms-modal .modal-content {
    max-height: 70vh;
}

/* Artist modal action buttons */
#artist-modal .btn-secondary-dark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Custom color picker styling */
#color-picker {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #334155;
    background: transparent;
    cursor: pointer;
}

/* Ensure all canvas elements maintain aspect ratio */
canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Code block styling */
code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #0D1117;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #334155;
}

/* Etherscan link styling */
#etherscan-link {
    text-decoration: none;
    color: inherit;
}

/* Form validation styling */
input:invalid {
    border-color: #ef4444 !important;
}

input:valid {
    border-color: #10b981 !important;
}

/* Hide elements utility */
.hidden {
    display: none !important;
}

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid utilities */
.grid-center {
    display: grid;
    place-items: center;
}

/* Animation for modal entrance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* Button disabled state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Input placeholder styling */
::placeholder {
    color: #64748b;
    opacity: 0.7;
}

/* Selection color */
::selection {
    background-color: rgba(74, 144, 226, 0.3);
    color: #F8F9FA;
}

/* Focus outline for accessibility */
:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Smooth transitions for interactive elements */
a, button, input, select, textarea {
    transition: all 0.2s ease;
}

/* Art list item styling */
.art-card-link {
    overflow: hidden;
}

.art-card-link canvas {
    transition: transform 0.3s ease;
}

.art-card-link:hover canvas {
    transform: scale(1.05);
}

/* Statistics numbers animation */
#total-artworks, #total-artists, #total-eth {
    transition: color 0.3s ease;
}

/* Print styles */
@media print {
    .ad-card,
    .btn-neon,
    .btn-secondary-dark,
    .btn-tab,
    button {
        display: none !important;
    }
    
    .stat-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Ensure ads don't break layout */
.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

/* Force equal height for all cards */
.stats-container {
    align-items: stretch;
}

.stat-card, .ad-card {
    flex: 1;
}

/* Make sure ad content fills the card */
.ad-card > div {
    flex: 1;
}

/* Ad fallback styling */
.ad-card .fallback-ad {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(169, 112, 255, 0.05) 100%);
    border-radius: 8px;
}

/* Ensure consistent card heights */
@media (max-width: 640px) {
    .stat-card, .ad-card {
        min-height: 100px;
    }
}

/* Fix for AdSense responsiveness */
ins.adsbygoogle {
    margin: 0 auto;
}
