/* Routes Page Styles */

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.5); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ===================================
   HERO SECTION - ENHANCED
   =================================== */
.routes-hero {
    position: relative;
    height: 450px;
    min-height: 690px;
    overflow: hidden;
}

.routes-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.routes-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(44, 62, 53, 0.88) 0%,
        rgba(44, 95, 79, 0.82) 100%);
}

/* Decorative elements - minimal */
.routes-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.routes-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.4), transparent);
    pointer-events: none;
    z-index: 1;
}

.routes-hero-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    z-index: 2;
}

.routes-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 28px;
}

.routes-hero-badge i {
    color: rgba(255, 255, 255, 0.7);
}

.routes-hero h1 {
    font-family: Georgia, serif;
    font-size: 48px;
    font-weight: 400;
    color: white;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.routes-hero-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.75);
    max-width: 650px;
    line-height: 1.7;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Hero Stats */
.routes-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px 40px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
}

.routes-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.routes-hero-stat-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: white;
}

.routes-hero-stat-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.routes-hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

/* ===================================
   FILTERS TOP BAR - HORIZONTAL
   =================================== */
.filters-top-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.filters-top-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.filters-horizontal {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    flex-wrap: wrap;
}

.filters-top-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* View Toggle Inline */
.view-toggle-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 245, 240, 0.6);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.view-toggle-btn-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn-inline:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.view-toggle-btn-inline.active {
    background: white;
    color: var(--forest-green, #2c5f4f);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Stats Inline */
.stats-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(245, 245, 240, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.stats-inline-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.stats-inline-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--forest-green, #2c5f4f);
}

/* ===================================
   FILTER SIDEBAR - LEGACY (OLD STYLES)
   =================================== */
.filters-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.filters-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Inner container - override Tailwind classes */
.filters-container > div {
    padding: 16px 18px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Override space-y-6 to space-y-4 for compactness */
.filters-container .space-y-6 > * + * {
    margin-top: 14px !important;
}

/* Filter section labels */
.filters-container label {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b !important;
    margin-bottom: 10px;
    display: block;
}

/* Filter header */
.filters-container h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

/* Filter buttons (badges) styling */
.filters-container .badge {
    padding: 7px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #475569 !important;
}

.filters-container .badge:hover {
    border-color: #94a3b8 !important;
    background: #f1f5f9 !important;
}

/* Active state for filter badges - with checkmark icon effect */
.filters-container .badge.text-white {
    border-color: transparent !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Checkmark indicator for active badges */
.filters-container .badge.text-white::before {
    content: '✓';
    margin-right: 4px;
    font-size: 10px;
    font-weight: 700;
}

/* Difficulty badge colors when active */
.filters-container .badge[data-filter-type="difficulty"][data-filter-value="easy"].text-white {
    background: #10b981 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.filters-container .badge[data-filter-type="difficulty"][data-filter-value="moderate"].text-white {
    background: #f59e0b !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.filters-container .badge[data-filter-type="difficulty"][data-filter-value="hard"].text-white {
    background: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Type badge color when active */
.filters-container .badge[data-filter-type="type"].text-white {
    background: var(--forest-green, #2c5f4f) !important;
    box-shadow: 0 2px 8px rgba(44, 95, 79, 0.3);
}

/* Season badge color when active */
.filters-container .badge[data-filter-type="season"].text-white {
    background: var(--forest-green, #2c5f4f) !important;
    box-shadow: 0 2px 8px rgba(44, 95, 79, 0.3);
}

/* Slider styling */
.filters-container .slider,
.filters-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.filters-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--forest-green, #2c5f4f);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(44, 95, 79, 0.3);
    transition: transform 0.2s ease;
}

.filters-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Clear filters button */
.filters-container #clear-all-filters {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #ef4444 !important;
    opacity: 0.8;
}

.filters-container #clear-all-filters:hover {
    opacity: 1;
}

.filter-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title i {
    color: #3b82f6;
    width: 18px;
    height: 18px;
}

/* Custom Checkboxes */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.filter-checkbox:hover {
    background: rgba(59, 130, 246, 0.08);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox .checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-checkbox input:checked + .checkbox-custom {
    background: var(--forest-green, #2c5f4f);
    border-color: transparent;
}

.filter-checkbox input:checked + .checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.filter-checkbox .checkbox-label {
    font-size: 14px;
    color: #374151;
    flex: 1;
}

.filter-checkbox .checkbox-count {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Difficulty badges */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-easy {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.difficulty-medium {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.difficulty-hard {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* View Toggle */
.view-toggle-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.view-toggle-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 10px;
}

.view-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.view-toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.view-toggle-btn.active {
    border-color: transparent;
    background: var(--forest-green, #2c5f4f);
    color: white;
    box-shadow: 0 2px 8px rgba(44, 95, 79, 0.3);
}

.view-toggle-btn i {
    width: 18px;
    height: 18px;
}

.view-toggle-btn span {
    font-size: 11px;
    font-weight: 600;
}

/* Stats Box */
.stats-box {
    background: rgba(245, 245, 240, 0.6);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.stats-box-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.stats-box-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--forest-green, #2c5f4f);
    line-height: 1.1;
}

.stats-box-note {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
}

/* ===================================
   GRID VIEW HEADER
   =================================== */
#grid-view > .mb-8 {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#grid-view > .mb-8 h2 {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 8px;
}

#grid-view > .mb-8 p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #6b7280;
    font-size: 15px;
    font-weight: 400;
}

/* Grid spacing */
#routes-grid {
    gap: 28px;
}

/* Route card overrides for better spacing */
#routes-grid .route-card .p-4 {
    padding: 20px 24px;
}

#routes-grid .route-card .px-4 {
    padding-left: 24px;
    padding-right: 24px;
}

#routes-grid .route-card .pb-4 {
    padding-bottom: 24px;
}

/* Improved button styling in route cards */
#routes-grid .route-card button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-top: 16px;
    padding: 12px 20px;
    height: auto;
    border-radius: 12px;
    font-weight: 600;
    background: var(--forest-green, #2c5f4f) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#routes-grid .route-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================================
   ROUTE CARDS - MINIMAL
   =================================== */
.route-card {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.route-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.08);
}

.route-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.route-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.route-card:hover .route-card-image img {
    transform: scale(1.15);
}

/* Image overlay gradient */
.route-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    pointer-events: none;
}

/* Difficulty badge on card */
.route-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.route-card-badge.easy {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.route-card-badge.medium {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.route-card-badge.hard {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* Favorite button */
.route-card-favorite {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.route-card-favorite:hover {
    background: white;
    transform: scale(1.1);
}

.route-card-favorite i {
    width: 20px;
    height: 20px;
    color: #ef4444;
    transition: all 0.3s ease;
}

.route-card-favorite.active i {
    fill: #ef4444;
}

.route-card-content {
    padding: 24px;
}

.route-card-title {
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-card-title i {
    color: var(--forest-green, #2c5f4f);
    width: 20px;
    height: 20px;
}

.route-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.route-card-meta-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.route-card-meta-item i {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.route-card-description {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.route-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.route-card-btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--forest-green, #2c5f4f);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.route-card-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(44, 95, 79, 0.3);
}

.route-card-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.route-card-btn:hover i {
    transform: translateX(4px);
}

/* ===================================
   YANDEX MAP: disable global transitions
   that cause jittering during zoom
   =================================== */
#map,
#map *,
[class*="ymaps-"] {
    transition-property: none !important;
    transition-duration: 0s !important;
}

/* ===================================
   MAP VIEW LAYOUT
   =================================== */
.routes-map-layout {
    position: relative;
    display: flex;
    gap: 16px;
}

.routes-map-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.routes-map-main {
    flex: 1;
    height: 600px;
}

/* ===================================
   MAP CONTAINER - MINIMAL
   =================================== */
.map-container-wrapper {
    position: relative;
    background: rgba(245, 245, 240, 0.5);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.map-container-wrapper:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

/* ===================================
   DETAILS PANEL & TOGGLE
   =================================== */
.routes-details-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 384px;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.routes-details-toggle {
    position: fixed;
    top: 50%;
    right: 384px;
    transform: translateY(-50%);
    z-index: 50;
    border-radius: 8px 0 0 8px;
    height: 80px;
    padding: 0 12px;
    border: none;
    cursor: pointer;
}

/* Routes List in Map View */
.routes-list-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-height: 600px;
    overflow-y: auto;
}

/* Custom scrollbar for routes list */
.routes-list-container::-webkit-scrollbar {
    width: 6px;
}

.routes-list-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.routes-list-container::-webkit-scrollbar-thumb {
    background: var(--forest-green, #2c5f4f);
    border-radius: 3px;
}

.routes-list-container::-webkit-scrollbar-thumb:hover {
    background: #234d40;
}

.routes-list-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.routes-list-title i {
    color: var(--forest-green, #2c5f4f);
}

.route-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.route-list-item:hover {
    background: rgba(44, 95, 79, 0.06);
    border-color: rgba(44, 95, 79, 0.15);
}

.route-list-item.active {
    background: rgba(44, 95, 79, 0.08);
    border-color: var(--forest-green, #2c5f4f);
}

.route-list-item-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.route-list-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.route-list-item-content {
    flex: 1;
    min-width: 0;
}

.route-list-item-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-list-item-meta {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* ===================================
   DETAILS PANEL - ENHANCED
   =================================== */
.details-panel {
    background: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

.details-panel-header {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.details-panel-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-panel-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, white, transparent);
}

.details-panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.details-panel-close:hover {
    background: white;
    transform: scale(1.1);
}

.details-panel-content {
    padding: 24px;
}

.details-panel-title {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 16px;
}

.details-panel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.details-stat {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.details-stat-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--forest-green, #2c5f4f);
    margin-bottom: 4px;
}

.details-stat-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* ===================================
   ROUTE MODAL
   =================================== */
.route-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.route-modal-overlay.active {
    display: flex !important;
}

.route-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
    /* Map view: stack sidebar above map */
    .routes-map-layout {
        flex-direction: column;
    }

    .routes-map-sidebar {
        width: 100%;
    }

    .routes-map-main {
        flex: none;
        height: 500px;
    }

    .routes-list-container {
        max-height: 250px;
    }

    /* Details panel: narrower on tablets */
    .routes-details-panel {
        width: 320px;
    }

    .routes-details-toggle {
        right: 320px;
    }
}

@media (max-width: 768px) {

    /* --- Hero --- */
    .routes-hero {
        height: auto;
        min-height: auto;
    }

    .routes-hero-bg {
        background-attachment: scroll;
    }

    .routes-hero-content {
        padding: 60px 20px 40px;
    }

    .routes-hero-badge {
        font-size: 11px;
        padding: 6px 14px;
        margin-bottom: 20px;
    }

    .routes-hero h1 {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .routes-hero-text {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .routes-hero-stats {
        flex-direction: row;
        gap: 0;
        padding: 16px 20px;
        width: 100%;
        justify-content: space-around;
    }

    .routes-hero-stat-value {
        font-size: 22px;
    }

    .routes-hero-stat-label {
        font-size: 10px;
    }

    .routes-hero-stat-divider {
        width: 1px;
        height: 32px;
    }

    /* --- Filters --- */
    .filters-top-bar {
        padding: 14px 16px;
        border-radius: 12px;
        overflow: hidden;
    }

    .filters-top-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filters-horizontal {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        flex: none;
        width: 100%;
        min-width: 0;
    }

    /* All nested flex containers inside filters */
    .filters-horizontal > div {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .filters-horizontal .flex {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .filters-horizontal label {
        font-size: 12px !important;
        white-space: nowrap;
        width: 100%;
        margin-bottom: 4px;
    }

    /* Difficulty buttons row */
    .filters-horizontal .badge {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* Slider: full width */
    .filters-horizontal input[type="range"] {
        width: 100% !important;
        min-width: 0;
    }

    .filters-horizontal .flex.items-center.gap-3 {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .filters-horizontal .flex.items-center.gap-3 > .flex {
        min-width: 0 !important;
        width: 100% !important;
    }

    .filters-top-controls {
        justify-content: space-between;
        width: 100%;
    }

    .view-toggle-btn-inline {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stats-inline {
        padding: 6px 12px;
    }

    .stats-inline-label {
        font-size: 12px;
    }

    .stats-inline-value {
        font-size: 14px;
    }

    /* --- Grid View --- */
    #grid-view > .mb-8 {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    #grid-view > .mb-8 h2 {
        font-size: 20px;
    }

    #routes-grid {
        gap: 16px;
    }

    .route-card-image {
        height: 180px;
    }

    .route-card-content {
        padding: 16px;
    }

    .route-card-title {
        font-size: 17px;
    }

    /* --- Map View --- */
    .routes-map-sidebar {
        width: 100%;
        order: 2;
    }

    .routes-list-container {
        max-height: 180px;
        border-radius: 12px;
        padding: 8px;
    }

    .routes-map-main {
        flex: none;
        height: 350px;
        order: 1;
    }

    #map-view > .mb-6 {
        margin-bottom: 12px !important;
    }

    #map-view > .mb-6 h2 {
        font-size: 18px;
    }

    #map-view > .mb-6 p {
        font-size: 13px;
    }

    /* --- Details Panel (mobile fullscreen) --- */
    .routes-details-panel {
        width: 100%;
    }

    .routes-details-toggle {
        display: none;
    }

    /* --- Modal (mobile fullscreen) --- */
    .route-modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .route-modal-content {
        border-radius: 0;
        max-height: 100vh;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .routes-hero-stats {
        padding: 12px 8px;
    }

    .routes-hero-stat-value {
        font-size: 18px;
    }

    .routes-hero-stat-label {
        font-size: 9px;
    }

    .routes-map-main {
        height: 300px;
    }

    .route-card-image {
        height: 160px;
    }
}
