:root {
    --primary-color: #7f94f3;
    --secondary-color: #9b7cba;
    --danger-color: #ff6b6b;
    --success-color: #00b894;
    --light-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    transition: opacity 0.4s ease-in-out;
}

body.fade-out {
    opacity: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}


.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite;
}
.floating-element:nth-child(1) { width: 80px; height: 80px; top: 20%; left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { width: 60px; height: 60px; top: 60%; right: 15%; animation-delay: 3s; }
.floating-element:nth-child(3) { width: 100px; height: 100px; bottom: 10%; left: 20%; animation-delay: 6s; }
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

/* --- API Status Banner --- */
.api-status-banner {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: slideInDown 0.5s ease-out;
}

.api-status-banner.success {
    background: linear-gradient(45deg, #00b894, #00a085);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.api-status-banner.error {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

#statusIcon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3); 
    border-top-color: #ffffff; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background: transparent;
}

.api-status-banner.success #statusIcon {
    animation: none; 
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* --- Header & Nav --- */
.header {
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow-color);
}


.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}
.logo-link {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.navigation-action-container {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.navigation-action-container:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.navigation-action-container p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

#navigateButton {
    font-size: 18px;
    padding: 15px 35px;
}

/* --- Hero Section (Homepage) --- */
.hero-section {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: bounceIn 1s ease-out;
}

.hero-title.hero-h1 {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-title.hero-h2 {
    font-size: 42px;
    font-weight: 500;
    margin-bottom: 20px;
    opacity: 0.95;
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.3s;
    animation-fill-mode: both;
}

/* Visual Search Interface */
.visual-search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.search-form-inner {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 0 10px 0 20px;
    gap: 15px;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

.search-form-inner:focus-within {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.location-pin-icon {
    font-size: 24px;
    transition: transform 0.4s ease;
}

.search-form-inner:focus-within .location-pin-icon {
    transform: scale(1.2) rotate(-15deg);
}

#heroSearchInput {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
    height: 100%;
}

#heroSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s;
}

.search-form-inner:focus-within #heroSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.visual-search-container .btn {
    padding: 10px 25px;
    height: 40px;
}

/* Sonar Pulse Animation */
.pulse-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 1;
    opacity: 0;
    animation: pulse-sonar 4s ease-out infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 1s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 2s;
}

@keyframes pulse-sonar {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}


/* --- Cards --- */
.main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.promo-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}
.promo-card:nth-child(2) { animation-delay: 0.1s; }
.promo-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.promo-card h3 { margin-bottom: 15px; font-size: 22px; }
.promo-card .promo-btn { margin-top: 20px; }

.card {
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px var(--shadow-color);
}
.card h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 26px;
    text-align: center;
}

/* --- Buttons --- */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:hover { transform: translateY(-3px) scale(1.03); }
.btn:active { transform: translateY(-1px) scale(0.98); }

.btn-primary { background: linear-gradient(45deg, var(--danger-color), #ee5a52); color: white; box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5); }

.btn-secondary { background: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.3); }

.btn-full-width { width: 100%; }

.btn .btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.hidden { display: none; }

/* --- Data Insights Page --- */
.data-filters { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 25px; 
    flex-wrap: wrap; 
    justify-content: center; 
    z-index: 10;
    position: relative;
}
.filter-btn { 
    background: #f0f0f0; 
    color: #555; 
    border: 1px solid #ddd; 
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    user-select: none;
}
.filter-btn:hover { 
    background: #e9e9e9; 
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.bar-chart-container {
    min-height: 400px;
    max-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}
.bar {
    width: 50px;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 5px 5px 0 0;
    animation: grow 0.8s ease-out;
    position: relative;
    color: white;
    font-weight: bold;
    text-align: center;
}
.bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    font-size: 12px;
    width: 100%;
}
@keyframes grow {
    from { height: 0; }
}

.info-card {
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    text-align: center;
    margin-top: 25px;
    position: relative;
    z-index: 5;
}

/* Specific styling for insights page */
#dataInsights {
    padding: 30px;
    margin: 20px;
    position: relative;
    z-index: 1;
}

