﻿/* Styles pour la page liste des auteurs - Refonte Premium (Maquette) */

/* Définition des variables dynamiques selon le thème */
:root, body.theme-beige, body.theme-blanc {
    --authors-bg: var(--bg);
    --authors-panel: var(--panel);
    --authors-text-primary: var(--text-primary);
    --authors-text-secondary: var(--text-secondary);
    --authors-border: var(--border-color);
    --authors-gold: #c29b38;
    --authors-circle-bg: #E2D6BC;
    --authors-circle-text: #0E211F;
    --authors-card-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --authors-card-hover-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

body.theme-noir {
    --authors-bg: var(--bg);
    --authors-panel: var(--panel);
    --authors-text-primary: var(--text-primary);
    --authors-text-secondary: var(--text-secondary);
    --authors-gold: #C7993F;
    --authors-circle-bg: #E2D6BC;
    --authors-circle-text: #0E211F;
    --authors-border: var(--border-color);
    --authors-card-shadow: 0 4px 12px rgba(0,0,0,0.2);
    --authors-card-hover-shadow: 0 12px 30px rgba(0,0,0,0.4);
    --authors-map-bg: #081a18;
    --authors-map-panel: rgba(15, 28, 26, 0.92);
    --authors-map-border: rgba(226, 214, 188, 0.12);
    --authors-map-control-bg: rgba(15, 28, 26, 0.82);
    --authors-map-text: #E2D6BC;
    --authors-map-muted: rgba(226, 214, 188, 0.72);
    /* Couches SVG — thème sombre : fond sombre + lignes dorées */
    --svg-border: #b18247;
    --svg-land1:  #5c4a2c;
    --svg-land2:  #2f2f21;
    --svg-land3:  #1a231c;
    --svg-ocean1: #03191a;
    --svg-ocean2: #051515;
    --svg-ocean3: #010f10;
}

:root, body.theme-beige, body.theme-blanc {
    --authors-map-bg: #F6F2E8;
    --authors-map-panel: rgba(255, 255, 255, 0.92);
    --authors-map-border: rgba(16, 28, 23, 0.14);
    --authors-map-control-bg: rgba(255, 255, 255, 0.86);
    --authors-map-text: #13221d;
    --authors-map-muted: rgba(19, 34, 29, 0.65);
}

/* Couches SVG — thème CLAIR : mer bleu clair, terres ivoire/parchemin, reliefs doré-brun.
   IMPORTANT : la séparation eau/terre/lignes se fait PAR COUCHE (1 path = 1 fill),
   jamais par un filtre global. Mapping des 7 paths du SVG :
     • land1  = fond plein des continents  -> ivoire clair
     • land2  = ombrage doux des terres    -> parchemin
     • land3  = fines lignes topographiques-> doré-brun (NE PAS éclaircir, sinon reliefs invisibles)
     • ocean1/2/3 = dégradé de la mer      -> bleus clairs
     • border = cadre / traits             -> doré */
body.theme-blanc {
    --svg-border: #B68A4A;  /* traits dorés principaux */
    --svg-land1:  #F3EBDD;  /* TERRE : fond ivoire/parchemin clair (jamais bleu) */
    --svg-land2:  #EADFCE;  /* TERRE : teinte secondaire douce */
    --svg-land3:  #9A7440;  /* TERRE : fines lignes topographiques doré-brun */
    --svg-ocean1: #D9EAF4;  /* MER : bleu clair doux */
    --svg-ocean2: #CFE3EE;  /* MER : teinte secondaire */
    --svg-ocean3: #BBD6E8;  /* MER : profondeur légèrement plus soutenue */
}

/* Couches SVG — thème beige : atlas parchemin, eau sablée, contours ambrés */
body.theme-beige {
    --svg-border: #6B420F;
    --svg-land1:  #C89860;
    --svg-land2:  #AA7C48;
    --svg-land3:  #8C6030;
    --svg-ocean1: #C4AE88;
    --svg-ocean2: #B09870;
    --svg-ocean3: #9A8258;
}

/* === NOUVEAU THEME SOMBRE (Maquette) === */
body.theme-maquette {
    --authors-bg: #0E211F;
    --authors-panel: #152724;
    --authors-text-primary: #E2D6BC;
    --authors-text-secondary: rgba(226, 214, 188, 0.7);
    --authors-gold: #C7993F;
    --authors-circle-bg: #E2D6BC;
    --authors-circle-text: #0E211F;
    --authors-border: rgba(226, 214, 188, 0.1);
    --authors-card-shadow: 0 4px 12px rgba(0,0,0,0.2);
    --authors-card-hover-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

/* Application du fond spécifique si le nouveau thème est actif */
body.theme-maquette {
    background-color: var(--authors-bg) !important;
}

/* .page-title-serif — taille et marges communes avec Bibliothèque et Mes Notes
   (voir public/common-styles.css) ; seule la couleur change ici pour rester
   lisible sur le fond du thème "maquette". */
.page-title-serif {
    color: var(--authors-text-primary);
}

/* ===== Barre d'outils (Toolbar) ===== */
.authors-toolbar-premium {
    background: transparent;
    margin-bottom: 1.5rem;
}

/* .library-search-box — style commun avec Bibliothèque et Mes Notes,
   voir la définition de base dans public/common-styles.css */

/* Le bouton "Filtres" utilise désormais .filters-btn (commun avec Mes Notes,
   voir public/popup-shared.css) pour garder un look identique entre les pages. */

/* .authors-sort-controls / .sort-order-btn — la barre de tri utilise
   désormais .sort-row (commun avec Bibliothèque et Mes Notes, voir
   common-styles.css) ; .authors-sort-controls ne sert plus que de point
   d'ancrage pour la visite guidée. */

/* .toolbar-layouts / .layout-btn / .toolbar-authors-count — style commun
   avec les onglets de Bibliothèque et le sélecteur de vue de Mes Notes,
   voir public/toolbar-shared.css */



/* ===== Grille & Cartes Premium — max 4 par ligne. La formule (100% - 72px)/4
   garantit exactement 4 colonnes (72px = 3 gaps de 24px) ; max-width plafonne
   ce que "100%" peut valoir, donc les cartes ne dépassent jamais ~280px. ===== */
.authors-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(240px, (100% - 72px) / 4), 1fr));
    gap: 24px;
    max-width: 1192px;
    margin: 0 auto 3rem;
    align-items: stretch;
}

