/* ═══════════════════════════════════════════════════════════
   LIQUID GLASS — Secteur+ Apple-style Design System
   3 couches optiques : highlight + shadow + illumination
   ═══════════════════════════════════════════════════════════ */

/* ═══ Design Tokens ═══ */
:root {
    /* -- Fond -- */
    --bg-base: #0a0a0f;
    --bg-surface: #111118;

    /* -- Glass (white-tint Liquid Glass Apple) -- */

    /* Palier BASE — surfaces principales (panel, chip, tooltip, popup, pill) */
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-blur: blur(20px) brightness(1.15) saturate(160%);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-top: rgba(255, 255, 255, 0.25);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 16px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.10);

    /* Palier CARD — glass-on-glass, plus leger */
    --glass-card-bg: rgba(255, 255, 255, 0.05);
    --glass-card-blur: blur(10px) brightness(1.1) saturate(140%);
    --glass-card-border: rgba(255, 255, 255, 0.12);
    --glass-card-border-top: rgba(255, 255, 255, 0.22);

    /* Hover states */
    --glass-bg-hover: rgba(255, 255, 255, 0.10);
    --glass-card-bg-hover: rgba(255, 255, 255, 0.08);

    /* Tokens conserves (utilises par .glass, .glass:hover, etc.) */
    --glass-bg-active: rgba(255, 255, 255, 0.16);
    --glass-border-subtle: rgba(255, 255, 255, 0.08);
    --glass-border-active: rgba(255, 255, 255, 0.22);
    --glass-highlight: rgba(255, 255, 255, 0.25);
    --glass-shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.4);

    /* -- Indicateurs de confiance -- */
    --color-green: #22c55e;
    --color-green-glow: rgba(34, 197, 94, 0.35);
    --color-orange: #f59e0b;
    --color-orange-glow: rgba(245, 158, 11, 0.30);
    --color-grey: #6b7280;
    --color-grey-glow: rgba(107, 114, 128, 0.20);

    /* -- Texte -- */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.40);

    /* -- Accent (bleu Secteur+) -- */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.30);

    /* -- Spacing -- */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 100px;

    /* -- Typographie -- */
    --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', monospace;
}


/* ═══════════════════════════════════════════════════════════
   1. BASE & SCROLLBAR
   ═══════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

::selection {
    background: var(--accent);
    color: white;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }


/* ═══════════════════════════════════════════════════════════
   2. SYSTEME GLASS 3 COUCHES
   ═══════════════════════════════════════════════════════════ */

/* -- Base : conteneur .glass (valeurs propres, ne pas confondre avec le palier BASE) -- */
.glass {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(18px) brightness(1.35) saturate(180%);
    -webkit-backdrop-filter: blur(18px) brightness(1.35) saturate(180%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 var(--glass-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        inset 1px 0 0 rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* -- Reflet speculaire (highlight top-left) -- */
.glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(
            ellipse 80% 50% at 30% 5%,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 60%
        ),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 40%
        );
    pointer-events: none;
    z-index: 1;
    mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

/* -- Hover -- */
.glass:hover {
    border-color: rgba(255, 255, 255, 0.28);
    border-top-color: rgba(255, 255, 255, 0.45);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.20),
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 var(--glass-highlight);
    transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════
   3. VARIANTES GLASS
   ═══════════════════════════════════════════════════════════ */

/* -- glass-panel (side panel, header) — palier BASE Liquid Glass -- */
.glass-panel {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-top);
    /* box-shadow specifique glass-panel (inset bottom) */
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 0 rgba(0, 0, 0, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.20);
}

/* -- glass-card (cards dans panel) — palier CARD Liquid Glass (glass-on-glass, plus leger) -- */
/* Note perf : pas de backdrop-filter ici. Les cards sont sur un fond glass-panel deja floute,
   le backdrop-filter voit principalement du noir → zero benefice visuel, cout GPU maximal. */
.glass-card {
    position: relative;
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    border-top: 1px solid var(--glass-card-border-top);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.25),
        0 1px 4px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                box-shadow 0.2s ease;
}

.glass-card:hover {
    background: var(--glass-card-bg-hover);
    transform: scale(1.01);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 var(--glass-highlight);
}

.glass-card:active {
    transform: scale(0.99);
    transition-duration: 80ms;
}

.glass-card.selected {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px var(--accent),
        0 0 24px var(--accent-glow);
}

/* -- glass-chip (filtres, badges) — palier BASE Liquid Glass -- */
.glass-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-top-color: var(--glass-border-top);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--glass-shadow);
}

