/* ==========================================================================
   KissBooK Rencontres — Carte Géographique Suisse & 26 Cantons Temps Réel (Page 7)
   + Placement Exact des Points Verts sur les Villes & Villages
   + Modales au Premier Plan Absolu (Conforme Règle Promptus Studio)
   ========================================================================== */

/* --- Structure 50% / 50% de la Page 7 --- */
.kbr-p7-split-page {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-sizing: border-box !important;
    padding-bottom: 30px !important;
    overflow: hidden !important;
}

.kbr-p7-likes-half {
    flex: 0 0 45%;
    max-height: 45%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 4px;
}

.kbr-p7-likes-half .kbg-page-title {
    margin-bottom: 4px !important;
    font-size: 1.02rem !important;
    padding: 3px 8px !important;
    flex-shrink: 0;
}

.kbr-p7-likes-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0 8px;
}

.kbr-p7-map-half {
    flex: 1 1 100% !important;
    max-height: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: linear-gradient(155deg, #091122 0%, #101d38 55%, #0a1428 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.38);
    box-shadow: 0 6px 20px rgba(4, 8, 22, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
    color: #f1f5f9;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- En-tête de la Carte --- */
.kbr-smap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 9px;
    background: rgba(12, 19, 36, 0.9);
    border-bottom: 1px solid rgba(56, 189, 248, 0.24);
    flex-shrink: 0;
    min-height: 28px;
}

.kbr-smap-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.kbr-smap-back-btn {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: 1px solid rgba(125, 211, 252, 0.55);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer !important;
    pointer-events: auto !important;
    white-space: nowrap;
    transition: transform 0.15s ease, filter 0.15s ease;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.kbr-smap-back-btn:hover {
    filter: brightness(1.14);
    transform: translateX(-1px);
}

.kbr-smap-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kbr-smap-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    font-size: 0.67rem;
    font-weight: 700;
    color: #6ee7b7;
    white-space: nowrap;
    flex-shrink: 0;
}

.kbr-smap-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: kbr-smap-pulse 1.6s ease-in-out infinite;
}

@keyframes kbr-smap-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.72; }
}

/* Bandeau d'état temporaire (ex: clic membre p.6) */
.kbr-smap-status-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 9px;
    font-size: 0.67rem;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.28), rgba(234, 179, 8, 0.22));
    border-bottom: 1px solid rgba(74, 222, 128, 0.42);
    color: #ecfdf5;
    flex-shrink: 0;
}

.kbr-smap-status-banner.is-visible {
    display: flex;
}

/* --- Corps principal de la carte --- */
.kbr-smap-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Zone SVG (Suisse ou Canton) */
.kbr-smap-svg-stage {
    flex: 1 1 60%;
    min-height: 112px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, rgba(29, 78, 216, 0.24) 0%, rgba(9, 17, 34, 0.96) 78%),
        linear-gradient(0deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px, 24px 24px;
}

.kbr-smap-svg {
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
}

/* Hydrographie & Relief Suisse */
.kbr-smap-ridge {
    fill: none;
    stroke: rgba(148, 163, 184, 0.16);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 4 5;
    pointer-events: none;
}

.kbr-smap-river {
    fill: none;
    stroke: rgba(56, 189, 248, 0.42);
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.kbr-smap-lake {
    fill: rgba(14, 165, 233, 0.55);
    stroke: rgba(125, 211, 252, 0.72);
    stroke-width: 0.95;
    stroke-linejoin: round;
    pointer-events: none;
}

.kbr-smap-lake-lbl {
    fill: #bae6fd;
    font-style: italic;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
    opacity: 0.88;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(9, 17, 34, 0.85);
    stroke-width: 2px;
}

.kbr-smap-compass {
    pointer-events: none;
    opacity: 0.85;
}

/* Polygones des 26 cantons */
.kbr-smap-canton-group {
    cursor: pointer;
}

.kbr-smap-canton-poly {
    fill: rgba(30, 41, 59, 0.9);
    stroke: rgba(148, 163, 184, 0.62);
    stroke-width: 1.35;
    stroke-linejoin: round;
    transition: fill 0.18s ease, stroke 0.18s ease, filter 0.18s ease;
}

.kbr-smap-canton-group.has-online .kbr-smap-canton-poly {
    stroke: rgba(74, 222, 128, 0.72);
    stroke-width: 1.55;
}

.kbr-smap-canton-group:hover .kbr-smap-canton-poly,
.kbr-smap-canton-group.is-hovered .kbr-smap-canton-poly {
    fill: rgba(37, 99, 235, 0.62) !important;
    stroke: #7dd3fc !important;
    stroke-width: 2.2 !important;
    filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.55));
}