.author-card-premium {
    padding: 16px 20px;
    margin: 0 5px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.card-circle-premium {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--authors-circle-bg);
    flex-shrink: 0;
    margin: 4px;
    outline: 1.5px solid var(--authors-gold);
    outline-offset: 3px;
    /* Plus besoin de border ou d'overflow ici car outline gère l'extérieur */
}

.author-calligraphy-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.card-circle-premium .arabic-domain {
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
    font-size: 1.4rem;
    color: var(--authors-circle-text);
    line-height: 1;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.card-latin-name {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--authors-text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-arabic-name {
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
    font-size: 0.85rem;
    color: var(--authors-text-secondary);
    line-height: 1.2;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
}

.card-dates-info {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--authors-text-secondary);
    direction: ltr;
    unicode-bidi: isolate;
}

.card-domain-tag {
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
    font-size: 0.75rem;
    color: var(--authors-gold);
    padding: 1px 8px;
    border: 1px solid var(--authors-gold);
    border-radius: 10px;
    line-height: 1.4;
}

.card-generation-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    padding: 1px 7px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.card-honorific {
    font-family: 'Traditional Arabic', 'Simplified Arabic', 'Amiri', serif;
    font-size: 0.75rem;
    color: var(--authors-gold);
    direction: rtl;
    padding: 1px 8px;
    border: 1px solid var(--authors-gold);
    border-radius: 10px;
    line-height: 1.4;
}

.featured-honorific,
.recent-honorific {
    font-family: 'Traditional Arabic', 'Simplified Arabic', 'Amiri', serif;
    font-size: 0.8rem;
    color: var(--authors-gold);
    direction: rtl;
    margin: 2px 0;
    padding: 1px 10px;
    border: 1px solid var(--authors-gold);
    border-radius: 10px;
    line-height: 1.5;
    display: inline-block;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.card-quote-premium {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 0.85rem;
    color: var(--authors-text-secondary);
    line-height: 1.4;
    margin: 4px 0 12px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--authors-gold);
}

.card-footer span {
    margin-left: 6px;
}

/* ============================================================== */
/* === VUE PAR GÉNÉRATION (Anciens / Intermédiaires / ...)     === */
/* ============================================================== */
.generation-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 3rem;
    align-items: start;
}

.generation-column {
    background: var(--authors-panel);
    border: 1px solid var(--authors-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--authors-card-shadow);
}

.generation-column-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--authors-border);
    position: relative;
    width: 100%;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.generation-toggle-chevron {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: var(--authors-gold);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.generation-column.collapsed .generation-toggle-chevron {
    transform: translateY(-50%) rotate(-90deg);
}

.generation-column.collapsed .generation-cards {
    display: none;
}

.generation-column.collapsed .generation-column-header {
    border-bottom: none;
}

.generation-title-fr {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--authors-gold);
}

.generation-subtitle {
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
    font-size: 0.95rem;
    color: var(--authors-text-secondary);
}

.generation-range-bdi {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.generation-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}

.generation-column-empty {
    padding: 8px 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--authors-text-secondary);
    text-align: center;
}