.glass-chip:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.glass-chip.active {
    background: rgba(59, 130, 246, 0.20);
    border-color: rgba(59, 130, 246, 0.40);
    color: #fff;
    box-shadow:
        0 0 12px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Glass-on-glass : chips DANS un conteneur glass = pas de backdrop-filter (couche deja floutee) */
.glass-card .glass-chip,
.glass-panel .glass-chip {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.08);
}

/* -- glass-overlay (modal detail) — palier BASE Liquid Glass (blur/saturate overlay plein ecran) -- */
.glass-overlay {
    position: relative;
    background: var(--glass-bg);
    /* blur et saturate specifiques overlay plein ecran (plus fort que le palier BASE) */
    backdrop-filter: blur(24px) brightness(1.15) saturate(200%);
    -webkit-backdrop-filter: blur(24px) brightness(1.15) saturate(200%);
    border-left: 1px solid var(--glass-border-subtle);
    box-shadow:
        inset 1px 0 0 0 rgba(255, 255, 255, 0.10),
        inset 0 1px 0 0 var(--glass-highlight),
        -12px 0 48px rgba(0, 0, 0, 0.3);
}


/* ═══════════════════════════════════════════════════════════
   4. MAP OVERLAYS (filtres seuls sur la carte)
   ═══════════════════════════════════════════════════════════ */

/* Conteneur invisible, couvre toute la carte, laisse passer les clics */
.map-overlays {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

/* Rangee filtres : alignee a gauche apres le panel (desktop uniquement) */
.map-filters-row {
    position: absolute;
    top: 14px;
    left: 436px; /* 420px panel + 16px marge */
    pointer-events: auto;
    display: none; /* cache sur mobile (filtres dans le bottom sheet) */
    align-items: center;
    gap: 6px;
}

@media (min-width: 769px) {
    .map-filters-row { display: flex; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .map-filters-row { left: 376px; /* 360px panel + 16px marge */ }
}


/* ═══════════════════════════════════════════════════════════
   4b. PANEL HEADER (logo + commune + compteur)
   ═══════════════════════════════════════════════════════════ */

/* Ligne 1 : logo + refresh + status */
.panel-header-line1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.panel-logo {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.panel-logo-plus { color: var(--accent); }

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Refresh : icone nue, pas de fond */
.panel-refresh-btn {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
}

.panel-refresh-btn:hover {
    color: var(--text-secondary);
}

/* Ligne 2 : commune + separateur + compteur */
.panel-header-line2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.panel-commune-select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    /* Fleche dropdown native via URL-encoded SVG */
    padding-right: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px 6px;
}

.panel-commune-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.panel-separator {
    color: var(--text-tertiary);
    font-size: 13px;
}

.panel-count {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Animation spring sur les chips de filtre */
.filter-chip-spring {
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                color 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-chip-spring.active {
    transform: scale(1.05);
}

/* Couleurs actives par level */
.filter-chip-spring.active:has(.dot-green) {
    background: rgba(34, 197, 94, 0.20);
    border-color: rgba(34, 197, 94, 0.40);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.filter-chip-spring.active:has(.dot-orange) {
    background: rgba(245, 158, 11, 0.20);
    border-color: rgba(245, 158, 11, 0.40);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.filter-chip-spring.active:has(.dot-grey) {
    background: rgba(107, 114, 128, 0.20);
    border-color: rgba(107, 114, 128, 0.40);
    box-shadow: 0 0 12px rgba(107, 114, 128, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-dot.connected {
    background: var(--color-green);
}

.status-dot.connected::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--color-green);
    animation: statusPulse 2s ease-out infinite;
}

.status-dot.disconnected {
    background: #ef4444;
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════
   5. SIDE PANEL (desktop) + BOTTOM SHEET (mobile)
   ═══════════════════════════════════════════════════════════ */

.side-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-top: none;
    border-radius: 0;
}

/* Fondu lateral carte vers panel (override ::before du glass-panel) */
.side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: -24px;
    bottom: 0;
    left: auto;
    width: 24px;
    height: auto;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.side-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px;
}

/* Mobile : bottom sheet */
@media (max-width: 768px) {
    .side-panel {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: 50vh;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.10);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .side-panel.sheet-peek {
        transform: translateY(calc(100% - 120px));
    }

    .side-panel.sheet-half {
        transform: translateY(0);
    }

    .side-panel.sheet-full {
        height: 100vh;
        transform: translateY(0);
    }

    .side-panel.sheet-hidden {
        transform: translateY(100%);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .side-panel { width: 360px; }
}

/* Drag handle */
.drag-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.20);
    margin: 10px auto 6px;
    cursor: grab;
}

.drag-handle:active { cursor: grabbing; }


/* ═══════════════════════════════════════════════════════════
   6. FILTER CHIPS
   ═══════════════════════════════════════════════════════════ */

.filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip-count {
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    padding: 0 5px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.glass-chip.active .filter-chip-count {
    background: rgba(59, 130, 246, 0.25);
    color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════
   7. DOTS DE CONFIANCE
   ═══════════════════════════════════════════════════════════ */

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-green {
    background: var(--color-green);
    box-shadow: 0 0 8px var(--color-green-glow);
}

.dot-orange {
    background: var(--color-orange);
    box-shadow: 0 0 8px var(--color-orange-glow);
}

.dot-grey {
    background: var(--color-grey);
    box-shadow: 0 0 6px var(--color-grey-glow);
}


/* ═══════════════════════════════════════════════════════════
   8. BIEN CARDS
   ═══════════════════════════════════════════════════════════ */

.bien-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInCard 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bien-card.statut-rejete { opacity: 0.4; }

/* Barre laterale couleur confiance */
.confidence-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    z-index: 3;
}

/* Image */
.card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bien-card:hover .card-image img {
    transform: scale(1.03);
}

/* Gradient bas de l'image — transition douce vers le body */
.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 40%,
        rgba(0, 0, 0, 0.45) 100%
    );
    pointer-events: none;
}

/* Placeholder sans image */
.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

/* Badge source overlay */
.source-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Badge nouveau */
.badge-nouveau {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.85);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Source badges colores */
.source-badge.source-seloger {
    background: rgba(239, 68, 68, 0.20);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.15);
}

.source-badge.source-lbc {
    background: rgba(249, 115, 22, 0.20);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.15);
}

.source-badge.source-bienici {
    background: rgba(99, 102, 241, 0.20);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.15);
}

