:root {
    --primary: #00f2ea;
    --primary-glow: rgba(0, 242, 234, 0.4);
    --secondary: #ff0055;
    --bg-dark: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.8);
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --sidebar-width: 320px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), #00aaff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.status-card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dot.online {
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.dot.busy {
    background-color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.stat-item {
    background: var(--card-bg);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

.charger-details {
    margin-top: auto;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.charger-details.hidden {
    opacity: 0.5;
    pointer-events: none;
}

.charger-details h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-key {
    color: var(--text-muted);
}

.detail-val {
    color: var(--text-main);
    font-weight: 500;
}

/* Map Area */
.map-container {
    flex: 1;
    position: relative;
    background-color: #0b0f19;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Controls */
.controls-overlay {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.primary-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.primary-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

/* Map Popup CTA Style */
.popup-cta-btn {
    background: linear-gradient(135deg, #00f2ea 0%, #00c2ff 100%);
    border: none;
    color: #0f172a !important;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 242, 234, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 242, 234, 0.5);
    filter: brightness(1.1);
}

.popup-cta-btn:active {
    transform: translateY(0);
}

.popup-cta-btn span {
    font-size: 1.1rem;
}

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

.btn-icon {
    font-size: 1.25rem;
}

/* Secondary Button (AR) */
.secondary-btn {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    /* Fallback */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 153, 0.6);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.radar-scan {
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: relative;
    margin-bottom: 2rem;
    background: radial-gradient(circle, rgba(0, 242, 234, 0.1) 0%, transparent 70%);
}

.radar-scan::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, transparent 50%, var(--primary-glow) 100%);
    border-radius: 100% 0 0 0;
    transform-origin: 0% 0%;
    animation: radar-spin 2s infinite linear;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: var(--text-muted);
    font-size: 1rem;
}

@keyframes radar-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* User Location Marker */
.user-marker-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.user-core {
    width: 28px;
    height: 28px;
    background: var(--bg-dark);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary);
    z-index: 2;
    box-shadow: 0 0 10px var(--primary);
}

.user-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--primary-glow);
    border-radius: 50%;
    z-index: 1;
    animation: user-pulse 2s infinite;
}

@keyframes user-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Custom Popup Card */
.leaflet-popup-content-wrapper {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border: none;
}

.leaflet-popup-tip {
    background: var(--card-bg);
    /* Match card bg */
    border-top: 1px solid var(--border);
}

.charger-card-popup {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    min-width: 240px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.popup-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.power-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-main);
}

.popup-body {
    padding: 12px 16px;
}

