/* THINGS Initiative - Redesign Styles
 * A refined, scientific aesthetic with warm amber accents
 * Typography: Spectral for display, DM Sans for UI, Source Sans 3 for body
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Colors - Warm scientific palette */
    --color-primary: #d4a03c;
    --color-primary-dark: #b8862e;
    --color-primary-light: #f5e6c8;
    --color-accent: #2c5282;
    --color-text: #1a202c;
    --color-text-muted: #718096;
    --color-background: #fafaf9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-dark: #1a1a2e;

    /* Typography */
    --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   TYPOGRAPHY IMPORTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ============================================
   HERO SECTION - 2/3 Image, 1/3 Text
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    height: 100vh;
    padding: 73px 0 0 0 !important;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    max-width: 1600px;
    object-fit: contain;
    padding: var(--space-xl);
    padding-right: var(--space-2xl);
    position: relative;
    z-index: 1;
}

.hero-image-overlay {
    display: none;
}

/* Hero header - only visible on mobile (title above image) */
.hero-header {
    display: none;
}

/* Mobile-only elements - hidden on desktop */
.hero-subtitle-mobile,
.hero-actions-mobile,
.hero-description-mobile {
    display: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-lg) var(--space-xl) var(--space-lg) var(--space-lg);
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    max-width: 540px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-md);
    letter-spacing: -0.03em;
    color: #0f172a;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.hero-description {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: var(--space-xl);
}

.hero-description p {
    margin-bottom: var(--space-md);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.hero-actions .btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    font-size: 0.875rem;
    text-align: center;
}

.hero-actions .btn-primary {
    background: linear-gradient(135deg, #6ea9fd 0%, #5a95e8 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(110, 169, 253, 0.25);
}

.hero-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5a9bf0 0%, #4a85d8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(110, 169, 253, 0.4);
}

.hero-actions .btn-outline-light {
    border: 1.5px solid #e2e8f0;
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

.hero-actions .btn-outline-light:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Desktop scroll indicator - refined pill with label */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    z-index: 10;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.scroll-indicator::before {
    content: 'Scroll to explore';
    font-family: var(--font-heading);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #64748b;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-indicator:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    border: 1.5px solid rgba(100, 116, 139, 0.3);
    border-radius: 14px;
    color: #6ea9fd;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    transition: all var(--transition-base);
    position: relative;
}

.scroll-indicator i::before {
    animation: scrollFloat 1.8s ease-in-out infinite;
}

.scroll-indicator:hover {
    opacity: 1;
    text-decoration: none;
}

.scroll-indicator:hover i {
    border-color: rgba(110, 169, 253, 0.5);
    background: rgba(255, 255, 255, 0.85);
    color: #5a9bf8;
}

/* Elegant floating animation */
@keyframes scrollFloat {
    0%, 100% {
        transform: translateY(-3px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(3px);
        opacity: 1;
    }
}

/* Mobile scroll indicator - striking visual cue */
@media (max-width: 991px) {
    .scroll-indicator {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        width: 100%;
        height: auto;
        border-radius: 0;
        background: linear-gradient(to top,
            rgba(250, 250, 249, 1) 0%,
            rgba(250, 250, 249, 0.95) 60%,
            rgba(250, 250, 249, 0) 100%
        );
        padding: var(--space-2xl) var(--space-md) var(--space-lg);
        margin: 0;
        animation: none;
        opacity: 1;
        flex-direction: column;
        gap: 6px;
        z-index: 50;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Hide when scrolled down */
    .scroll-indicator.hidden {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
    }

    .scroll-indicator::before {
        content: 'Scroll to explore';
        font-family: var(--font-heading);
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: #64748b;
        opacity: 1;
        transform: none;
    }

    .scroll-indicator i {
        width: auto;
        height: auto;
        border: none;
        border-radius: 0;
        background: none;
        backdrop-filter: none;
        font-size: 1.25rem;
        color: #6ea9fd;
        animation: scrollBounce 1.2s ease-in-out infinite;
    }

    .scroll-indicator i::before {
        animation: none;
    }

    .scroll-indicator:hover {
        background: linear-gradient(to top,
            rgba(250, 250, 249, 1) 0%,
            rgba(250, 250, 249, 0.95) 60%,
            rgba(250, 250, 249, 0) 100%
        );
    }

    @keyframes scrollBounce {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(6px);
        }
    }
}

/* Keep old bounce for backwards compatibility */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-8px);
    }
    60% {
        transform: translateX(-50%) translateY(-4px);
    }
}

