/* =========================================================
   🎨 directory.css — Styles globaux pour INTERNATIONAL
   ========================================================= */

/* =========================================================
   🎨 VARIABLES GLOBALES (Design Tokens)
   ========================================================= */
:root {
    /* Couleurs principales */
    --color-primary: #278FE2;          /* Bleu principal utilisé pour titres/links */
    --color-primary-dark: #1e3d7b;     /* Bleu foncé au survol */
    --color-dark-blue: #092851;        /* Bleu foncé pour boutons non-actifs */
    --color-orange: #f28c00;           /* Orange accent / département */
    --color-accent: #f57c00;           /* autre orange (breadcrumbs) */

    /* Textes et fonds */
    --color-text-dark: #333;
    --color-text-medium: #444;
    --color-text-light: #999;
    --color-background-light: #e0e0e0;
    --color-background-off-white: #f1f1f1;
    --color-row-even: #ffffff;
    --color-row-odd: #eeeeee;
    --color-row-hover: #d7dff2;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Rayons */
    --radius-sm: 5px;
    --radius-lg: 25px;

    /* Typographie */
    --font-family: 'Raleway', sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 1.8rem;
}

/* ====================== Carte International ====================== */
.map-container {
    max-width: 1200px;
    height: 720px;
    margin: 20px auto 40px;
    padding: 10px;
}

/* Layout */
.international-layout {
    display: flex;
    gap: 150px;
    width: min(90%, 1600px);
    padding: 0px;
    box-sizing: border-box;
    margin: 40px auto 60px;
    max-width: 75%;
}