/* Étiquettes des cantons sur la carte Suisse */
.kbr-smap-canton-tag-group {
    cursor: pointer;
}

.kbr-smap-canton-tag-bg {
    fill: rgba(15, 23, 42, 0.84);
    stroke: rgba(148, 163, 184, 0.48);
    stroke-width: 0.85;
    transition: fill 0.18s ease, stroke 0.18s ease;
}

.kbr-smap-canton-tag-group.has-online .kbr-smap-canton-tag-bg {
    border-color: rgba(74, 222, 128, 0.65);
    stroke: rgba(74, 222, 128, 0.65);
    fill: rgba(6, 58, 43, 0.86);
}

.kbr-smap-canton-tag-group:hover .kbr-smap-canton-tag-bg,
.kbr-smap-canton-tag-group.is-hovered .kbr-smap-canton-tag-bg {
    fill: #1d4ed8 !important;
    stroke: #bae6fd !important;
}

.kbr-smap-canton-tag-txt {
    fill: #e2e8f0;
    font-size: 8.6px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

/* Ancre précise de la ville sous le point vert sur la carte Suisse */
.kbr-smap-city-anchor {
    fill: #bae6fd;
    stroke: #0f172a;
    stroke-width: 0.8;
    opacity: 0.8;
    pointer-events: none;
}

.kbr-smap-city-callout {
    pointer-events: none;
}

/* --- POINTS VERTS PLACÉS SUR LA VILLE DE L'UTILISATEUR --- */
.kbr-smap-dot-group {
    cursor: pointer !important;
    pointer-events: all !important;
}

.kbr-smap-dot-halo {
    fill: rgba(34, 197, 94, 0.34);
    animation: kbr-dot-halo-breathe 2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.kbr-smap-dot-core {
    fill: #22c55e;
    stroke: #ffffff;
    stroke-width: 1.55;
    filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.95));
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.kbr-smap-dot-group:hover .kbr-smap-dot-core {
    fill: #4ade80;
    stroke: #fef08a;
    stroke-width: 2.2;
}

@keyframes kbr-dot-halo-breathe {
    0%, 100% { transform: scale(1); opacity: 0.78; }
    50% { transform: scale(1.55); opacity: 0.24; }
}

/* --- CLIGNOTEMENT INTENSE (Déclenché par clic Page 6 -> Page 7) --- */
.kbr-smap-canton-group.is-blinking .kbr-smap-canton-poly {
    animation: kbr-canton-poly-blink 0.55s ease-in-out infinite alternate !important;
}

.kbr-smap-canton-tag-group.is-blinking .kbr-smap-canton-tag-bg {
    fill: #16a34a !important;
    stroke: #fef08a !important;
    stroke-width: 1.8 !important;
}

@keyframes kbr-canton-poly-blink {
    0% {
        fill: rgba(22, 163, 74, 0.88);
        stroke: #fef08a;
        stroke-width: 2.8;
        filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.95));
    }
    100% {
        fill: rgba(234, 179, 8, 0.76);
        stroke: #ffffff;
        stroke-width: 3.2;
        filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.95));
    }
}

.kbr-smap-dot-group.is-blinking .kbr-smap-dot-core {
    animation: kbr-dot-core-blink 0.42s ease-in-out infinite alternate !important;
}

.kbr-smap-dot-radar {
    fill: none;
    stroke: #4ade80;
    stroke-width: 2.2;
    opacity: 0;
    pointer-events: none;
}

.kbr-smap-dot-group.is-blinking .kbr-smap-dot-radar {
    animation: kbr-dot-radar-wave 0.95s ease-out infinite !important;
}