/* ============================================
   SECTION STYLES
   ============================================ */
.page-section {
    padding: var(--space-2xl) 0;
}

/* About Section - Three Columns */
.about-section {
    background: #ffffff;
    padding: var(--space-2xl) 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.about-card {
    text-align: center;
    padding: var(--space-lg);
}

.about-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    background: var(--color-background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-icon i {
    font-size: 1.5rem;
    color: #6ea9fd;
}

.about-card h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: var(--space-sm);
}

.about-card p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: var(--space-md);
}

.about-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6ea9fd;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.about-link:hover {
    color: #5a9bf8;
    text-decoration: none;
}

.about-link i {
    margin-left: 4px;
    font-size: 0.75rem;
}

.datasets-section {
    background: var(--color-background);
    padding-top: var(--space-xl);
    position: relative;
    scroll-margin-top: 73px; /* Account for fixed navbar height */
}

/* Subtle gradient overlay for datasets */
.datasets-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(110, 169, 253, 0.02) 0%, transparent 30%, transparent 70%, rgba(110, 169, 253, 0.015) 100%);
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #6ea9fd;
    border-radius: 2px;
}

.section-description {
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: var(--space-lg) auto 0;
}

/* ============================================
   DATASET CARDS
   ============================================ */
.dataset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

@media (min-width: 1400px) {
    .datasets-section .container {
        max-width: 1400px;
    }

    .dataset-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Page load animation for cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dataset-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e8e8;
    border-left: 3px solid #d0d0d0;
    /* Animation */
    opacity: 0;
    animation: cardFadeIn 0.5s ease forwards;
}

/* Staggered animation delays for first 12 cards */
.dataset-card:nth-child(1) { animation-delay: 0.05s; }
.dataset-card:nth-child(2) { animation-delay: 0.1s; }
.dataset-card:nth-child(3) { animation-delay: 0.15s; }
.dataset-card:nth-child(4) { animation-delay: 0.2s; }
.dataset-card:nth-child(5) { animation-delay: 0.25s; }
.dataset-card:nth-child(6) { animation-delay: 0.3s; }
.dataset-card:nth-child(7) { animation-delay: 0.35s; }
.dataset-card:nth-child(8) { animation-delay: 0.4s; }
.dataset-card:nth-child(9) { animation-delay: 0.45s; }
.dataset-card:nth-child(10) { animation-delay: 0.5s; }
.dataset-card:nth-child(11) { animation-delay: 0.55s; }
.dataset-card:nth-child(12) { animation-delay: 0.6s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .dataset-card {
        opacity: 1;
        animation: none;
    }
}

.dataset-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    border-left-color: #6ea9fd;
}

.dataset-card:focus-within {
    outline: 3px solid rgba(110, 169, 253, 0.4);
    outline-offset: 2px;
}