#dataInsights h2 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    position: relative;
    z-index: 5;
}
#keyInsights { animation: flash-in 0.5s ease; }
@keyframes flash-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Map Page --- */
.search-container {
    margin-bottom: 20px;
}
.search-container .search-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}
.search-container .search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.search-container {
    position: relative;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 10;
}

.search-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.edit-destination-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.edit-destination-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.edit-destination-btn:active {
    transform: translateY(0);
}

.route-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    transition: opacity 0.4s, transform 0.4s;
}

.route-options.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.route-btn {
    padding: 8px 18px;
    font-size: 14px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.route-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05) translateY(-2px);
    border-color: var(--primary-color);
}

.destination-pin {
    position: absolute;
    top: 20%;
    left: 75%;
    font-size: 32px;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s, transform 0.4s;
}

.destination-pin.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

.parking-map-area {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: 30px auto;
}
.parking-map {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
    border-radius: 50%;
    position: relative;
    border: 2px dashed rgba(255,255,255,0.3);
    animation: rotate 40s linear infinite;
}

.route-line {
    position: absolute;
    border-style: dashed;
    border-width: 4px;
    border-radius: 50%; /* Used to create curves */
    pointer-events: none;
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.3s;
}

.route-line.visible {
    opacity: 1;
    animation: draw-line 1s ease-out forwards;
}

#route-time-saving {
    top: 28%;
    left: 45%;
    width: 150px;
    height: 150px;
    border-color: #ff6b6b transparent transparent transparent; /* Red for time */
    transform: rotate(135deg);
}

#route-eco-friendly {
    top: 35%;
    left: 25%;
    width: 200px;
    height: 200px;
    border-color: #00b894 transparent transparent transparent; /* Green for eco */
    transform: rotate(70deg);
}

#route-other {
    top: 20%;
    left: 30%;
    width: 250px;
    height: 250px;
    border-color: #74b9ff transparent transparent transparent; /* Blue for other */
    transform: rotate(90deg);
}

@keyframes draw-line {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.parking-spot {
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    animation: pulse 2.5s infinite ease-in-out;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
}
.parking-spot:hover {
    transform: scale(1.2) !important;
    z-index: 10;
    animation-play-state: paused;
}
.spot-available { background: var(--success-color); }
.spot-occupied { background: #e17055; cursor: not-allowed; }
.spot-reserved { background: #fdcb6e; cursor: not-allowed; }
.my-location { background: #e84393; font-size: 24px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: none; }

#map-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(10px);
    z-index: 100;
}

/* --- Spot Info Page --- */
.parking-info { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.live-feed-placeholder { font-size: 50px; line-height: 1; user-select: none; color: #aaa;}

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}
#modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
#modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
#modal-overlay:not(.hidden) #modal-content {
    transform: scale(1);
}
#modal-title { margin-bottom: 10px; }
#modal-text { margin-bottom: 25px; color: #555; }
.modal-buttons { display: flex; gap: 15px; justify-content: center; }

/* --- General & Responsive --- */
.footer { text-align: center; padding: 40px 20px; color: rgba(255, 255, 255, 0.8); margin-top: 40px; }
.page-content { 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; 
    padding: 20px 0; 
    min-height: 100vh;
}
.page-content .card { 
    width: 100%; 
    max-width: 900px; 
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.3); } 50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .hero-title { font-size: 36px; }
    .nav-links { display: none; }
    .parking-info { grid-template-columns: 1fr; }

    .visual-search-container {
        max-width: 90vw;
    }
    
    .search-form-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 15px;
    }

    #heroSearchInput {
        width: 100%;
        order: 1;
        margin-top: 10px;
        text-align: center;
    }

    .location-pin-icon {
        display: none;
    }

    .visual-search-container .btn {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }
}

/* --- Mapbox Map Container --- */
.mapbox-map-container {
    position: relative;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    min-height: 500px;
}

.mapbox-map {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.mapbox-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 200px;
}

.mapbox-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mapbox Controls */
.mapboxgl-ctrl-group {
    background: var(--light-bg) !important;
    border: none !important;
    box-shadow: 0 4px 15px var(--shadow-color) !important;
}

.mapboxgl-ctrl-group button {
    background: transparent !important;
    border: none !important;
    color: #333 !important;
}