@keyframes kbr-dot-core-blink {
    0% {
        fill: #22c55e;
        stroke: #ffffff;
        stroke-width: 2.3;
        filter: drop-shadow(0 0 8px #22c55e);
    }
    100% {
        fill: #fef08a;
        stroke: #16a34a;
        stroke-width: 2.9;
        filter: drop-shadow(0 0 14px #facc15);
    }
}

@keyframes kbr-dot-radar-wave {
    0% { r: 5px; opacity: 1; stroke: #4ade80; }
    100% { r: 22px; opacity: 0; stroke: #facc15; }
}

/* Zone dédiée sur la carte Suisse pour les membres visibles masquant leur lieu */
.kbr-smap-hidden-loc-zone {
    position: absolute;
    left: 6px;
    bottom: 5px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(74, 222, 128, 0.45);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    max-width: 74%;
    flex-wrap: wrap;
}

.kbr-smap-hidden-loc-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
}

.kbr-smap-html-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #86efac, #16a34a);
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 7px rgba(34, 197, 94, 0.95);
    cursor: pointer !important;
    pointer-events: auto !important;
    padding: 0;
    transition: transform 0.15s ease;
    position: relative;
}

.kbr-smap-html-dot:hover {
    transform: scale(1.3);
}

.kbr-smap-html-dot.is-blinking {
    animation: kbr-html-dot-blink 0.42s ease-in-out infinite alternate !important;
}

@keyframes kbr-html-dot-blink {
    0% {
        transform: scale(1);
        background: #22c55e;
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.9), 0 0 10px #22c55e;
    }
    100% {
        transform: scale(1.45);
        background: #fef08a;
        border-color: #16a34a;
        box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.35), 0 0 16px #facc15;
    }
}

/* --- Grille des 26 Cases des Cantons (Carte Suisse) & Cases Villes/Villages (Carte Canton) --- */
.kbr-smap-cases-drawer {
    flex: 0 0 40%;
    max-height: 42%;
    min-height: 64px;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 4px 6px 5px;
    background: rgba(9, 14, 28, 0.9);
    border-top: 1px solid rgba(56, 189, 248, 0.24);
}

.kbr-smap-cantons-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
}

@media (max-width: 520px) {
    .kbr-smap-cantons-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.kbr-canton-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 5px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
    font-size: 0.62rem;
    font-weight: 700;
    cursor: pointer !important;
    pointer-events: auto !important;
    min-width: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    text-align: left;
}

.kbr-canton-box:hover,
.kbr-canton-box.is-hovered {
    background: rgba(37, 99, 235, 0.44);
    border-color: #7dd3fc;
}

.kbr-canton-box.has-online {
    background: rgba(20, 83, 45, 0.5);
    border-color: rgba(74, 222, 128, 0.58);
}

.kbr-canton-box.is-blinking {
    animation: kbr-canton-box-blink 0.5s ease-in-out infinite alternate !important;
}

@keyframes kbr-canton-box-blink {
    0% {
        background: rgba(22, 163, 74, 0.85);
        border-color: #fef08a;
        box-shadow: 0 0 10px rgba(74, 222, 128, 0.85);
        transform: scale(1.03);
    }
    100% {
        background: rgba(234, 179, 8, 0.78);
        border-color: #ffffff;
        color: #0f172a;
        box-shadow: 0 0 14px rgba(250, 204, 21, 0.95);
        transform: scale(1.05);
    }
}