.dataset-card.featured {
    border: 1px solid #e8e8e8;
    border-left: 3px solid #6ea9fd;
    box-shadow: 0 0 0 3px rgba(110, 169, 253, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dataset-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-bottom: 1px solid #f0f0f0;
}

.dataset-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.dataset-card:hover .dataset-card-image img {
    transform: scale(1.02);
}

/* Badges container in card image */
.dataset-card-badges {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.dataset-size {
    background: rgba(26, 26, 46, 0.85);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

/* Cite badge in card image corner */
.cite-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    font-family: var(--font-heading);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cite-badge:hover {
    background: #6ea9fd;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(110, 169, 253, 0.3);
}

.cite-badge i {
    font-size: 0.5rem;
}

.dataset-card-body {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dataset-title {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Data type badges */
.dataset-data-types {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.data-type-badge {
    --badge-color: #6ea9fd;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-family: var(--font-heading);
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--badge-color);
    background: color-mix(in srgb, var(--badge-color) 12%, transparent);
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all var(--transition-fast);
}

.data-type-badge i {
    font-size: 0.5625rem;
}

.data-type-badge:hover {
    background: color-mix(in srgb, var(--badge-color) 20%, transparent);
}

.dataset-contributors {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: #334155;
    margin-bottom: 3px;
    font-weight: 500;
}

.dataset-affiliations {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-bottom: var(--space-sm);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dataset-affiliations a {
    color: #94a3b8;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.dataset-affiliations a:hover {
    color: #6ea9fd;
}

/* Expand/collapse toggle for +X more */
.expand-toggle {
    color: #999;
    text-decoration: none;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.expand-toggle:hover {
    color: #666;
    text-decoration: underline;
}

.dataset-summary {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.65;
    margin-bottom: var(--space-sm);
}

.dataset-summary p {
    margin: 0;
}

/* Card footer - sticks to bottom */
.dataset-card-footer {
    margin-top: auto;
    padding-top: var(--space-md);
}

/* Actions row - all links inline */
.dataset-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Compact Get Data chip */
.btn-get-data-compact {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #6ea9fd;
    border-radius: 100px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: lowercase;
    transition: all var(--transition-fast);
}

.btn-get-data-compact:hover {
    background: #5a9bf0;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(110, 169, 253, 0.3);
}

.btn-get-data-compact i {
    font-size: 0.6875rem;
}

/* Text links in actions row - animated underline */
.dataset-actions-row a:not(.btn-get-data-compact) {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #6ea9fd;
    text-decoration: none;
    transition: color var(--transition-fast);
    text-transform: lowercase;
    position: relative;
}

.dataset-actions-row a:not(.btn-get-data-compact)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4a8fe8;
    transition: width var(--transition-base);
}

.dataset-actions-row a:not(.btn-get-data-compact):hover {
    color: #4a8fe8;
}

.dataset-actions-row a:not(.btn-get-data-compact):hover::after {
    width: 100%;
}

.dataset-actions-row .link-separator {
    color: #ccc;
    font-size: 0.75rem;
    margin: 0 2px;
}

/* Status badge for in-progress datasets */
.dataset-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    text-transform: capitalize;
}

.dataset-status-badge i {
    font-size: 0.625rem;
    opacity: 0.7;
}


/* ============================================
   EXTERNAL PROJECTS
   ============================================ */
.external-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.external-project-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
}

.external-project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.external-project-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--color-border);
}

.external-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.external-project-card:hover .external-project-image img {
    transform: scale(1.05);
}

.external-project-body {
    padding: var(--space-md);
    position: relative;
}

.external-project-body h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.external-project-body p {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

.external-link-indicator {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    color: #6ea9fd;
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-base);
}

.external-project-card:hover .external-link-indicator {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    background: var(--color-dark);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient texture for contact section */
.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(110, 169, 253, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(110, 169, 253, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-2xl);
    align-items: start;
}

.contact-cta {
    position: relative;
    z-index: 1;
}

.contact-cta .section-title {
    color: #ffffff;
    text-align: left;
    margin-bottom: var(--space-lg);
}

.contact-cta .section-title::after {
    margin-left: 0;
}

.contact-cta .section-description {
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    margin: 0 0 var(--space-lg) 0;
    max-width: none;
}

.contact-action {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: #6ea9fd;
    margin: 0;
}

.contact-section .section-title {
    color: #ffffff;
}

.contact-section .section-description {
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.contact-form-wrapper {
    max-width: none;
    margin: 0;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .contact-cta {
        text-align: center;
    }

    .contact-cta .section-title {
        text-align: center;
    }

    .contact-cta .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .contact-cta .section-description {
        text-align: center;
    }

    .contact-action {
        text-align: center;
    }

    .contact-form-wrapper #sendMessageButton {
        display: block;
        width: 100%;
    }
}

.contact-form-wrapper .form-control {
    font-family: var(--font-body);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.contact-form-wrapper .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.contact-form-wrapper .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #6ea9fd;
    box-shadow: 0 0 0 3px rgba(110, 169, 253, 0.2);
    outline: none;
}

/* Animated border glow on focus */
.contact-form-wrapper .form-group {
    position: relative;
    margin-bottom: var(--space-lg);
}

.contact-form-wrapper .form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6ea9fd, transparent);
    transition: all 0.4s ease;
    transform: translateX(-50%);
    opacity: 0;
}

.contact-form-wrapper .form-group:focus-within::after {
    width: 100%;
    opacity: 1;
}

.contact-form-wrapper textarea.form-control {
    min-height: 120px;
    max-height: 180px;
    resize: vertical;
}

/* Form textarea container */
.contact-form-wrapper .form-group-textarea {
    /* Don't stretch to fill */
}

.captcha-group {
    margin-top: var(--space-md);
}

.captcha-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-sm);
    display: block;
}

