:root {
    --primary-color: #1d3557;
    --primary-light: #457b9d;
    --accent-red: #e63946;
    --accent-gold: #d4af37;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.18);
    --font-heading: 'Merriweather', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 380px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-light);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Navbar */
.navbar {
    height: 65px;
    background-color: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-icon {
    font-size: 1.8rem;
    color: var(--accent-gold);
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.75rem;
    color: #a8dadc;
    font-weight: 300;
}

.expedition-selector {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 30px;
}

.filter-btn {
    border: none;
    background: transparent;
    color: #f1faee;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.filter-btn.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.exp1-dot { background-color: var(--accent-red); }
.exp2-dot { background-color: var(--primary-light); }

.nav-actions {
    display: flex;
    align-items: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Main Container Layout */
.main-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
}

.search-box {
    position: relative;
    margin-bottom: 0.75rem;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-light);
}

.stats-summary {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stops-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.stop-item {
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stop-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-light);
}

.stop-item.expedition-1::before {
    background: var(--accent-red);
}

.stop-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.stop-item.active {
    background: #f0f7ff;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.stop-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.stop-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.stop-country {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.stop-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Map Wrapper */
.map-wrapper {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Timeline Control Bar Overlay */
.timeline-control-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(0,0,0,0.08);
}

.ctrl-btn {
    border: none;
    background: #e9ecef;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: #dee2e6;
}

.ctrl-btn.play-btn {
    width: auto;
    padding: 0 16px;
    border-radius: 20px;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    gap: 8px;
}

.ctrl-btn.play-btn:hover {
    background: var(--primary-light);
}

.tour-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
}

/* Custom Vehicle Marker for Tatra T87 */
.tatra-animated-marker {
    background: none;
    border: none;
}

.tatra-car-container {
    position: relative;
    width: 60px;
    height: 30px;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s ease;
}

.tatra-car-container:hover {
    transform: scale(1.2);
}

.tatra-car-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Custom Leaflet Markers & Popups */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.popup-content {
    max-width: 280px;
    padding: 4px;
}

.popup-content h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.popup-content .popup-country {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.popup-content .popup-date {
    font-size: 0.8rem;
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-content p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 10px;
}

.popup-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.popup-thumb:hover {
    opacity: 0.9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow-y: auto;
}

.close-modal, .close-gallery {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-tabs {
    display: flex;
    gap: 8px;
    margin: 1.2rem 0;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
}

.modal-photo {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.2rem;
}

.badge {
    background: #eef2f7;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Gallery Modal */
.gallery-modal .gallery-content {
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
}

.gallery-modal img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.gallery-caption {
    color: #ffffff;
    margin-top: 12px;
    font-size: 1rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .main-container {
        flex-direction: column-reverse;
    }

    .sidebar {
        width: 100%;
        height: 40vh;
    }

    .map-wrapper {
        height: 60vh;
    }

    .timeline-control-bar {
        bottom: 12px;
        width: 90%;
        justify-content: center;
    }
}