.popup-body .detail-row {
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.status-available {
    color: #4ade80;
    font-weight: 500;
}

.popup-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.source-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.source-link:hover {
    text-decoration: underline;
}

/* Map Customization */
.custom-popup .label {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Auth Card Styles */
.auth-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form.hidden {
    display: none;
}

.auth-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.auth-input:focus {
    border-color: var(--primary);
}

.full-width {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.divider {
    text-align: center;
    color: var(--text-muted);
    margin: 1.5rem 0;
    position: relative;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.x-btn {
    width: 100%;
    justify-content: center;
    background: #000;
    border: 1px solid #333;
    font-size: 1rem;
    padding: 0.75rem;
}

.dev-link {
    color: #475569;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.3s;
}

.dev-link:hover {
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0055;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 0, 85, 0.4);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

/* Ghost Icon Button */
.icon-btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-ghost:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.analytics-btn:hover {
    color: #4ade80;
    /* Green tint for charts */
}

.admin-badge:hover {
    color: #fca5a5;
    /* Red tint for admin */
}

/* Map Controls (Landing Page) */
.map-controls {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 1000;
}

.map-control-btn {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.map-control-btn:hover {
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-2px);
    color: var(--primary);
    border-color: var(--primary);
}

.map-control-btn.active {
    background: rgba(0, 242, 234, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
}

/* Global Map Button (Dashboard) */
.global-map-btn {
    position: absolute;
    top: 20px;
    right: 340px;
    /* Moved left of Leaderboard (300px + 20px + gap) */
    z-index: 9999;
    /* Ensure on top of everything */

    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;

    background: rgba(15, 23, 42, 0.85);
    /* Darker for contrast */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(80, 250, 123, 0.5);
    border-radius: 99px;

    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    cursor: pointer;
}

.global-map-btn:hover {
    background: rgba(15, 23, 42, 1);
    border-color: #50fa7b;
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.6);
    transform: translateY(-2px) scale(1.05);
}

.global-map-btn svg {
    color: #50fa7b;
}

/* Network Stats Panel (Landing Page) */
.network-stats-panel {
    position: absolute;
    top: 90px;
    left: 20px;
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;

    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 242, 234, 0.3);
    border-radius: 16px;
    padding: 1rem;
    z-index: 1000;

    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.network-stats-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.stats-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-badge {
    font-size: 0.65rem;
    background: rgba(0, 242, 234, 0.2);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.stats-item.top-network {
    background: linear-gradient(90deg, rgba(0, 242, 234, 0.1), transparent);
    border-left-color: var(--primary);
}

.stats-info h4 {
    margin: 0;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.stats-metrics {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.stats-rank {
    font-size: 1.1rem;
    font-weight: 700;
    width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
}

.top-network .stats-rank {
    color: var(--primary);
}

.density-graph {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.density-bar {
    height: 100%;
    background: var(--secondary);
    border-radius: 2px;
}

/* User Profile Section (Bottom Sidebar) */
.user-profile-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    /* Indicate it's clickable */
}

.user-profile-section:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-profile-section.hidden {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #00aaff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(0, 242, 234, 0.3);
}

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.user-points {
    font-size: 0.85rem;
    color: #fca5a5;
    /* Light red/pinkish for distinct points color? Or gold? */
    color: #fbbf24;
    /* Gold */
    display: flex;
    align-items: center;
    gap: 4px;
}

.points-icon {
    font-size: 0.9rem;
}

.logout-btn-icon {
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.logout-btn-icon:hover {
    background: rgba(255, 0, 85, 0.15);
    /* Red tinted background */
    color: var(--secondary);
    /* Red color */
}

/* Leaderboard Panel */
.leaderboard-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: rgba(15, 23, 42, 0.65);
    /* Dark Glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-main);
}

/* Collapsed State */
.leaderboard-panel.collapsed {
    /* Only show header */
    height: 52px;
    /* Adjust based on header height */
}

/* Header */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}

.leaderboard-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.leaderboard-panel:not(.collapsed) .leaderboard-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.lb-icon {
    font-size: 1.2rem;
}

.lb-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.3s;
    cursor: pointer;
}

.leaderboard-panel.collapsed .lb-toggle-btn {
    transform: rotate(-90deg);
}

/* Body */
.leaderboard-body {
    max-height: 400px;
    overflow-y: auto;
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.leaderboard-body::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-body::-webkit-scrollbar-track {
    background: transparent;
}

.leaderboard-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* List */
#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lb-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    gap: 12px;
}

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

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

.lb-rank {
    font-weight: 600;
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Top 3 Ranks */
.lb-rank.rank-1 {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.lb-rank.rank-2 {
    color: #C0C0C0;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.lb-rank.rank-3 {
    color: #CD7F32;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.lb-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sidebar Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(0, 242, 234, 0.1);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.05);
}

.nav-item .icon {
    font-size: 1.2rem;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lb-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.lb-points {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.lb-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   MOBILE RESPONSIVENESS
========================================= */

/* Mobile Landing Page */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    /* Landing Page */
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 100px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .hero-visual {
        width: 100%;
        height: 300px;
        margin-bottom: 2rem;
    }

    .grid-bg {
        background-size: 30px 30px;
    }
}

/* Mobile Dashboard */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    /* Map takes full height */
    .map-container {
        height: 100%;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
    }

    /* Sidebar becomes a drawer/overlay */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 80vh;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        border-right: none;
        border-top: 1px solid var(--border);
        transform: translateY(100%);
        /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        padding: 1.5rem 1rem;
        overflow-y: auto;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateY(0);
    }

    /* "Handle" for the drawer */
    .sidebar::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }

    /* Menu Toggle Button (Floating) */
    .mobile-menu-btn {
        display: flex !important;
        position: absolute;
        top: 1rem;
        left: 1rem;
        z-index: 1500;
        background: var(--bg-glass);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border);
        color: var(--text-main);
        width: 44px;
        height: 44px;
        border-radius: 12px;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        cursor: pointer;
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }

    /* Leaderboard on Mobile */
    .leaderboard-panel {
        top: 1rem;
        right: 1rem;
        width: auto;
        min-width: 140px;
        max-width: 50%;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Expand width when open */
    .leaderboard-panel:not(.collapsed) {
        width: calc(100% - 2rem);
        max-width: 400px;
    }

    /* Adjust Status Card grid */
    .status-card .status-indicator {
        font-size: 0.9rem;
    }

    .stats-panel {
        grid-template-columns: 1fr 1fr;
    }

    .leaflet-popup-content {
        max-width: 280px !important;
    }

    .charger-card-popup {
        font-size: 0.9rem;
    }

    .charger-card-popup {
        font-size: 0.9rem;
    }

    /* Move Global Map Button on mobile (Top Left, next to menu) */
    .global-map-btn {
        top: 1rem;
        left: 70px;
        /* Next to Menu button (1rem + 54px) */
        right: auto;
        padding: 0;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        justify-content: center;
        background: rgba(15, 23, 42, 0.95);
        z-index: 1000;
        font-size: 0;
        /* Hide default text rendering if any */
    }

    .global-map-btn span {
        display: none;
        /* Hide text label */
    }

    .global-map-btn svg {
        width: 24px;
        height: 24px;
    }

    .controls-overlay {
        bottom: 5rem;
        width: 90%;
        display: flex;
        justify-content: center;
    }

    .primary-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }

    .user-profile-section {
        padding: 0.75rem;
    }
}

/* Hide Mobile Menu Button on Desktop */
.mobile-menu-btn {
    display: none;
}

/* 3D Cluster Styles - Holographic Neon */

.scout-cluster-wrap {
    background: transparent;
    padding: 0;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Core Orb - Holographic Energy */
.scout-cluster-orb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    /* Dark Glass Core */
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 242, 234, 0.8);
    /* Bright Neon Border */

    /* Intense Glow */
    box-shadow:
        0 0 15px rgba(0, 242, 234, 0.5),
        /* Outer Glow */
        inset 0 0 20px rgba(0, 242, 234, 0.2);
    /* Inner Glow */

    color: #fff;
    font-weight: 800;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(0, 242, 234, 1);
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

/* Hover Effect */
.scout-cluster-wrap:hover .scout-cluster-orb {
    transform: scale(1.1);
    box-shadow:
        0 0 25px rgba(0, 242, 234, 0.8),
        inset 0 0 30px rgba(0, 242, 234, 0.4);
}

/* Large Cluster Variant (Brand Purple) */
.scout-cluster-large .scout-cluster-orb {
    width: 56px;
    height: 56px;
    background: rgba(30, 0, 50, 0.4);
    border: 1px solid rgba(191, 0, 255, 0.8);
    box-shadow:
        0 0 20px rgba(191, 0, 255, 0.5),
        inset 0 0 25px rgba(191, 0, 255, 0.2);
    text-shadow: 0 0 10px rgba(191, 0, 255, 1);
    font-size: 16px;
}

.scout-cluster-large:hover .scout-cluster-orb {
    box-shadow:
        0 0 30px rgba(191, 0, 255, 0.8),
        inset 0 0 35px rgba(191, 0, 255, 0.5);
}

/* Holographic Sonar Pulse (Broadcasting Signal) */
.scout-cluster-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;

    /* Center it */
    transform: translate(-50%, -50%);

    /* Sonar Effect */
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    opacity: 0;
    z-index: 0;
    pointer-events: none;

    animation: sonar-ripple 6s infinite ease-out;
}

/* Second Wave for Continuous Effect */
.scout-cluster-ring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--primary);
    opacity: 0;
    animation: sonar-ripple 6s infinite ease-out;
    animation-delay: 3s;
    /* Offset half of duration */
}


/* Large Cluster Sonar (Purple) */
.scout-cluster-large .scout-cluster-ring {
    width: 80px;
    height: 80px;
    border-color: rgba(191, 0, 255, 0.6);
    box-shadow: 0 0 15px rgba(191, 0, 255, 0.4);
}

.scout-cluster-large .scout-cluster-ring::before {
    border-color: rgba(191, 0, 255, 0.4);
}

/* Inner Pulse Core */
.scout-cluster-orb::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.3;
    border-radius: 50%;
    animation: core-pulse 2s infinite ease-in-out;
    z-index: -1;
}

.scout-cluster-large .scout-cluster-orb::after {
    background: radial-gradient(circle, rgba(191, 0, 255, 0.8) 0%, transparent 70%);
}


@keyframes sonar-ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
        border-width: 2px;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
        border-width: 0px;
    }
}

