/* ===== CSS VARIABLES ===== */
:root {
    /* Colors */
    --primary: #1a237e;
    --primary-light: #3949ab;
    --primary-dark: #000051;
    --accent: #d4af37;
    --accent-light: #e4c55a;
    --accent-dark: #b4941f;
    
    /* Neutrals */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-dark: #1a1a1a;
    --bg-dark-secondary: #252525;
    
    /* Text */
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-light: #9e9e9e;
    --text-on-dark: #fafafa;
    
    /* Fonts */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;
    
    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.25);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-dark: #fafafa;
    --bg-dark-secondary: #f5f5f5;
    --text-primary: #fafafa;
    --text-secondary: #b0b0b0;
    --text-light: #757575;
    --text-on-dark: #212121;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.splash-screen.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.ihs-logo {
    margin-bottom: var(--space-lg);
    animation: pulse 2s ease infinite;
}

.splash-title {
    color: var(--text-on-dark);
    margin-bottom: var(--space-sm);
}

.splash-subtitle {
    color: var(--text-on-dark);
    opacity: 0.8;
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.splash-dates {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: var(--accent);
    width: 0;
    animation: loadingProgress 2s ease forwards;
}

/* ===== DESKTOP NAVIGATION SIDEBAR ===== */
.desktop-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-md);
}

.nav-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.nav-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.nav-timeline {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    position: relative;
}

.timeline-track {
    position: absolute;
    left: calc(var(--space-lg) + 12px);
    top: var(--space-lg);
    bottom: var(--space-lg);
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--primary));
    opacity: 0.3;
}

.nav-stops {
    position: relative;
    z-index: 1;
}

.nav-stop {
    display: flex;
    align-items: center;
    padding: var(--space-sm) 0;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.nav-stop-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--primary);
    margin-right: var(--space-md);
    transition: all var(--transition-base);
    position: relative;
    z-index: 2;
}

.nav-stop.active .nav-stop-marker {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.nav-stop:hover .nav-stop-marker {
    transform: scale(1.1);
    border-color: var(--accent);
}

.nav-stop-content {
    flex: 1;
}

.nav-stop-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.nav-stop-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-light);
}

.nav-stop.active .nav-stop-name {
    color: var(--accent);
}

.nav-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.05);
    transform: rotate(180deg);
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    box-shadow: var(--shadow-sm);
}

.mobile-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
} 

.mobile-progress {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-secondary);
    z-index: 999;
    display: none;
    align-items: center;
    padding: 0 var(--space-md);
    box-shadow: var(--shadow-sm);
} 

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    width: 0%;
    transition: width var(--transition-base);
}

.mobile-menu-toggle {
    margin-left: auto;

    background: none;
    border: none;
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
}

.mobile-menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-base);
}

.mobile-menu-toggle span:nth-child(1) { top: 8px; }
.mobile-menu-toggle span:nth-child(2) { top: 14px; }
.mobile-menu-toggle span:nth-child(3) { top: 20px; }

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 14px;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 14px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    z-index: 99;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    display: none;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.mobile-menu-stops {
    padding: var(--space-md);
}

.mobile-menu-stop {
    padding: var(--space-md);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all var(--transition-base);
}

.mobile-menu-stop:hover {
    background: rgba(0,0,0,0.02);
    padding-left: calc(var(--space-md) + 8px);
}

.mobile-menu-stop.active {
    background: rgba(212, 175, 55, 0.1);
    border-left: 3px solid var(--accent);
}

/* ===== MAP CONTAINER ===== */
.map-container {
    position: fixed;
    top: 0;
    left: 280px;
    right: 40%;
    height: 100vh;
    z-index: 1;
    background: var(--bg-primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

.content-wrapper {
    width: 40%;
    margin-left: auto;
    background: var(--bg-secondary);
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

/* Gallery Container */
.gallery-container {
    position: relative;
}

/* Location Sections */
.location-section {
    min-height: 100vh;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.location-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.section-content {
    padding: var(--space-xxl) var(--space-xl);
}

.date-header {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.location-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.gallery-item {
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    box-shadow: var(--shadow-md);
}

.gallery-image:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.clickable-gallery {
    background-size: cover;
    background-position: center;
}

.filename-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.image-caption {
    font-weight: 500;
    margin-top: var(--space-sm);
    color: var(--text-primary);
}

/* Location Links */
.location-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.location-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.location-link:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Navigation Controls */
.nav-controls {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 50;
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== IMAGE MODAL ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: all var(--transition-base);
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-image {
    max-width: 90%;
    max-height: 80vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-xl);
    border-radius: 8px;
}

.modal-caption {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 3rem;
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    border-radius: 8px;
}

.modal-prev { left: var(--space-lg); }
.modal-next { right: var(--space-lg); }

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes loadingProgress {
    to { width: 100%; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .map-container {
        right: 50%;
    }
    
    .content-wrapper {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    .mobile-progress {
        display: flex;
    }
    .mobile-menu {
        display: flex;
    }
    /* Hide desktop elements */
    .desktop-nav,
    .map-container,
    .timeline-nav {
        display: none;
    }
    
    /* Show mobile elements */
    .mobile-header,
    .mobile-progress,
    .mobile-menu {
        display: flex;
    }
    
    /* Adjust main content */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 100px; /* 60px header + 40px progress bar */
    }
    
    .content-wrapper {
        width: 100%;
        box-shadow: none;
    }
    
    /* Mobile sections */
    .location-section {
        min-height: auto;
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        margin-bottom: var(--space-xl);
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .location-section:last-child {
        border-bottom: none;
    }
    
    .section-content {
        padding: var(--space-xl) var(--space-md);
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .nav-controls {
        display: none;
    }
    
    /* Typography adjustments */
    h2 {
        font-size: 1.75rem;
    }
    
    .location-description {
        font-size: 1rem;
    }
    
    /* Modal adjustments */
    .modal-prev,
    .modal-next {
        font-size: 2rem;
        padding: 10px;
    }
    
    .modal-image {
        max-width: 95%;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .section-content {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .gallery-image {
        height: 160px;
    }
}

/* ===== LEAFLET CUSTOMIZATION ===== */
.leaflet-control-zoom {
    margin-top: 80px !important;
}

.leaflet-container {
    font-family: var(--font-body);
}

.leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
    background: var(--bg-secondary);
}

/* Custom markers */
.custom-marker {
    background: var(--accent);
    color: var(--text-on-dark);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    border: 3px solid white;
    transition: all var(--transition-base);
}

.custom-marker:hover {
    transform: scale(1.1);
}

.custom-marker.active {
    background: var(--primary);
    transform: scale(1.2);
}