.mapboxgl-ctrl-group button:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Custom Mapbox Popup */
.mapboxgl-popup {
    max-width: 300px;
}

.mapboxgl-popup-content {
    background: var(--light-bg) !important;
    border-radius: 15px !important;
    padding: 20px !important;
    box-shadow: 0 8px 32px var(--shadow-color) !important;
    border: none !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.mapboxgl-popup-close-button {
    color: #333 !important;
    font-size: 18px !important;
    padding: 5px !important;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    border-radius: 50% !important;
}

/* Tooltip content styling */
.tooltip-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tooltip-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.tooltip-content small {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Parking Spot Markers */
.parking-marker {
    cursor: pointer;
    transition: all 0.3s ease;
}

.parking-marker:hover {
    transform: scale(1.2);
}

.parking-marker.available {
    filter: drop-shadow(0 0 10px var(--success-color));
}

.parking-marker.occupied {
    filter: drop-shadow(0 0 10px #e17055);
}

.parking-marker.reserved {
    filter: drop-shadow(0 0 10px #fdcb6e);
}

/* Route Lines */
.route-line {
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-dasharray: 10, 5;
    animation: dash 2s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -15;
    }
}

/* Parking Legend Styles */
.parking-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 1000;
    min-width: 200px;
    /* Traffic light styling */
    border-left: 4px solid #333;
}

.parking-legend h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 16px;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color.available {
    background-color: #00b894;
}

.legend-color.occupied {
    background-color: #e17055;
}

.legend-color.expiring {
    background-color: #fdcb6e;
}

.legend-color.mock {
    background-color: #fdcb6e;
}

.legend-info {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: center;
}

.legend-info small {
    color: #888;
    font-size: 11px;
}

/* Refresh Button Styles */
.refresh-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

/* Map Search Interface */
.mapboxgl-ctrl-geocoder {
    width: 100% !important;
    max-width: none !important; 
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 184, 148, 0.3);
}

.mapboxgl-ctrl-geocoder input {
    padding-left: 40px !important; 
    font-size: 16px;
    color: var(--text-color);
    background: transparent !important;
}

.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
    left: 12px !important;
}




/* Recommendations Panel */
.recommendations-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: 80vh;
    background: var(--light-bg);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px var(--shadow-color);
    z-index: 2000;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
    cursor: move; /* Indicate draggable */
    user-select: none; /* Prevent text selection during drag */
}

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

/* Draggable handle for recommendations panel */
.recommendations-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: move; /* Indicate draggable area */
}

/* Prevent drag on interactive elements */
.recommendations-header .close-btn,
.recommendations-header button,
.recommendations-header input {
    cursor: pointer;
    user-select: auto;
}

.recommendations-header h3 {
    margin: 0 0 5px 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.recommendations-header p {
    margin: 0 0 10px 0;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 14px;
}

.recommendations-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.summary-item {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

.recommendations-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px 0;
}

.recommendation-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.recommendation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.recommendation-item.highlighted {
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.recommendation-item:last-child {
    border-bottom: none;
}

.spot-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
}

.spot-details {
    flex: 1;
    margin-right: 10px;
}

.spot-distance {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 3px;
}

.spot-address {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 13px;
    margin-bottom: 3px;
    line-height: 1.3;
}

.spot-time-limit {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
}

.spot-status {
    font-size: 12px;
    font-weight: 600;
    margin-top: 3px;
}

.status-available {
    color: #00b894;
}

.status-expiring {
    color: #fdcb6e;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #00a085;
    transform: translateY(-1px);
}

.recommendations-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.recommendations-footer small {
    color: var(--text-color);
    opacity: 0.6;
    font-size: 12px;
}

/* Mobile responsiveness for recommendations */
@media (max-width: 768px) {
    .recommendations-panel {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 70vh;
    }
    
    .recommendation-item {
        padding: 12px 15px;
    }
    
    .spot-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
        margin-right: 10px;
    }
    
    .navigate-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Map Refresh Button */
.refresh-map-btn {
  position: absolute;
  top: 20px;
  left: 20px;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;

  width: 44px;
  height: 44px;
  border-radius: 9999px;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  color: #2a91f2;
}

.refresh-map-btn:hover {
  background: rgba(0, 0, 0, 0.12) !important;
}

.refresh-map-btn:active {
  background: rgba(0, 0, 0, 0.18) !important;
  transform: translateY(0) scale(0.98);
}

.refresh-map-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.45);
}