/* La petite case carrée devant le nom de chaque canton */
.kbr-canton-case-sq {
    width: 10px;
    height: 10px;
    border-radius: 2.5px;
    border: 1.4px solid rgba(148, 163, 184, 0.75);
    background: rgba(15, 23, 42, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kbr-canton-box.has-online .kbr-canton-case-sq {
    border-color: #4ade80;
    background: rgba(22, 163, 74, 0.35);
}

.kbr-canton-case-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 5px #22c55e;
}

.kbr-canton-box-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kbr-canton-box-cnt {
    font-size: 0.58rem;
    font-weight: 800;
    color: #86efac;
    background: rgba(22, 163, 74, 0.32);
    padding: 0 4px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* --- Vue Canton : Cantons voisins en filigrane, contour détaillé & Villes --- */
.kbr-canton-neighbor-ghost {
    cursor: pointer;
}

.kbr-canton-neighbor-ghost path {
    fill: rgba(15, 23, 42, 0.46);
    stroke: rgba(148, 163, 184, 0.22);
    stroke-linejoin: round;
    transition: fill 0.16s ease, stroke 0.16s ease;
}

.kbr-canton-neighbor-ghost:hover path {
    fill: rgba(30, 58, 138, 0.42);
    stroke: rgba(125, 211, 252, 0.5);
}

.kbr-canton-neighbor-lbl {
    fill: rgba(148, 163, 184, 0.45);
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.kbr-canton-outline-detail {
    fill: rgba(30, 58, 95, 0.78);
    stroke: #38bdf8;
    stroke-width: 2.2;
    stroke-linejoin: round;
    filter: drop-shadow(0 4px 14px rgba(2, 132, 199, 0.4));
}

.kbr-city-pin-marker {
    fill: #94a3b8;
    stroke: #0f172a;
    stroke-width: 1.1;
}

.kbr-city-node.is-capital .kbr-city-pin-marker {
    fill: #fbbf24;
    stroke: #0f172a;
}

.kbr-city-node.has-online .kbr-city-pin-marker {
    fill: #38bdf8;
    stroke: #e0f2fe;
}

.kbr-city-label-bg {
    fill: rgba(15, 23, 42, 0.85);
    stroke: rgba(148, 163, 184, 0.36);
    stroke-width: 0.8;
}

.kbr-city-node.is-capital .kbr-city-label-bg {
    stroke: rgba(251, 191, 36, 0.55);
}

.kbr-city-node.has-online .kbr-city-label-bg {
    fill: rgba(6, 78, 59, 0.92);
    stroke: rgba(74, 222, 128, 0.75);
}

.kbr-city-label-txt {
    fill: #f1f5f9;
    font-size: 9px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.kbr-city-node.is-capital .kbr-city-label-txt {
    fill: #fef3c7;
}

.kbr-city-node.has-online .kbr-city-label-txt {
    fill: #ecfdf5;
    font-weight: 800;
}

.kbr-cities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kbr-city-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    font-size: 0.62rem;
    font-weight: 600;
}

.kbr-city-chip.has-online {
    background: rgba(20, 83, 45, 0.58);
    border-color: rgba(74, 222, 128, 0.62);
    color: #ecfdf5;
    font-weight: 700;
}

/* Surbrillance de la ligne sélectionnée dans l'annuaire Page 6 */
.kbr-profile-row.kbr-row-map-selected {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.12)) !important;
    border-left: 3px solid #10b981 !important;
}

/* ==========================================================================
   MODALES AU PREMIER PLAN ABSOLU (Règle Promptus Studio stricte)
   ========================================================================== */
.kbr-ppa-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000080 !important;
    background: rgba(4, 6, 14, 0.85) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    padding: 16px;
    box-sizing: border-box;
}

.kbr-ppa-overlay.is-open {
    display: flex !important;
}

.kbr-ppa-card {
    position: relative;
    z-index: 10000085 !important;
    width: 100%;
    max-width: 390px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 18px;
    background: var(--bg-secondary, linear-gradient(165deg, #0f172a 0%, #162038 100%));
    color: var(--text-primary, #f8fafc);
    border: 1.5px solid var(--border-active, rgba(56, 189, 248, 0.45));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 28px rgba(56, 189, 248, 0.18);
    padding: 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    animation: kbr-ppa-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kbr-ppa-pop {
    from { transform: scale(0.92) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.kbr-ppa-close-btn {
    position: absolute !important;
    top: 12px;
    right: 12px;
    z-index: 10000095 !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.9);
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: background 0.15s ease, transform 0.15s ease;
}

.kbr-ppa-close-btn:hover {
    background: #ef4444;
    border-color: #fca5a5;
    transform: scale(1.08);
}

.kbr-ppa-btn {
    position: relative !important;
    z-index: 10000095 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    border: none;
    border-radius: 11px;
    padding: 9px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.15s ease, transform 0.12s ease;
}

.kbr-ppa-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.kbr-ppa-btn--primary {
    background: linear-gradient(135deg, var(--accent-primary, #ec4899), #8b5cf6);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

.kbr-ppa-btn--emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

.kbr-ppa-btn--sky {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.32);
}

.kbr-ppa-btn--ghost {
    background: rgba(30, 41, 59, 0.9);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}