/* Sidebar gauche */
.map-sidebar {
    flex: 0 0 450px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Bloc d'information Relations Internationales */
.sidebar-info-block {
    margin-bottom: 25px;
    padding-right: 10px;
}

.info-title {
    color: #288FE2; /* Le bleu utilisé pour les publications */
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-family: 'Raleway', sans-serif;
}

.info-text {
    font-size: 18px;
    line-height: 1.6;
    color: gray;
    text-align: left;
}

/* Séparateur entre le texte et les filtres */
.sidebar-separator {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Zone carte */
.map-wrapper {
    flex: 1;
    min-height: 720px;
}

#world-map {
    width: 100%;
    height: 860px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* halo for circleMarker svg */
.marker-circle {
    filter: drop-shadow(0 0 6px rgba(255,80,80,0.6));
}

.zone-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.zone-btn {
    border: none;
    background: white;

    color: #092951;

    padding: 10px 18px;

    border-radius: 999px;

    font-family: Raleway, sans-serif;
    font-size: 14px;
    font-weight: 700;

    display: flex;
    align-items: center;
    gap: 8px;

    cursor: pointer;

    transition: all 0.25s ease;

    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.zone-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.zone-btn.active {
    background: #278FE2;
    color: white;
}

.theme-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.theme-btn {
    border: none;
    background: white;
    color: #092951;
    padding: 10px 16px;
    border-radius: 999px;
    font-family: Raleway, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
}

.theme-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.theme-btn:hover {
    transform: translateY(-1px);
}

.theme-btn.active {
    background: #278FE2;
    color: white;
}

.theme-publications {
    background: rgba(233, 138, 40, 0.14);
    color: #C96F12;
    border: 2px solid rgba(233, 138, 40, 0.35);
}

.theme-publications.active {
    background: #E98A28;
    color: white;
    border-color: #E98A28;
}

.theme-theses {
    background: rgba(63, 174, 90, 0.14);
    color: #2E8B47;
    border: 2px solid rgba(63, 174, 90, 0.35);
}

.theme-theses.active {
    background: #3FAE5A;
    color: white;
    border-color: #3FAE5A;
}

/* Boutons de filtre & menu déroulant (style subjectlist) */
.filter-dropdown-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.filter-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    border-top: none;
    left: 0;
    top: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-menu.show {
    display: block;
}

.menu-item {
    padding: 8px 15px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.menu-item:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

.menu-item.reset {
    color: #333;
}

.menu-item.reset:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

.filter-btn {
    border: none;
    padding: 6px 14px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    background-color: var(--color-dark-blue);
    transition: all 0.16s ease;
    white-space: nowrap;
}

.filter-btn.active {
    background-color: var(--color-orange);
}

.filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* theme filters */
.theme-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* legend */
.map-legend {
    background: #fff;
    padding:10px;
    border-radius:6px;
    box-shadow:0 2px 8px rgba(0,0,0,0.12);
    font-size:13px;
}

.legend-swatch {
    display:inline-block;
    width:14px;
    height:14px;
    margin-right:6px;
    vertical-align:middle;
    border-radius:50%;
}

/* slider quick style */
.controls {
    display:flex;
    gap:12px;
    align-items:center;
    margin:10px 0 14px;
}

.controls .control-item {
    background:#fff;
    padding:8px 10px;
    border-radius:6px;
    box-shadow:0 1px 4px rgba(0,0,0,0.06);
    font-size:14px;
}

/* cluster override */
.leaflet-marker-icon .cluster-count {
    font-weight:700;
    color:#fff;
    text-shadow:0 1px 0 rgba(0,0,0,0.4);
}

/* popup strong style */
.leaflet-popup-content b {
    font-size:14px;
}

/* Style pour nos clusters personnalisés */
.marker-cluster-custom {
    background: transparent !important;
    border: none;
}

.marker-cluster-custom > div {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    transition: all 0.25s ease;

    box-shadow:
            0 0 0 6px rgba(39, 143, 226, 0.35),
            0 4px 12px rgba(0,0,0,0.18);

    backdrop-filter: blur(2px);
}

.marker-cluster-custom > div:hover {
    transform: scale(1.08);
}

.marker-cluster-custom > div > div {
    width: 32px;
    height: 32px;

    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    text-align: center;

    font-size: 13px;
    font-weight: 800;
    font-family: Raleway, sans-serif;

    color: white;

    box-shadow:
            inset 0 1px 2px rgba(255,255,255,0.25),
            0 2px 6px rgba(0,0,0,0.2);
}

/* Force les points individuels (CircleMarkers) à garder leur couleur JS */
path.leaflet-interactive {
    stroke-opacity: 1;
    fill-opacity: 0.7;
}

.filter-icon {
    width: 25px;   /* ajuste selon besoin */
    height: 25px;
    vertical-align: middle; /* pour l'aligner avec le texte ou les autres icônes */
    filter: brightness(1.3) contrast(1.2);
}

.map-container {
    max-width: 1200px;
    height: 760px;
    margin: 20px auto 50px;
    padding: 20px;
    background: #F8F6F2;
    border-radius: 0 0 30px 0;
}

.map-title {
    color: #092951;
    font-family: Raleway, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 20px;
    text-align: center;
}

#world-map {
    width: 100%;
    height: calc(100% - 125px);
    border-radius: 12px;
    border: 1px solid #d8d8d8;
    overflow: hidden;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
    justify-content: center;
    margin-bottom: 18px;
}

.control-item {
    background: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    font-size: 14px;
    color: #092951;
}

.control-item label {
    font-weight: 700;
}

.search-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.search-row input {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-row button {
    border: none;
    background: #278FE2;
    color: white;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.search-row button:hover {
    background: #16519C;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.legend-swatch.low {
    background: hsl(120,70%,48%);
}

.legend-swatch.medium {
    background: hsl(60,70%,48%);
}

.legend-swatch.high {
    background: hsl(0,70%,48%);
}

.legend-note {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.marker-circle {
    filter: drop-shadow(0 0 6px rgba(255,80,80,0.55));
}

.international-marker {
    filter: drop-shadow(0 0 6px rgba(9, 41, 81, 0.45));
}

.map-popup {
    font-family: Raleway, sans-serif;
    max-width: 390px;
}

.popup-country {
    color: #092951;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.popup-total {
    color: #E98A28;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.popup-universities {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
}

.popup-universities li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 18px 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    line-height: 1.3;
}

.popup-universities li span {
    flex: 1;
}

.popup-universities li strong {
    color: #092951;
    min-width: 24px;
    text-align: right;
}

.popup-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.popup-count small {
    font-size: 10px;
    color: #777;
}
/* --- Media Query pour Desktop (min-width: 992px) --- */
@media (min-width: 992px) {
    .international-layout {
        flex-direction: row; /* On repasse en ligne */
        margin: 40px auto;
    }

    .map-sidebar {
        flex: 0 0 350px; /* Largeur fixe sidebar */
    }

    #world-map {
        height: 700px; /* Plus grand sur desktop */
    }
}

/* Optionnel : rendre les boutons de filtre plus larges sur mobile */
@media (max-width: 768px) {
    /* --- Modification du Layout --- */
    .international-layout {
        display: flex;
        flex-direction: column; /* Par défaut pour mobile */
        gap: 20px;
        margin: 20px auto;
        padding: 0 15px;
        max-width: 100%;
    }

    /* Sidebar en haut sur mobile, à gauche sur desktop */
    .map-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }

    /* Carte : on réduit la hauteur sur petit écran */
    #world-map {
        width: 100%;
        height: 400px; /* Plus petit sur mobile */
        border-radius: 8px;
    }

    .filter-btn {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .filter-dropdown-container {
        width: 100%;
    }
    p.info-text {
        font-size: 14px;
    }

    @media (max-width: 768px) {

        .leaflet-popup-content-wrapper {
            max-width: 260px !important;
            border-radius: 14px;
        }

        .leaflet-popup-content {
            width: 220px !important;
            max-width: 220px !important;
            margin: 12px !important;
            font-size: 12px;
        }

        .popup-universities {
            max-height: 180px;
        }

        .popup-country {
            font-size: 14px;
        }

        .popup-total {
            font-size: 12px;
        }

        .popup-universities li {
            font-size: 11px;
            gap: 8px;
        }

        .popup-count small {
            font-size: 9px;
        }
    }
}