.captcha-label span {
    color: #6ea9fd;
    font-weight: 600;
}

/* Success message styling */
#success .alert {
    background: rgba(110, 169, 253, 0.15);
    border: 1px solid rgba(110, 169, 253, 0.3);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Contact form submit button */
.contact-section .btn-primary,
.contact-section .btn-primary.btn-lg,
#sendMessageButton {
    background: #6ea9fd !important;
    border-color: #6ea9fd !important;
    color: #fff !important;
    padding: var(--space-md) var(--space-xl) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    position: relative;
    overflow: hidden;
}

/* Button shine effect on hover */
.contact-section .btn-primary::before,
#sendMessageButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.contact-section .btn-primary:hover::before,
#sendMessageButton:hover::before {
    left: 100%;
}

.contact-section .btn-primary:hover,
.contact-section .btn-primary:focus,
#sendMessageButton:hover,
#sendMessageButton:focus {
    background: #5a9bf8 !important;
    border-color: #5a9bf8 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(110, 169, 253, 0.35) !important;
}

/* ============================================
   MODAL - Two Column Layout
   ============================================ */
.get-data-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--space-lg);
}

.get-data-modal.show {
    opacity: 1;
    visibility: visible;
}

.get-data-modal .modal-dialog {
    max-width: 1280px;
    width: calc(100vw - 80px);
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition-base);
}

.get-data-modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.get-data-modal .modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: #f5f5f5;
    border: none;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    padding: 8px 10px;
    line-height: 1;
    transition: all var(--transition-fast);
    z-index: 10;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: #eee;
    color: #333;
}

.get-data-modal .modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
}

/* Modal header with title and size badge */
.modal-header-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid #f0f0f0;
}

.modal-header-row h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

.modal-size-badge {
    background: #f0f4f8;
    color: #64748b;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Two-column modal layout */
.modal-two-columns {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--space-xl);
}

.modal-col-left,
.modal-col-right {
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.7;
    color: #444;
}

.modal-col-left {
    border-right: 1px solid #f0f0f0;
    padding-right: var(--space-xl);
}

.modal-col-left > h4,
.modal-col-right > h4 {
    font-family: var(--font-heading);
    font-size: 0.625rem;
    font-weight: 700;
    color: #6ea9fd;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 var(--space-md) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid #f0f0f0;
}

.modal-col-left h4:not(:first-child),
.modal-col-right h4:not(:first-child) {
    font-size: 0.6875rem;
    color: #888;
    margin-top: var(--space-lg);
    border-bottom: none;
    padding-bottom: 0;
}

.modal-col-left p,
.modal-col-right p {
    margin: 0 0 var(--space-sm) 0;
}

.modal-col-left a,
.modal-col-right a {
    color: #6ea9fd;
    text-decoration: none;
}

.modal-col-left a:hover,
.modal-col-right a:hover {
    text-decoration: underline;
}

.modal-col-left ul,
.modal-col-right ul {
    margin: 0 0 var(--space-sm) 0;
    padding-left: var(--space-md);
}

.modal-col-left li,
.modal-col-right li {
    margin-bottom: 4px;
    font-size: 0.8125rem;
}

.modal-col-left code,
.modal-col-right code {
    background: #f0f4f8;
    color: #c7254e;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8em;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.modal-col-left pre,
.modal-col-right pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: var(--space-md);
    padding-right: 50px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0 0 var(--space-sm) 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    position: relative;
}

.modal-col-left pre code,
.modal-col-right pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* Copy button for code blocks */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

.code-copy-btn.copied {
    background: #10b981;
    color: #ffffff;
}

/* Table styling in modal */
.modal-col-left table,
.modal-col-right table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 var(--space-sm) 0;
    font-size: 0.75rem;
}

