/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --color-bg: #0a0f1a;
    --color-surface: #131b2e;
    --color-surface-light: #1a2540;
    --color-primary: #4ecdc4;
    --color-accent: #ff6b9d;
    --color-text: #e8edf5;
    --color-text-muted: #8892a6;
    --color-border: #2a3654;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a2540 0%, #0d1525 50%, #0a1628 100%);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></svg>');
    background-size: 50px 50px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin: 0 0 10px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    margin: 0 0 5px;
}

.hero-dates {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin: 0;
    font-weight: 500;
}

/* Map */
.map-section {
    padding: 20px;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.map-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    height: 500px;
}

#map {
    height: 100%;
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Locations Sidebar */
.locations-sidebar {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 15px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
}

.locations-sidebar h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Route List */
.route-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-day {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.route-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.route-day-header span {
    font-weight: 400;
    color: var(--color-text-muted);
    opacity: 0.7;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--color-surface-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.route-item:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.route-item.active {
    background: var(--color-bg);
    border-color: var(--color-accent);
}

.route-label {
    min-width: 32px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.route-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.route-text strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.route-text span {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map responsive */
@media (max-width: 900px) {
    .map-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    #map {
        height: 350px;
    }

    .locations-sidebar {
        overflow-y: visible;
        padding: 12px;
    }

    .route-list {
        gap: 8px;
    }

    .route-day {
        gap: 4px;
    }

    .route-item {
        padding: 6px;
    }

    .route-text strong {
        font-size: 0.8rem;
    }

    .route-text span {
        font-size: 0.65rem;
    }
}

/* Overview */
.overview {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.overview h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--color-primary);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    border: 1px solid var(--color-border);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 8px;
}

.highlights {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--color-border);
}

.highlights h3 {
    margin: 0 0 15px;
    color: var(--color-accent);
    font-size: 1.2rem;
}

.highlights ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.highlights li {
    padding-left: 24px;
    position: relative;
    color: var(--color-text-muted);
}

.highlights li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* Timeline */
.timeline {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.timeline h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--color-primary);
}

.day {
    background: var(--color-surface);
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: border-color 0.2s;
}

.day:hover {
    border-color: var(--color-primary);
}

.day-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    gap: 15px;
}

.day-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-bg);
    flex-shrink: 0;
}

.day-info {
    flex: 1;
}

.day-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.day-date {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.day-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--color-surface-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.day-toggle:hover {
    background: var(--color-border);
}

.toggle-icon {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--color-text);
    border-bottom: 2px solid var(--color-text);
    transform: rotate(45deg);
    transition: transform 0.3s;
    margin-top: -4px;
}

.day.expanded .toggle-icon {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.day-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.day.expanded .day-content {
    max-height: 2000px;
}

.day-description {
    padding: 0 20px 20px;
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

.day-description p {
    margin: 0 0 15px;
    color: var(--color-text-muted);
}

.day-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.day-details .detail {
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-surface-light);
    padding: 6px 12px;
    border-radius: 6px;
}

.day-details .detail strong {
    color: var(--color-primary);
}

/* Gallery */
.day-gallery {
    padding: 0 20px 20px;
}

.day-gallery.has-media {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--color-surface-light);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
}

.gallery-item.video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    pointer-events: none;
}

.gallery-empty {
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
    background: var(--color-surface-light);
    border-radius: 8px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    position: relative;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 90vw;
    max-height: 80vh;
    display: none;
}

.lightbox-content img.active,
.lightbox-content video.active {
    display: block;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 20px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 0;
    right: 0;
    font-size: 2.5rem;
}

.lightbox-prev {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
}

.lightbox-next {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
}

.lightbox-caption {
    color: var(--color-text-muted);
    text-align: center;
    padding: 15px;
    max-width: 600px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--color-border);
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .hero {
        padding: 60px 20px;
    }

    .day-header {
        padding: 15px;
    }

    .day-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .day-info h3 {
        font-size: 1rem;
    }

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

    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 10px;
    }
}

/* Leaflet customization */
.leaflet-container {
    background: #e8e8e8;
    font-family: var(--font-sans);
}

.custom-pin {
    background: none !important;
    border: none !important;
}

.custom-popup .leaflet-popup-content-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.custom-popup .leaflet-popup-tip {
    background: white;
}

.route-popup {
    font-family: var(--font-sans);
    padding: 8px;
    min-width: 200px;
    max-width: 280px;
}

.route-popup .popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.route-popup .popup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.route-popup .popup-day {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

.route-popup h4 {
    margin: 0 0 2px;
    color: #1a1a2e;
    font-size: 1.15rem;
    font-weight: 700;
}

.route-popup .popup-country {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.route-popup .popup-info {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.4;
}

.route-popup .popup-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4ecdc4, #44a8a0);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.route-popup .popup-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.route-popup .popup-link-day {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.route-popup .popup-link-day:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