.refresh-map-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.refresh-icon {
  width: 30px;
  height: 30px;
  display: block;
}

.refresh-map-btn.loading .refresh-icon {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}



/* Last Updated Text */
.last-updated {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin: 8px 0;
    font-style: italic;
}

/* --- Parking Recommendation Panel --- */
.recommendation-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px var(--shadow-color);
    z-index: 1000;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.recommendation-panel.hidden {
    display: none;
}

.recommendation-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    position: relative;
}

.recommendation-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.recommendation-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.close-recommendations {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-recommendations:hover {
    background: rgba(255, 255, 255, 0.2);
}

.recommendation-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px 0;
}

.recommendation-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.recommendation-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.recommendation-item:last-child {
    border-bottom: none;
}

.recommendation-rank {
    background: var(--success-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
}

.recommendation-details {
    flex: 1;
    min-width: 0;
}

.recommendation-distance {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 4px;
}

.recommendation-address {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    line-height: 1.3;
}

.recommendation-time-limit {
    font-size: 12px;
    color: #666;
    background: rgba(0, 184, 148, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.navigate-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.navigate-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.recommendation-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.recommendation-footer small {
    color: #666;
    font-size: 11px;
}

.show-more-section {
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.show-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    width: 100%;
}

.show-more-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.show-more-section small {
    color: #666;
    font-size: 12px;
    display: block;
}

.no-recommendations {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.no-recommendations .tips-section {
    text-align: left;
}

.no-recommendations p {
    margin: 10px 0;
    font-size: 14px;
}

.no-recommendations > p:first-child {
    font-size: 16px;
    font-weight: 500;
}

/* Mobile responsiveness for recommendation panel */
@media (max-width: 768px) {
    .recommendation-panel {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 60vh;
    }
    
    .recommendation-item {
        padding: 10px 15px;
    }
    
    .recommendation-details {
        font-size: 12px;
    }
    
    .navigate-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Spot Details Panel */
.spot-details-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90vw;
    background: var(--light-bg);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px var(--shadow-color);
    z-index: 3000;
    animation: fadeInScale 0.3s ease-out;
    cursor: move; /* Indicate draggable */
    user-select: none; /* Prevent text selection during drag */
}

/* Draggable handle for spot details panel */
.details-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: move; /* Indicate draggable area */
}

/* Prevent drag on interactive elements */
.details-header .close-details-btn,
.details-header button,
.details-header input {
    cursor: pointer;
    user-select: auto;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.details-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.close-details-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-details-btn:hover {
    opacity: 1;
}

.details-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.detail-item {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.4;
}

.detail-item strong {
    color: var(--text-color);
    font-weight: 600;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-available {
    background: rgba(0, 184, 148, 0.1);
    color: #00b894;
}

.status-badge.status-expiring {
    background: rgba(253, 203, 110, 0.1);
    color: #fdcb6e;
}

.details-actions {
    padding: 15px 20px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.copy-coordinates-btn,
.copy-address-btn {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-coordinates-btn:hover,
.copy-address-btn:hover {
    background: #00a085;
    transform: translateY(-1px);
}

/* Copy Success/Error Messages */
.copy-success-message,
.copy-error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 4000;
    animation: slideDown 0.3s ease-out;
}

.copy-success-message {
    background: #00b894;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.copy-error-message {
    background: #e17055;
    color: white;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile responsiveness for spot details */
@media (max-width: 768px) {
    .spot-details-panel {
        width: 95vw;
        max-height: 80vh;
    }
    
    .details-content {
        max-height: 250px;
    }
    
    .details-actions {
        flex-direction: column;
    }
    
    .copy-coordinates-btn,
    .copy-address-btn {
        width: 100%;
    }
}

/* Dragging state styles */
.recommendations-panel.dragging,
.spot-details-panel.dragging {
    opacity: 0.8;
    transition: none; /* Disable transitions during drag */
}

/* Ensure content areas are not draggable */
.recommendations-list,
.details-content,
.details-actions {
    cursor: auto;
    user-select: auto;
}