.modal-col-left th,
.modal-col-left td,
.modal-col-right th,
.modal-col-right td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.modal-col-left th,
.modal-col-right th {
    background: #f8fafc;
    font-weight: 600;
    color: #555;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.modal-col-left tr:hover td,
.modal-col-right tr:hover td {
    background: #fafafa;
}

/* Responsive - Modal */
@media (max-width: 768px) {
    .get-data-modal {
        padding: var(--space-sm);
    }

    .get-data-modal .modal-dialog {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .get-data-modal .modal-content {
        border-radius: var(--radius-md);
        max-height: calc(100vh - var(--space-lg));
    }

    .get-data-modal .modal-body {
        padding: var(--space-sm) var(--space-sm) var(--space-md);
    }

    .modal-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .modal-header-row h3 {
        font-size: 1.25rem;
    }

    .modal-two-columns {
        display: block;
    }

    .modal-col-left,
    .modal-col-right {
        padding: 0;
        border: none;
    }

    .modal-col-left {
        padding-bottom: var(--space-md);
        margin-bottom: var(--space-md);
        border-bottom: 1px solid #eee;
    }

    .modal-col-left h4,
    .modal-col-right h4 {
        font-size: 0.75rem;
        margin-bottom: var(--space-sm);
    }

    .modal-col-left p,
    .modal-col-right p {
        font-size: 0.875rem;
    }

    .modal-col-left ul,
    .modal-col-right ul {
        font-size: 0.875rem;
    }

    .modal-col-left pre,
    .modal-col-right pre {
        font-size: 0.6875rem;
        padding: var(--space-sm);
        padding-right: var(--space-sm);
        padding-bottom: calc(var(--space-sm) + 28px);
        margin-bottom: var(--space-xs);
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        word-break: break-all;
        white-space: pre-wrap;
    }

    .modal-col-left pre code,
    .modal-col-right pre code {
        display: block;
        overflow-x: auto;
    }

    /* Move copy button to bottom-right corner on mobile */
    .code-copy-btn {
        top: auto;
        bottom: 6px;
        right: 6px;
        padding: 4px 10px;
        font-size: 0.5625rem;
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Extra small phones - tighter modal spacing */
@media (max-width: 400px) {
    .get-data-modal .modal-body {
        padding: var(--space-xs) var(--space-xs) var(--space-sm);
    }

    .modal-header-row h3 {
        font-size: 1.1rem;
    }

    .modal-col-left h4,
    .modal-col-right h4 {
        font-size: 0.6875rem;
    }

    .modal-col-left p,
    .modal-col-right p,
    .modal-col-left ul,
    .modal-col-right ul {
        font-size: 0.8125rem;
    }

    .modal-col-left pre,
    .modal-col-right pre {
        font-size: 0.625rem;
        padding: 8px;
        padding-bottom: 30px;
        border-radius: var(--radius-sm);
    }
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-dark);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(110, 169, 253, 0.2);
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toast-notification i {
    color: #6ea9fd;
    font-size: 1rem;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   NAVBAR OVERRIDES
   ============================================ */
#mainNav {
    background: #ffffff;
    transition: all var(--transition-base);
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8e8e8;
}

/* Shadow when scrolled */
#mainNav.navbar-shrink {
    box-shadow: var(--shadow-md);
}

/* Hide navbar on mobile at top of page */
@media (max-width: 991px) {
    #mainNav:not(.navbar-shrink) {
        transform: translateY(-100%);
        opacity: 0;
    }

    #mainNav.navbar-shrink {
        transform: translateY(0);
        opacity: 1;
    }
}

#mainNav .navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--color-text) !important;
    display: flex;
    align-items: center;
}

#mainNav .nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: var(--color-text) !important;
    display: flex;
    align-items: center;
}

#mainNav .nav-link:hover {
    color: #6ea9fd !important;
}

#mainNav.navbar-shrink {
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