.source-badge.source-agence {
    background: rgba(34, 197, 94, 0.20);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.15);
}

/* Body */
.card-body {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.card-type {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: -1px;
}

.card-address {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.card-commune {
    font-size: 11px;
    color: var(--text-tertiary);
}

.card-meta {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.card-meta span + span::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-right: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    vertical-align: middle;
    opacity: 0.6;
}

/* Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.action-chip {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    text-decoration: none;
}

.action-chip.navigate {
    color: var(--accent);
}

.action-chip.navigate:hover {
    color: var(--accent-hover);
}

.action-chip.detail {
    color: var(--text-secondary);
    margin-left: auto;
}

.action-chip.detail:hover {
    color: var(--text-primary);
}

/* ═══ Carrousel photos ═══ */

/* Conteneur carrousel (dans .card-image) */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Image avec transition opacity */
.carousel-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Fleches navigation */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px) brightness(1.2);
    -webkit-backdrop-filter: blur(8px) brightness(1.2);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.15s ease;
    line-height: 1;
    padding: 0;
}

.carousel-arrow.arrow-left { left: 8px; }
.carousel-arrow.arrow-right { right: 8px; }

/* Apparition au hover de la card-image */
.card-image:hover .carousel-arrow,
.detail-photo-carousel:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.25);
}

.carousel-arrow:active {
    background: rgba(0, 0, 0, 0.6);
}

/* Dots indicateur (cards) */
.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 4;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.50);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

/* Compteur detail (ex: "2/5") */
.carousel-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 4;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.90);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px) brightness(1.2);
    -webkit-backdrop-filter: blur(8px) brightness(1.2);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

/* Conteneur carrousel detail panel (plus grand) */
.detail-photo-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.detail-photo-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

/* Fleches plus grandes dans le detail */
.detail-photo-carousel .carousel-arrow {
    width: 34px;
    height: 34px;
    font-size: 15px;
}

.detail-photo-carousel .carousel-arrow.arrow-left { left: 10px; }
.detail-photo-carousel .carousel-arrow.arrow-right { right: 10px; }