.generation-card {
    position: relative;
    background: var(--panel-light, #fff);
    border: 1px solid var(--authors-border);
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.generation-card:hover,
.generation-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--authors-card-hover-shadow);
    border-color: var(--authors-gold);
    outline: none;
}

.generation-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.generation-card-dates {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--authors-gold);
}

.generation-card-honorific {
    font-family: 'Traditional Arabic', 'Simplified Arabic', 'Amiri', serif;
    font-size: 0.75rem;
    color: var(--authors-gold);
    padding: 1px 8px;
    border: 1px solid var(--authors-gold);
    border-radius: 10px;
    line-height: 1.4;
}

.generation-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 30px;
}

.generation-card-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.generation-card-name-fr {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--authors-text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.generation-card-name-ar {
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
    font-size: 0.95rem;
    color: var(--authors-gold);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.generation-card-domain {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--authors-text-secondary);
    opacity: 0.8;
}

.generation-card-bio {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    color: var(--authors-text-secondary);
    line-height: 1.45;
    margin-top: 8px;
    padding-top: 8px;
    padding-right: 1.2rem;
    border-top: 1px solid var(--authors-border);
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.generation-card-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--authors-gold);
    border: 1.5px solid var(--authors-gold);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .generation-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .generation-columns {
        grid-template-columns: 1fr;
    }
}

/* Fallback loading/no authors */
.loading-authors, .no-authors {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    font-family: 'Inter', sans-serif;
    color: var(--authors-text-secondary);
}

#featured-author-container, #recent-authors-section, .authors-footer-quote {
    display: none !important;
}

/* ================================================================ */
/* VUE CARTE (MAP VIEW) - AUTEURS */
/* ================================================================ */

#authors-map-container {
    width: 100%;
    min-height: 680px;
    height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--authors-map-bg);
    border: 1px solid var(--authors-map-border);
    box-shadow: 0 18px 45px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

#authors-map-container .leaflet-pane,
#authors-map-container .leaflet-overlay-pane,
#authors-map-container .leaflet-map-pane {
    border-radius: inherit;
}
#authors-map-container .leaflet-container {
    border-radius: 12px;
    overflow: hidden;
}

#authors-map-container:fullscreen {
    height: 100vh;
    height: 100dvh; /* iOS : suit la hauteur réellement visible */
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

.authors-map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Conteneur de montage Leaflet (carte vectorielle) */
.authors-map-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--authors-map-bg);
}

/* Fond Leaflet transparent pour mieux montrer l'image SVG. */
.authors-map-canvas.leaflet-container {
    background: transparent;
    font: inherit;
}

/* Carte rastérisée : promue en couche GPU => pan/zoom fluides */
.authors-map-raster {
    will-change: transform;
    image-rendering: auto;
}
.authors-map-canvas .leaflet-div-icon {
    background: transparent;
    border: none;
}

/* Clip universel Leaflet pour respecter le border-radius du container */
#authors-map-container {
    clip-path: inset(0 round 12px);
}

