:root {
    --primary: #4f7cff;
    --secondary: #29c18c;
    --accent: #ffd166;
    --danger: #ff6b6b;
    --success: #29c18c;
    --bg-dark: #0f1419;
    --bg-light: #1a1f2e;
    --card-bg: #252b3a;
    --text-primary: #ffffff;
    --text-secondary: #a8b2d1;
    --border: rgba(79, 124, 255, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, .15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .2);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
    font-family: Menlo;
    font-style: normal;
    src: url('/assets/font/Menlo-Regular.ttf') format('truetype');
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Menlo, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-1);
    color: var(--text-1);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2 {margin-top: 0;}

body { display: flex; flex-direction: column; min-height: 100vh; }
#app {flex: 1; }
/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 124, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(79, 124, 255, 0.6);
    }
}

/* ===== HEADER ===== */
.site-header {
    display: flex;
    padding: 1rem;
    align-items: center;
    background: var(--bg-2);
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--fg-1);
    z-index: 100;
    animation: slideInRight 0.5s ease;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


.brand {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.brand-title {
    font-size: 1.5rem;
    margin: 0;
}


.brand-logo {
    width: 2.5rem;
    height: 2.5rem;
}

.topnav {
    display: flex;
    flex: 1;
    justify-content: space-around;
    gap: 2rem;
    margin: 1rem 0;
}

.topnav a {
    color: var(--text-1);
    text-align: center;
    line-height: 1;
    font-size: .75rem;
    position: relative;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.topnav a svg {
    padding: .5rem;
    box-sizing: content-box;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: .25rem;
    background-color: transparent;
    transition: background-color .2s ease-in-out;
}

.topnav a p {
    font-size: .8rem;
    margin: 0;
    min-height: .8rem;
    opacity: 0;
    transition: opacity .2s ease-in-out;
    position: absolute;
    bottom: -1rem;
    transform: translateY(50%);
}

.topnav:hover a p {
    opacity: 1;
}

.topnav a:hover svg {
    background: var(--bg-3);
}

.topnav a.active svg {
    background: var(--bg-4);
}

/* ===== MAIN CONTENT ===== */
#app {
    /* padding: 1rem; */
    margin: 0 auto;
    animation: fadeIn 0.6s ease;
    width: 100%;
}

#app h2.title {
    margin: 0;
    padding: 0 1rem;
    background: var(--text-1);
    color: var(--bg-1);
    display: inline-block;
}

#app>section>p {
    text-align: center;
}

section.grid {
    padding: 1rem;
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--fg-1);
    border-radius: .5rem;
    padding: 1rem;
}

/* .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 124, 255, 0.3);
} */

/* ===== KPIs ===== */
.kpis {
    display: flex;
    /* grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); */
    /* gap: 1.5rem; */
    margin-bottom: 2rem;
}

.kpi {
    /* background: linear-gradient(135deg, var(--card-bg), rgba(37, 43, 58, 0.5)); */
    /* border: 1px solid var(--border); */
    /* border-radius: var(--radius-lg); */
    flex: 1;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.kpi:not(:last-child) {
    border-right: 1px solid var(--fg-1);
}

.kpi-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.kpi .label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi .value {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    animation: fadeIn 0.8s ease;
}

/* ===== CHARTS ===== */
.chart-container {
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart {
    width: 100%;
    min-height: 320px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.btn,
.btn-icon {
    border: 0;
}

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--bg-3);
}

.btn-icon:hover {
    background: var(--bg-2);
    border-color: var(--bg-4);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5a8aff);
    color: white;
    box-shadow: 0 8px 20px rgba(79, 124, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 124, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #35d49f);
    color: white;
    box-shadow: 0 8px 20px rgba(41, 193, 140, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(41, 193, 140, 0.4);
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th {
    background: rgba(79, 124, 255, 0.1);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(79, 124, 255, 0.05);
    color: var(--text-primary);
}

/* ===== HERO MAP ===== */
.map-hero {
    width: 100%;
    height: 75vh;
    min-height: 560px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

/* ===== FORMS ===== */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    margin: 1rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    box-shadow: 0 0 15px rgba(79, 124, 255, 0.4);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 25px rgba(79, 124, 255, 0.8);
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    border: none;
    box-shadow: 0 0 15px rgba(79, 124, 255, 0.4);
    transition: var(--transition);
}

/* ===== FOOTER ===== */
footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(15, 20, 25, 0.5);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .site-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .kpis {
        flex-direction: column;
    }

    .kpi:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--fg-1);
    }


    .topnav {
        flex-wrap: wrap;
        /* order: -1; */
    }

    .map-hero {
        height: 50vh;
        min-height: 400px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.parking-marker {
    transition: all 0.2s ease;
}

.map-marker-tooltip svg {width: 1.5em; height: 1.5em; }

.color-box {
    width: 1rem;
    height: 1rem; padding: .125rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.color-box.wide {width: 2rem;}

p svg, h2 svg, h3 svg, label svg {width: 1em; height: 1em; vertical-align: baseline; margin-bottom: -.1em; }

/* Animation pour les bulles */
@keyframes parkingBubble {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}