/* Prevent layout shift during font loading */
html {
    font-display: swap;
}

/* Typography - Exact fonts from bxl.art */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    /* Prevent layout shift */
    font-size: 16px;
    line-height: 1.6;
}

/* Apply Open Sans as base font */
body, p, div, span {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Headings use Poppins like bxl.art */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Open Sans', sans-serif;
    font-weight: 600;
    /* Prevent layout shift */
    font-size: inherit;
    line-height: 1.2;
}

/* Gallery names use Barlow Condensed like bxl.art */
.gallery-name {
    font-family: 'Barlow Condensed', 'Open Sans', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Exhibition titles use Poppins - consistent styling */
.exhibition-title {
    font-family: 'Poppins', 'Open Sans', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    /* Prevent layout shift */
    font-size: 1.875rem;
    line-height: 1.2;
}

/* Artist names use Lora for elegance */
.artist-name {
    font-family: 'Lora', 'Open Sans', serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-decoration: none;
}

/* Monospace for technical elements */
.font-mono {
    font-family: 'Source Serif Pro', 'Courier New', monospace;
}

/* Enhanced typography for better readability */
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem; line-height: 1.6; }
.text-lg { font-size: 1.125rem; line-height: 1.6; }
.text-xl { font-size: 1.25rem; line-height: 1.5; }
.text-2xl { font-size: 1.5rem; line-height: 1.4; }
.text-3xl { font-size: 1.875rem; line-height: 1.3; }

/* Consistent header styling */
header {
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
}

/* Ensure header logo (Zopart) uses consistent Poppins font across all pages */
.zopart-logo,
header h1.zopart-logo,
#header-container header h1.zopart-logo,
header h1,
#header-container header h1 {
    font-family: 'Poppins', 'Open Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em !important;
}

/* Sticky bar border styling */
#sticky-bar.border-b {
    border-bottom: 1px solid #e5e7eb;
}

/* Ensure sticky bar has proper initial state */
#sticky-bar {
    background-color: white;
    transition: border-bottom 0.2s ease;
}

/* Ensure sticky bar stays white when sticky */
#sticky-bar.border-b {
    background-color: white;
}

/* Exhibition card styling */
.exhibition-card {
    transition: all 0.3s ease;
}

/* Status badge styling */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

/* Status colors */
.status-current {
    background-color: #10b981;
    color: white;
}

.status-upcoming {
    background-color: #3b82f6;
    color: white;
}

/* Gallery badge styling */
.gallery-badge {
    background-color: #f3f4f6;
    color: #374151;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

/* Enhanced button and input styling */
button, input, select {
    font-family: 'Inter', sans-serif;
}

/* Search input with clear button styling */
.search-clear-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.search-clear-button:hover {
    color: #6b7280;
    background-color: #f3f4f6;
}

.search-clear-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* City dropdown styling */
#city-dropdown, #city-dropdown-desktop {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    z-index: 20;
    min-width: 7rem; /* Ensure enough width for "New York" */
    max-width: 12rem; /* Prevent dropdown from being too wide */
}

.city-option, .city-option-desktop {
    transition: background-color 0.15s ease;
    cursor: pointer;
    user-select: none;
    white-space: nowrap; /* Prevent text wrapping */
}

.city-option:hover, .city-option-desktop:hover {
    background-color: #f9fafb;
}

.city-option:active, .city-option-desktop:active {
    background-color: #f3f4f6;
}

/* Ensure city filter text doesn't wrap */
#city-filter, #city-filter-desktop {
    white-space: nowrap;
    min-width: fit-content;
}

/* Mobile toolbar optimization */
@media (max-width: 767px) {
    #sticky-bar {
        padding: 0.75rem 0;
    }
    
    #sticky-bar .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Single line mobile layout */
    #sticky-bar .block.md\\:hidden .flex {
        gap: 0.75rem;
        flex-wrap: nowrap;
        align-items: center;
    }
    
    /* City and tabs group */
    #sticky-bar .block.md\\:hidden .flex > div:first-child {
        gap: 1rem;
        flex-shrink: 0;
    }
    
    /* Search input takes remaining space */
    #sticky-bar .block.md\\:hidden .flex-1 {
        min-width: 0; /* Allow flex item to shrink */
    }
    
    /* Optimize text sizes for mobile single line */
    #city-filter, #current-tab, #upcoming-tab {
        font-size: 1rem; /* Slightly smaller for single line */
        white-space: nowrap;
    }
    
    /* Search input styling for mobile */
    #search-input {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Ensure dropdown has enough space on mobile */
    #city-dropdown {
        min-width: 8rem;
        max-width: 10rem;
        left: 0;
        right: auto;
        transform: translateX(0);
        /* Ensure dropdown doesn't go off-screen */
        position: absolute;
        top: 100%;
        margin-top: 0.5rem;
    }
    
    /* Mobile clear button styling */
    .search-clear-button {
        right: 0.5rem;
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.75rem;
    }
}

/* Extra small screens - ensure dropdown stays in viewport */
@media (max-width: 480px) {
    #city-dropdown {
        left: -1rem; /* Shift slightly left to ensure visibility */
        min-width: 7rem;
        max-width: 9rem;
    }
}

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