/* ------------------------------------------------------------------ */
/* COUCHES SVG — Réagissent au thème via variables CSS                 */
/* Les 7 paths du SVG reçoivent ces classes dans loadMapSvg().         */
/* ------------------------------------------------------------------ */
.svg-map-border { fill: var(--svg-border, #b18247); transition: fill 0.5s ease; }
.svg-map-land1  { fill: var(--svg-land1,  #5c4a2c); transition: fill 0.5s ease; }
.svg-map-land2  { fill: var(--svg-land2,  #2f2f21); transition: fill 0.5s ease; }
.svg-map-land3  { fill: var(--svg-land3,  #1a231c); transition: fill 0.5s ease; }
.svg-map-ocean1 { fill: var(--svg-ocean1, #03191a); transition: fill 0.5s ease; }
.svg-map-ocean2 { fill: var(--svg-ocean2, #051515); transition: fill 0.5s ease; }
.svg-map-ocean3 { fill: var(--svg-ocean3, #010f10); transition: fill 0.5s ease; }

.authors-map-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 410;
    background: radial-gradient(circle at center,
        rgba(0,0,0,0) 55%, rgba(0,0,0,0.18) 100%);
}

/* Overlays (zoom, boussole) */
#authors-map-container .map-controls,
#authors-map-container .map-compass {
    z-index: 1000;
}

/* Labels de régions posés comme markers Leaflet. */
.leaflet-region-wrap {
    width: 0 !important;
    height: 0 !important;
}
.leaflet-region-wrap .region-label-text {
    position: absolute;
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
    color: var(--authors-map-text);
    font-family: var(--font-serif), 'Lora', serif;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.92;
    font-weight: 600;
    max-width: 120px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    letter-spacing: 0.3px;
}

/* Le marker Leaflet positionne le wrapper ; le point se centre dedans */
.leaflet-author-dot-wrap .map-author-dot {
    display: block;
    width: 8px;
    height: 8px;
    margin: 0;
}

.map-author-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.leaflet-author-dot-wrap {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0);
}

.leaflet-author-dot-wrap.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.leaflet-author-dot-wrap:hover .map-author-dot {
    transform: scale(1.35);
}

.map-author-dot.living {
    background-color: #7fa973;
    border: 1px solid var(--authors-map-bg);
}

.map-author-dot.deceased {
    background-color: #C4A368;
    border: 1px solid var(--authors-map-bg);
}

/* Nœud Central de la Région */
.leaflet-region-wrap .region-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background-color: var(--authors-map-text);
    border: 2px solid var(--authors-map-panel);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.leaflet-region-wrap:hover .region-node {
    transform: translate(-50%, -50%) scale(1.25);
    background-color: var(--authors-gold);
}

/* Tooltip Leaflet (au survol d'un point auteur) */
.leaflet-tooltip.leaflet-author-tooltip {
    background: var(--authors-map-panel);
    border: 1px solid var(--authors-map-border);
    color: var(--authors-map-text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.35;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}
.leaflet-tooltip.leaflet-author-tooltip::before {
    border-top-color: var(--authors-map-border);
}

.map-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 16px;
    background: var(--authors-map-control-bg);
    border-bottom: 1px solid var(--authors-map-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Auto-hide au repos — révèle la carte en entier */
.map-controls.controls-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
}

/* Bouton punaise : état épinglé (la barre reste affichée) */
.map-pin-btn.pinned {
    background: var(--authors-map-text);
    color: var(--authors-map-bg);
    border-color: var(--authors-map-text);
}

.map-zoom-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--authors-map-panel);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--authors-map-border);
}

.map-zoom-label {
    color: var(--authors-map-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.map-zoom-btn {
    background: var(--authors-map-control-bg);
    border: 1px solid var(--authors-map-border);
    color: var(--authors-map-text);
    font-size: 1rem;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-zoom-btn:hover {
    background: var(--authors-map-text);
    color: var(--authors-map-bg);
    transform: translateY(-1px);
}

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

.map-zoom-btn--reset svg {
    pointer-events: none;
}

.map-zoom-btn--reset:hover {
    background: var(--authors-map-text);
    color: var(--authors-map-bg);
}

.map-compass {
    position: absolute;
    top: 62px;
    right: 20px;
    opacity: 0.85;
}

.map-compass svg polygon,
.map-compass svg circle {
    stroke: var(--authors-map-text);
}

.map-compass svg text {
    fill: var(--authors-map-text);
}

/* ================================================================ */
/* VOLET DE DÉTAILS EN BAS À GAUCHE - STYLE GRAPH (NOTES/LIVRES) */
/* ================================================================ */

.map-author-detail-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 340px;
    max-height: 60vh;
    background: var(--authors-map-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--authors-map-border);
    border-radius: 16px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.22);
    z-index: 800;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--authors-map-text);
}

.map-author-detail-panel.active {
    display: flex;
}

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

.map-detail-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: rgba(199, 153, 63, 0.1);
    border: 1px solid rgba(199, 153, 63, 0.2);
    color: var(--authors-map-text);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-detail-close-btn:hover {
    background: rgba(199, 153, 63, 0.3);
    color: #FFF;
}

.map-detail-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.map-detail-author-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(199, 153, 63, 0.15);
    cursor: pointer;
    transition: all 0.2s;
}

.map-detail-author-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.map-detail-author-item:hover {
    padding-left: 4px;
}

.map-detail-author-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-detail-author-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.map-detail-author-domain {
    font-size: 0.8rem;
    color: var(--accent-gold, #C7993F);
    font-family: 'Traditional Arabic', 'Simplified Arabic', serif;
}

/* Styles pour les étiquettes de texte du SVG de la carte */
.svg-map-text {
    fill: var(--authors-map-text) !important;
    font-family: var(--font-serif), 'Lora', Georgia, serif !important;
    font-weight: bold !important;
    letter-spacing: 0.5px;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.9) !important;
}

.arabic-region-label {
    font-family: 'Amiri', 'Traditional Arabic', serif !important;
    font-size: 1.1em !important;
    opacity: 0.95;
}

/* ===== Popup mobile filtres + bouton secondaire (portés depuis main) ===== */
/* Base commune des popups de filtres/tri (.popup-overlay/-content/
   -header/-title/-section/-section-title, .popup-stats-section .popup-stats)
   -> voir public/popup-shared.css, chargé sur cette page via cssPaths.
   Cette page a une popup "Tri" plus étroite que la base : on ajuste juste sa largeur. */
.popup-content {
    max-width: 400px;
}

.btn-secondary {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--panel-light);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.btn-secondary:hover {
    filter: brightness(0.92);
}

/* Rotation 180° de l'icône du bouton génération */
#layout-generation-btn svg {
    transform: rotate(180deg);
}