/* Hide navbar on shorter viewports when at top of page */
@media (max-height: 800px) {
    #mainNav:not(.navbar-shrink) {
        transform: translateY(-100%);
        opacity: 0;
    }

    #mainNav.navbar-shrink {
        transform: translateY(0);
        opacity: 1;
    }

    /* Adjust hero padding since navbar is hidden */
    .hero-section {
        padding-top: 0 !important;
    }

    /* Scale down hero content to fit */
    .hero-content {
        padding: var(--space-md) var(--space-lg);
    }

    .hero-title {
        font-size: clamp(1.75rem, 3.5vw, 2.5rem);
        margin-bottom: var(--space-sm);
    }

    .hero-subtitle {
        font-size: 0.8125rem;
        margin-bottom: var(--space-md);
    }

    .hero-description {
        font-size: 0.875rem;
        line-height: 1.6;
        margin-bottom: var(--space-lg);
    }

    .hero-description p {
        margin-bottom: var(--space-sm);
    }

    .hero-actions {
        gap: 6px;
    }

    .hero-actions .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .hero-section {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        padding: var(--space-md) 0 0 0 !important;
    }

    /* Order: 1-Title, 2-Image, 3-Subtitle, 4-Buttons, 5-Description, 6-Scroll */
    .hero-header {
        display: block;
        text-align: center;
        padding: var(--space-lg) var(--space-lg) 0;
        order: 1;
    }

    .hero-header .hero-title {
        font-size: 2.75rem;
        font-weight: 800;
        margin-bottom: 0;
    }

    .hero-image {
        padding: 0;
        order: 2;
        justify-content: center;
    }

    .hero-image img {
        max-height: none;
        max-width: 100%;
        width: 100%;
        padding: var(--space-md);
    }

    /* Mobile subtitle - after image */
    .hero-subtitle-mobile {
        display: block;
        order: 3;
        text-align: center;
        font-family: var(--font-body);
        font-size: 0.9375rem;
        font-weight: 500;
        color: #64748b;
        padding: 0 var(--space-lg);
        margin: 0 0 var(--space-md) 0;
        line-height: 1.6;
    }

    /* Mobile buttons - after subtitle */
    .hero-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
        order: 4;
        padding: 0 var(--space-lg);
        margin-bottom: var(--space-lg);
    }

    .hero-actions-mobile .btn {
        width: 100%;
        text-align: center;
        font-family: var(--font-heading);
        font-weight: 600;
        padding: var(--space-md) var(--space-lg);
        border-radius: var(--radius-sm);
        transition: all var(--transition-base);
        font-size: 0.875rem;
    }

    .hero-actions-mobile .btn-primary {
        background: linear-gradient(135deg, #6ea9fd 0%, #5a95e8 100%);
        border: none;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(110, 169, 253, 0.25);
    }

    .hero-actions-mobile .btn-outline-light {
        border: 1.5px solid #e2e8f0;
        color: #475569;
        background: rgba(255, 255, 255, 0.8);
    }

    /* Mobile description - after buttons */
    .hero-description-mobile {
        display: block;
        order: 5;
        font-family: var(--font-body);
        font-size: 0.9375rem;
        line-height: 1.7;
        color: #475569;
        padding: var(--space-lg) var(--space-lg) var(--space-xl);
        background: #ffffff;
        border-top: 1px solid #e8e8e8;
        border-bottom: 3px solid #e2e8f0;
    }

    .hero-description-mobile p {
        margin-bottom: var(--space-md);
    }

    .hero-description-mobile p:last-child {
        margin-bottom: 0;
    }

    /* Hide desktop content panel on mobile */
    .hero-content {
        display: none;
    }

    /* About section responsive */
    .about-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 767px) {
    .hero-section {
        padding: var(--space-sm) 0 0 0 !important;
    }

    .hero-header {
        padding: var(--space-md) var(--space-md) 0;
    }

    .hero-header .hero-title {
        font-size: 2.5rem;
    }

    .hero-image img {
        max-height: none;
        width: 100%;
        padding: var(--space-sm);
    }

    .hero-subtitle-mobile {
        padding: 0 var(--space-md);
        font-size: 0.875rem;
    }

    .hero-actions-mobile {
        padding: 0 var(--space-md);
    }

    .hero-description-mobile {
        padding: var(--space-md);
        font-size: 0.875rem;
        line-height: 1.6;
    }

    .dataset-grid {
        grid-template-columns: 1fr;
    }

    .page-section {
        padding: var(--space-xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-lg);
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-description {
        font-size: 1rem;
    }
}

/* ============================================
   BUTTON REFINEMENTS
   ============================================ */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #6ea9fd;
    border-color: #6ea9fd;
    color: #fff;
    box-shadow: 0 2px 8px rgba(110, 169, 253, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: #5a9bf8;
    border-color: #5a9bf8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 169, 253, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(110, 169, 253, 0.25);
}

/* Focus visible for keyboard accessibility */
.btn:focus-visible {
    outline: 3px solid rgba(110, 169, 253, 0.5);
    outline-offset: 2px;
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
}

/* ============================================
   FOOTER OVERRIDE
   ============================================ */
.footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-body);
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: #6ea9fd;
    text-decoration: none;
}