@keyframes core-pulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    /* Sidebar as Mobile Bottom Sheet/Drawer */
    .sidebar {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: 80vh;
        overflow-y: auto;
        border-right: none;
        border-top: 1px solid var(--border);
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        padding: 1.5rem;
        z-index: 2000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.6);
        border-radius: 20px 20px 0 0;
    }

    .sidebar.open {
        transform: translateY(0);
    }

    /* Floating Menu Toggle */
    .mobile-menu-btn {
        display: flex;
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 2001;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--primary);
        width: 44px;
        height: 44px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
        background: var(--primary);
        color: #000;
    }

    /* Controls as Bottom FABs */
    .controls-overlay {
        position: fixed;
        /* Fix to viewport */
        width: 100%;
        bottom: calc(30px + env(safe-area-inset-bottom));
        left: 0;
        transform: none;
        display: flex;
        justify-content: center;
        gap: 20px;
        pointer-events: none;
        z-index: 1000;
        /* Ensure on top */
    }

    .controls-overlay button {
        pointer-events: auto;
        padding: 0;
        width: 64px;
        height: 64px;
        border-radius: 50%;
        justify-content: center;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        gap: 0;
        /* Fix centering by removing gap to hidden text */
    }

    .controls-overlay button svg {
        width: 32px;
        height: 32px;
        /* Make icons larger on mobile */
    }

    .primary-btn span.btn-icon,
    .secondary-btn span.btn-icon {
        font-size: 1.8rem;
        margin: 0;
    }

    .primary-btn,
    .secondary-btn {
        font-size: 0;
        /* Hide text */
    }

    /* Global Map Button Adjustments */
    .global-map-btn {
        top: 20px;
        right: 20px;
        padding: 8px 12px;
        background: rgba(15, 23, 42, 0.6);
    }

    .global-map-btn span {
        display: none;
    }

    .map-container {
        height: 100vh;
        height: 100dvh;
        /* Dynamic viewport height */
        width: 100vw;
    }

    /* Hide some stats on mobile to declutter */
    .stat-item {
        padding: 0.5rem;
    }
}

