:root {
    --primary-color: #00a8ff;
    --secondary-color: #ff6b6b;
    --accent-color: #feca57;
    --dark-bg: #1e272e;
    --dark-card: #2f3640;
    --text-light: #f5f6fa;
    --text-muted: #dcdde1;
    --glass-bg: rgba(47, 54, 64, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.main-nav {
    height: 60px;
    background: var(--dark-card);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    border-radius: 8px 8px 0 0;
}

/* App Container */
.app-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

/* Views */
.view-section {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    background: var(--dark-bg);
    display: none;
}

.view-section.active {
    display: block;
}

#map-view.active {
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: 400px;
    background: var(--dark-card);
    display: none;
    /* Hidden by default on desktop */
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    height: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.app-container.show-sidebar .sidebar {
    display: flex;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.mobile-nav-links {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.mobile-nav-links .nav-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.mobile-nav-links .nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}

.mobile-nav-links .nav-btn.active {
    background: rgba(0, 168, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    border-radius: 8px;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.view-map-btn {
    width: 100%;
    background: rgba(0, 168, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.view-map-btn:hover {
    background: var(--primary-color);
    color: white;
}

.update-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 5px;
    transition: all 0.3s;
}

.update-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.stats-summary {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
}

/* Day Filter */
.day-filter {
    padding: 15px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid var(--glass-border);
}

.day-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.day-btn:hover,
.day-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Timeline */
.timeline {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 80px;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 25px;
    border-left: 2px solid var(--glass-border);
    cursor: pointer;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-light);
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Map */
.map-container {
    flex: 1;
    position: relative;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    z-index: 1000;
}

/* View Content */
.view-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--dark-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.summary-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-day-badge {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    border-radius: 10px;
    min-width: 60px;
    text-align: center;
    font-weight: 700;
}

.summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.summary-stats-horizontal {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.summary-card.expanded {
    flex-direction: column;
    align-items: stretch;
    background: rgba(47, 54, 64, 0.98);
    cursor: default;
    border-color: var(--primary-color);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
    transform: none;
}

.summary-card.expanded:hover {
    transform: none;
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    display: none;
    animation: fadeIn 0.3s ease;
}

.summary-card.expanded .summary-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-inner-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

.mini-map-container {
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
}

.tiny-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tiny-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.tiny-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.tiny-time {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.tiny-activity {
    font-weight: 600;
    font-size: 0.95rem;
}

.tiny-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.summary-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.summary-card.expanded .summary-close-btn {
    display: flex;
}

.summary-card.expanded .summary-stats-horizontal span:last-child {
    display: none;
}

@media (max-width: 900px) {
    .summary-inner-grid {
        grid-template-columns: 1fr;
    }
}

.summary-activities-preview {
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    background: var(--dark-card);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.itinerary-table {
    width: 100%;
    border-collapse: collapse;
}

/* Directions & Info Buttons */
.btn-directions,
.btn-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white !important;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    white-space: nowrap;
}

.btn-directions {
    background: linear-gradient(135deg, #34a853, #2a8d46);
}

.btn-info {
    background: linear-gradient(135deg, var(--secondary-color), #e84118);
}

.btn-directions:hover,
.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.btn-directions svg,
.btn-info svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.itinerary-table th,
.itinerary-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        z-index: 1500;
        transform: translateX(-100%);
        background: var(--dark-card);
        overflow-y: auto;
        /* Enable scrolling for the whole sidebar */
        display: block !important;
        /* Force visibility so toggle works on all pages */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-nav-links {
        display: flex !important;
        /* Force visibility */
    }

    .timeline {
        overflow-y: visible;
        /* Disable inner scrolling */
        height: auto;
        padding-bottom: 40px;
    }

    .map-container {
        height: calc(100vh - 60px);
    }

    .charts-container,
    .grid-container {
        grid-template-columns: 1fr;
    }

    .view-content {
        padding: 15px;
    }

    .itinerary-table {
        font-size: 0.8rem;
    }
}