/* ===========================
   CSS Custom Properties
   =========================== */
:root {
    /* Service Colors */
    --dott-green: #00D9A5;
    --lime-green: #00FF00;
    --voi-pink: #FF006B;

    /* Blue Accent Colors (only accent color) */
    --neon-blue: rgba(59, 130, 246, 0.5);
    --neon-cyan: rgba(34, 211, 238, 0.5);

    /* Service Neon Colors */
    --neon-green: rgba(0, 217, 165, 0.5);
    --neon-lime: rgba(0, 255, 0, 0.5);
    --neon-pink: rgba(255, 0, 107, 0.5);
}

/* ===========================
   Global Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===========================
   Custom Tailwind Classes
   =========================== */
.bg-gray-750 {
    background-color: #2d3748;
}

.bg-dott-green {
    background-color: var(--dott-green);
}

.bg-lime-green {
    background-color: var(--lime-green);
}

.bg-voi-pink {
    background-color: var(--voi-pink);
}

.border-dott-green {
    border-color: var(--dott-green);
}

.border-lime-green {
    border-color: var(--lime-green);
}

.border-voi-pink {
    border-color: var(--voi-pink);
}

/* ===========================
   Neon Effects (Blue Only)
   =========================== */
.neon-text-blue {
    text-shadow:
        0 0 10px rgba(59, 130, 246, 0.8),
        0 0 20px rgba(59, 130, 246, 0.6),
        0 0 30px rgba(59, 130, 246, 0.4);
}

.shadow-neon-blue {
    box-shadow:
        0 0 10px var(--neon-blue),
        0 0 20px var(--neon-blue),
        0 0 30px var(--neon-blue);
}

.shadow-neon-cyan {
    box-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan);
}

.shadow-neon-green {
    box-shadow:
        0 0 5px var(--neon-green),
        0 0 10px var(--neon-green);
}

.shadow-neon-lime {
    box-shadow:
        0 0 5px var(--neon-lime),
        0 0 10px var(--neon-lime);
}

.shadow-neon-pink {
    box-shadow:
        0 0 5px var(--neon-pink),
        0 0 10px var(--neon-pink);
}

/* ===========================
   Loading Spinner
   =========================== */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* ===========================
   Checkbox Styling
   =========================== */
.filter-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #4b5563;
    border-radius: 4px;
    background-color: #1f2937;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.filter-checkbox:checked {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-color: #3b82f6;
    box-shadow: 0 0 10px var(--neon-blue);
}

.filter-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.filter-checkbox:hover {
    border-color: #3b82f6;
}

/* ===========================
   Scrollbar Styling
   =========================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #06b6d4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #0891b2);
}

/* ===========================
   Map Styles
   =========================== */
#map {
    z-index: 1;
}

/* Dark mode tiles */
.leaflet-container {
    background: #1a1a2e;
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===========================
   Popup Customization
   =========================== */
.popup-content-wrapper {
    padding: 12px;
    min-width: 200px;
}

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

.popup-service {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-id {
    font-family: monospace;
    color: #9ca3af;
    font-size: 12px;
}

.popup-battery {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.battery-icon {
    width: 14px;
    height: 24px;
    border: 2px solid #4b5563;
    border-radius: 4px;
    padding: 1px;
    position: relative;
}

.battery-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 3px;
    background: #4b5563;
    border-radius: 2px 2px 0 0;
}

.battery-level {
    width: 100%;
    background: #10b981;
    border-radius: 1px;
    position: absolute;
    bottom: 1px;
    left: 0;
    transition: height 0.3s ease;
}

.battery-level.low {
    background: #ef4444;
}

.battery-level.medium {
    background: #f59e0b;
}

.battery-text {
    font-size: 14px;
    color: #d1d5db;
    font-weight: 500;
}

.popup-actions {
    margin-top: 8px;
}

.unlock-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.unlock-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.unlock-button:active {
    transform: translateY(0);
}

/* Leaflet Popup Overrides */
.leaflet-popup-content-wrapper {
    background: #1f2937;
    color: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.5;
}

.leaflet-popup-tip {
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-left: none;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #9ca3af;
    padding: 8px;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 16px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: white;
}

/* ===========================
   Marker Cluster Customization
   =========================== */
/* Base Cluster Style */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

/* Small Clusters (<10) - Cyan/Light Blue */
.marker-cluster-small {
    background-color: rgba(6, 182, 212, 0.4);
    /* Cyan */
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.marker-cluster-small div {
    background-color: rgba(6, 182, 212, 0.9);
}

/* Medium Clusters (10-100) - Blue */
.marker-cluster-medium {
    background-color: rgba(59, 130, 246, 0.4);
    /* Blue */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.marker-cluster-medium div {
    background-color: rgba(59, 130, 246, 0.9);
}

/* Large Clusters (>100) - Purple/Indigo */
.marker-cluster-large {
    background-color: rgba(99, 102, 241, 0.4);
    /* Indigo */
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.marker-cluster-large div {
    background-color: rgba(99, 102, 241, 0.95);
    width: 40px;
    /* Slightly larger */
    height: 40px;
    margin-left: 0;
    margin-top: 0;
    font-size: 16px;
}

.marker-cluster:hover {
    transform: scale(1.15);
    z-index: 1000;
}

/* ===========================
   Responsive Sidebar
   =========================== */
@media (max-width: 1023px) {
    #sidebar {
        width: 100%;
        max-width: 320px;
    }

    #sidebar.open {
        transform: translateX(0);
    }
}

/* ===========================
   Button Hover Effects
   =========================== */
button {
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.95);
}

/* ===========================
   Utility Classes
   =========================== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Vélib Styles */
.bg-velib-blue {
    background-color: #003d82;
}

.border-velib-blue {
    border-color: #003d82;
}

.shadow-neon-velib {
    box-shadow: 0 0 5px rgba(0, 61, 130, 0.5), 0 0 10px rgba(0, 61, 130, 0.5);
}