/* ============================================
   IMAGE GALLERY PAGE
   ============================================ */

/* Gallery Header - Single unified bar */
.gallery-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 90;
}

.gallery-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.gallery-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.gallery-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.gallery-back-btn:hover {
    background: #f0f0f0;
    color: var(--color-dark);
    text-decoration: none;
}

.gallery-back-btn i {
    font-size: 0.875rem;
}

.gallery-header-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
}

.gallery-header-count {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.gallery-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
}

.gallery-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.gallery-header-right label {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* Gallery Search - Compact */
.gallery-search-wrapper {
    position: relative;
    width: 100%;
}

.gallery-search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.75rem;
}

#gallery-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all var(--transition-fast);
}

#gallery-search:focus {
    outline: none;
    border-color: #6ea9fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(110, 169, 253, 0.12);
}

#gallery-search::placeholder {
    color: #999;
}

/* Search Autocomplete */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.search-autocomplete.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background var(--transition-fast);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

/* Sort Dropdown */
#gallery-sort {
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

#gallery-sort:focus {
    outline: none;
    border-color: #6ea9fd;
}

/* Download All Button - Compact */
.gallery-download-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    background: #6ea9fd;
    border: 1px solid #6ea9fd;
    color: #fff;
}

.gallery-download-all:hover,
.gallery-download-all:focus {
    background: #5a9bf8;
    border-color: #5a9bf8;
    color: #fff;
    text-decoration: none;
}

.gallery-download-all i {
    font-size: 0.7rem;
}

/* Gallery Section */
.gallery-section {
    padding: var(--space-md) 0 var(--space-xl);
    min-height: 60vh;
}

.gallery-section .container {
    max-width: 100%;
    padding-left: var(--space-lg);
    padding-right: calc(var(--space-lg) + 36px); /* Extra space for alphabet slider */
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

/* Category Card */
.category-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card:hover .category-card-checkbox {
    opacity: 1;
}

.category-card.selected {
    box-shadow: 0 0 0 3px #6ea9fd, var(--shadow-md);
}

.category-card.expanded {
    box-shadow: 0 0 0 3px #6ea9fd, var(--shadow-md);
}

/* Category Checkbox */
.category-card-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 2;
}

.category-card-checkbox i {
    font-size: 0.75rem;
    color: #fff;
    opacity: 0;
}

.category-card-checkbox.checked {
    background: #6ea9fd;
    border-color: #6ea9fd;
    opacity: 1;
}

.category-card-checkbox.checked i {
    opacity: 1;
}

.category-card-checkbox:hover {
    border-color: #6ea9fd;
}

/* Category Card Image */
.category-card-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.category-card:hover .category-card-image img {
    transform: scale(1.05);
}

/* Category Card Name */
.category-card-name {
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-dark);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gallery Loading */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.gallery-loading i {
    font-size: 1.25rem;
    color: #6ea9fd;
}

/* Gallery Empty */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xxl);
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* Category Detail (Expanded) */
.category-detail {
    display: none;
    grid-column: 1 / -1;
    background: linear-gradient(to bottom, #f0f4f8, #f8f9fa);
    border: 2px solid #6ea9fd;
    border-radius: var(--radius-lg);
    margin: var(--space-md) 0;
    padding: var(--space-lg);
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    position: relative;
    box-shadow: 0 4px 20px rgba(110, 169, 253, 0.15);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

/* Arrow pointer - created by JS */
.category-detail-arrow {
    position: absolute;
    top: -10px;
    width: 20px;
    height: 20px;
    background: #f0f4f8;
    border: 2px solid #6ea9fd;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: 1;
}

.category-detail.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.category-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.category-detail-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0;
}

.category-detail-actions {
    display: flex;
    gap: var(--space-sm);
}

.category-detail-actions .btn-primary {
    background: #6ea9fd;
    border-color: #6ea9fd;
    color: #fff;
}

.category-detail-actions .btn-primary:hover {
    background: #5a9bf8;
    border-color: #5a9bf8;
    color: #fff;
}

.category-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.detail-image {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #e0e0e0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    min-width: 0;
}

.detail-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-detail-loading,
.category-detail-empty,
.category-detail-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    font-family: var(--font-body);
    color: var(--color-text-muted);
}