/* Default hidden on desktop */
.mobile-menu-btn {
    display: none;
}

/* --- Apple-Style Dock UI --- */
.dock-overlay {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: auto;
    max-width: 90%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Elevated Primary CTA */
.primary-cta-btn {
    pointer-events: auto;
    background: linear-gradient(135deg, #00f2ea 0%, #00c2ff 100%);
    border: none;
    color: #0f172a;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow:
        0 8px 25px rgba(0, 242, 234, 0.4),
        0 0 0 4px rgba(0, 242, 234, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    backdrop-filter: blur(12px);
}

.primary-cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 12px 30px rgba(0, 242, 234, 0.6),
        0 0 0 6px rgba(0, 242, 234, 0.15);
}

.primary-cta-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.primary-cta-btn .cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-panel {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.dock-item {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    /* Squircle iOS style */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Start solid but faint */
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    text-decoration: none;
    padding: 0;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dock-item .dock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-item::after {
    /* Tooltip content handled by attr(title) */
    content: attr(title);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dock-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    top: -50px;
}

.dock-item:hover {
    transform: translateY(-8px) scale(1.15);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    margin: 0 6px;
    /* Push neighbors slightly */
}

/* Primary Action - Scout */
.dock-item.primary {
    background: rgba(0, 242, 234, 0.1);
    border-color: rgba(0, 242, 234, 0.3);
    color: #00f2ea;
}

.dock-item.primary:hover {
    background: rgba(0, 242, 234, 0.2);
    box-shadow: 0 0 25px rgba(0, 242, 234, 0.5);
    border-color: #00f2ea;
    color: #fff;
}

/* Secondary Action - AR */
.dock-item.secondary {
    background: rgba(191, 0, 255, 0.1);
    border-color: rgba(191, 0, 255, 0.3);
    color: #d6bcfa;
}

.dock-item.secondary:hover {
    background: rgba(191, 0, 255, 0.2);
    box-shadow: 0 0 25px rgba(191, 0, 255, 0.5);
    border-color: #d6bcfa;
    color: #fff;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .dock-overlay {
        bottom: calc(20px + env(safe-area-inset-bottom));
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
    }

    .dock-panel {
        background: rgba(15, 23, 42, 0.85);
        border-radius: 28px;
        padding: 12px 20px;
        gap: 16px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }

    .dock-item {
        width: 52px;
        height: 52px;
    }

    .dock-item:hover {
        transform: scale(1.1);
        margin: 0;
    }

    .dock-item::after {
        display: none;
    }
}