/* Badge DPE (classe energetique A-G) */
.dpe-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.dpe-badge.dpe-a, .dpe-badge.dpe-A { background: rgba(0, 128, 0, 0.20); color: #22c55e; }
.dpe-badge.dpe-b, .dpe-badge.dpe-B { background: rgba(34, 197, 94, 0.20); color: #4ade80; }
.dpe-badge.dpe-c, .dpe-badge.dpe-C { background: rgba(234, 179, 8, 0.20); color: #facc15; }
.dpe-badge.dpe-d, .dpe-badge.dpe-D { background: rgba(249, 115, 22, 0.20); color: #fb923c; }
.dpe-badge.dpe-e, .dpe-badge.dpe-E { background: rgba(239, 68, 68, 0.20); color: #f87171; }
.dpe-badge.dpe-f, .dpe-badge.dpe-F { background: rgba(220, 38, 38, 0.20); color: #ef4444; }
.dpe-badge.dpe-g, .dpe-badge.dpe-G { background: rgba(185, 28, 28, 0.20); color: #dc2626; }

/* Variante grande pour le detail panel */
.dpe-badge-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.dpe-badge-lg.dpe-a, .dpe-badge-lg.dpe-A { background: rgba(0, 128, 0, 0.20); color: #22c55e; }
.dpe-badge-lg.dpe-b, .dpe-badge-lg.dpe-B { background: rgba(34, 197, 94, 0.20); color: #4ade80; }
.dpe-badge-lg.dpe-c, .dpe-badge-lg.dpe-C { background: rgba(234, 179, 8, 0.20); color: #facc15; }
.dpe-badge-lg.dpe-d, .dpe-badge-lg.dpe-D { background: rgba(249, 115, 22, 0.20); color: #fb923c; }
.dpe-badge-lg.dpe-e, .dpe-badge-lg.dpe-E { background: rgba(239, 68, 68, 0.20); color: #f87171; }
.dpe-badge-lg.dpe-f, .dpe-badge-lg.dpe-F { background: rgba(220, 38, 38, 0.20); color: #ef4444; }
.dpe-badge-lg.dpe-g, .dpe-badge-lg.dpe-G { background: rgba(185, 28, 28, 0.20); color: #dc2626; }




/* ═══════════════════════════════════════════════════════════
   10. DETAIL OVERLAY
   ═══════════════════════════════════════════════════════════ */

/* Detail (integre dans le side panel) */

/* Bouton retour (detail dans side panel) */
.detail-back-btn {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.detail-back-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.detail-photo {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}

.detail-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
}

.detail-row .label { color: var(--text-secondary); }
.detail-row .value { color: var(--text-primary); font-weight: 500; }

.detail-btn-navigate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--accent);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

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

.detail-btn-navigate .arrow { transition: transform 0.15s ease; }
.detail-btn-navigate:hover .arrow { transform: translateX(2px); }

.detail-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.detail-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.detail-link:hover { color: var(--text-primary); }


/* ═══════════════════════════════════════════════════════════
   11. SCORES, ACCORDION, CANDIDATES, VERIFICATION
   ═══════════════════════════════════════════════════════════ */

/* Accordion */
.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.accordion-toggle:hover { color: var(--text-secondary); }

.accordion-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.accordion-chevron.open { transform: rotate(180deg); }

/* Candidate tabs */
.candidate-tabs { display: flex; gap: 6px; }

.candidate-tab {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.candidate-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
}

.candidate-tab.active {
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.30);
}

/* Verification */
.verify-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.verify-btn-confirm {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--color-green);
}

.verify-btn-confirm:hover {
    background: rgba(34, 197, 94, 0.20);
    border-color: rgba(34, 197, 94, 0.40);
}

.verify-btn-confirm.active {
    background: var(--color-green);
    color: white;
    border-color: var(--color-green);
}

.verify-btn-reject {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #F87171;
}

.verify-btn-reject:hover {
    background: rgba(239, 68, 68, 0.20);
    border-color: rgba(239, 68, 68, 0.40);
}

.verify-btn-reject.active {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

/* Glass textarea */
.glass-textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-body);
    resize: vertical;
    min-height: 50px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.glass-textarea::placeholder { color: var(--text-tertiary); }

.glass-textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.30);
    background: rgba(255, 255, 255, 0.05);
}

/* Glass button */
.glass-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Source badge (card overlay) */
.source-badge-inline {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════
   12. LAYER TOGGLE + MATCH LINES + STREET VIEW
   ═══════════════════════════════════════════════════════════ */

.layer-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 35;
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px) brightness(1.35) saturate(170%);
    -webkit-backdrop-filter: blur(14px) brightness(1.35) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.layer-btn {
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-btn:hover { color: var(--text-primary); }

.layer-btn.active {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

/* Street View */
.sv-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    min-height: 160px;
}

.sv-skeleton {
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    position: relative;
    min-height: 160px;
}

.sv-skeleton-pulse {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}


/* ═══════════════════════════════════════════════════════════
   13. POPUPS & TOOLTIPS
   ═══════════════════════════════════════════════════════════ */

/* palier BASE Liquid Glass */
.glass-tooltip {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border) !important;
    border-top-color: var(--glass-border-top) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
    padding: 5px 10px !important;
    box-shadow: var(--glass-shadow) !important;
}

.glass-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}


/* ═══════════════════════════════════════════════════════════
   14. ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

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

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Shimmer skeleton */
.shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}


/* ═══════════════════════════════════════════════════════════
   15. UTILITIES
   ═══════════════════════════════════════════════════════════ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.text-green { color: var(--color-green); }
.text-red { color: #F87171; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Mobile */
@media (max-width: 768px) {
    .detail-btn-navigate {
        padding: 16px;
        font-size: 16px;
    }

    .layer-toggle {
        top: 12px;
        right: 8px;
    }

}