.category-detail-loading i {
    margin-right: var(--space-xs);
    color: #6ea9fd;
}

/* Alphabet Quick Jump Slider */
.alpha-slider {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    z-index: 95;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.alpha-slider-letter {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    color: #6ea9fd;
    width: 18px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s ease;
    border-radius: 3px;
}

.alpha-slider-letter:hover {
    background: rgba(110, 169, 253, 0.15);
    transform: scale(1.1);
}

.alpha-slider-letter.disabled {
    color: #ccc;
    cursor: default;
}

.alpha-slider-letter.disabled:hover {
    background: transparent;
    transform: none;
}

.alpha-slider-letter.active {
    background: #6ea9fd;
    color: #fff;
}

/* Large letter indicator shown during drag */
.alpha-indicator {
    position: fixed;
    right: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 700;
    color: #6ea9fd;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 96;
    opacity: 0;
    transition: all 0.15s ease;
    pointer-events: none;
}

.alpha-indicator.visible {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

/* Alphabet Slider Hover Tooltip */
.alpha-tooltip {
    position: fixed;
    transform: translateY(-50%);
    background: var(--color-dark);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
    pointer-events: none;
    max-width: 200px;
}

.alpha-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.alpha-tooltip strong {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    color: #6ea9fd;
}

.alpha-tooltip .tooltip-count {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.alpha-tooltip .tooltip-examples {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.6875rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #6ea9fd;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(110, 169, 253, 0.3);
    z-index: 95;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #5a9bf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 169, 253, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Selection Bar */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-dark);
    padding: var(--space-md) 0;
    transform: translateY(100%);
    transition: transform var(--transition-base);
    z-index: 100;
}

.selection-bar.visible {
    transform: translateY(0);
}

.selection-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#selection-count {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: #fff;
}

.selection-bar-actions {
    display: flex;
    gap: var(--space-sm);
}

.selection-bar-actions .btn-primary {
    background: #6ea9fd;
    border-color: #6ea9fd;
    color: #fff;
}

.selection-bar-actions .btn-primary:hover {
    background: #5a9bf8;
    border-color: #5a9bf8;
    color: #fff;
}

/* Download Modal */
.download-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.download-modal.visible {
    opacity: 1;
    visibility: visible;
}

.download-modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.download-modal-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
}

.download-modal-content p {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.download-modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.download-modal-actions .btn-primary {
    background: #6ea9fd;
    border-color: #6ea9fd;
    color: #fff;
}

.download-modal-actions .btn-primary:hover {
    background: #5a9bf8;
    border-color: #5a9bf8;
    color: #fff;
}

/* Gallery Responsive */
@media (max-width: 768px) {
    .gallery-header-row {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .gallery-header-left {
        width: 100%;
        justify-content: flex-start;
    }

    .gallery-header-center {
        width: 100%;
        max-width: none;
        order: 3;
    }

    .gallery-header-right {
        width: 100%;
        justify-content: space-between;
        order: 2;
    }

    .gallery-header-right label {
        display: none;
    }

    .gallery-download-all span {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--space-sm);
    }

    .category-card-checkbox {
        opacity: 1;
        width: 20px;
        height: 20px;
        top: 6px;
        left: 6px;
    }

    .category-card-name {
        font-size: 0.75rem;
        padding: 8px;
    }

    .filter-bar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .selection-hint,
    .filter-bar-separator {
        display: none;
    }

    .category-detail-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--space-sm);
    }

    .category-detail::before,
    .category-detail-arrow {
        display: none;
    }

    .selection-bar-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    /* Hide alphabet slider on mobile */
    .alpha-slider,
    .alpha-indicator {
        display: none;
    }

    .gallery-section .container {
        padding-right: var(--space-md);
        padding-left: var(--space-md);
    }
}
