/* Styles propres au projet, chargés après le thème SB Admin 2 */

/* Menu latéral : padding vertical des entrées divisé par 2 (thème : 1rem en écran large, .75rem en étroit ou replié) */
.sidebar .nav-item .nav-link {
    padding-top: .375rem;
    padding-bottom: .375rem;
}

@media (min-width: 768px) {
    .sidebar .nav-item .nav-link {
        padding-top: .5rem;
        padding-bottom: .5rem;
    }

    .sidebar.toggled .nav-item .nav-link {
        padding-top: .375rem;
        padding-bottom: .375rem;
    }
}

/* Ordre de bataille (tableau de bord) : arbre à traits, nœuds repliables (<details>) */
.oob-tree, .oob-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}
.oob-tree ul {
    margin-left: .55rem;
    padding-left: 1rem;
    border-left: 1px dashed #d1d3e2;
}
.oob-tree li {
    position: relative;
    padding: .1rem 0;
}
.oob-tree ul > li::before {          /* trait horizontal vers chaque nœud */
    content: "";
    position: absolute;
    left: -1rem;
    top: .85rem;
    width: .75rem;
    border-top: 1px dashed #d1d3e2;
}
.oob-tree summary {
    cursor: pointer;
    list-style: none;
}
.oob-tree summary::-webkit-details-marker { display: none; }
.oob-tree summary::before {          /* triangle ouvert / fermé */
    content: "\25B8";
    display: inline-block;
    width: .9rem;
    color: #858796;
    transition: transform .15s;
}
.oob-tree details[open] > summary::before { transform: rotate(90deg); }
.oob-count {
    margin-left: .35rem;
    font-size: .75rem;
    color: #858796;
}
.oob-counter .badge { font-size: .75rem !important; margin-left: .25rem; }
.oob-empty {
    font-size: .8rem;
    font-style: italic;
    color: #b7b9cc;
}

/* Types d'hexagones : pastille hexagonale de couleur, et sélecteur de couleur du formulaire */
.hex-swatch {
    display: inline-block;
    width: 1.5rem;
    height: 1.3rem;
    vertical-align: middle;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.hexagon-color-input {
    width: 5rem;
    height: calc(1.5em + .75rem + 2px);
    padding: .2rem;
}

/* Carte (page /map) : image de fond + hexagones SVG dans le repère de l'image d'origine (14 400 px) */
.map-viewport {
    height: calc(100vh - 16rem);
    min-height: 24rem;
    overflow: auto;
    background: #efe6cf;
    cursor: grab;
}
.map-viewport.is-dragging { cursor: grabbing; }
.map-svg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}
.map-hexes polygon {
    fill-opacity: var(--map-tint, .45);
    stroke: #2b2418;
    stroke-opacity: .55;
    stroke-width: 6;
    transition: fill-opacity .1s;
}
.map-hexes polygon { cursor: pointer; }
.map-viewport.is-dragging .map-hexes polygon { cursor: grabbing; }
.map-hexes polygon:hover {
    fill-opacity: calc(var(--map-tint, .45) + .3);
    stroke: #4e73df;
    stroke-opacity: 1;
    stroke-width: 14;
}
.map-svg.hide-grid .map-hexes polygon { stroke-opacity: 0; }
.map-codes text {
    fill: #2b2418;
    font-family: "DejaVu Sans Mono", monospace;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: #fffaf0;
    stroke-width: 14;
    stroke-opacity: .9;
    pointer-events: none;
}
.map-svg.hide-codes .map-codes { display: none; }
.map-toolbar .custom-range { height: 1rem; }

/* Carte : hexagone tout juste modifié (bref halo bleu) */
@keyframes map-hex-updated {
    from { stroke: #4e73df; stroke-opacity: 1; stroke-width: 28; }
    to   { stroke-width: 6; }
}
.map-hexes polygon.is-updated { animation: map-hex-updated 1.2s ease-out; }

/* Carte : réseau de jeu (coordonnées de l'image d'origine : un hexagone fait 481 px de large) */
/* cours réel (toujours visible) ; côtés porteurs d'un fleuve (données du jeu) : en mode Fleuves seulement */
.map-courses .course { fill: none; stroke: #2f6db5; stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; }
.map-courses { pointer-events: none; }
.map-svg.mode-river .map-courses { opacity: .35; }
.map-rivers { display: none; }
.map-svg.mode-river .map-rivers { display: inline; }
.map-rivers .river { stroke: #1d4f86; stroke-width: 42; stroke-linecap: round; }
.map-road-courses .road-casing { fill: none; stroke: #fff6e5; stroke-width: 40; stroke-linecap: round; stroke-linejoin: round; }
.map-road-courses .road { fill: none; stroke: #b8321e; stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; }
.map-road-courses { pointer-events: none; }
.map-svg.mode-road .map-road-courses { opacity: .35; }
/* liaisons routières de jeu (de centre à centre) : mode Routes */
.map-roads { display: none; }
.map-svg.mode-road .map-roads { display: inline; }
.map-roads .road-link { stroke: #b8321e; stroke-width: 30; stroke-linecap: round; }
.map-rivers, .map-roads { pointer-events: none; }
.map-svg.hide-roads .map-roads, .map-svg.hide-roads .map-road-courses,
.map-svg.hide-rivers .map-rivers, .map-svg.hide-rivers .map-courses { display: none; }
/* zones cliquables des côtés : visibles et actives en mode Fleuves seulement */
.map-sides { display: none; }
.map-svg.mode-river .map-sides { display: inline; }
.map-sides .side { stroke: #2f6db5; stroke-opacity: 0; stroke-width: 90; stroke-linecap: round; cursor: pointer; }
.map-sides .side:hover { stroke-opacity: .45; }
.map-svg.mode-river .map-hexes polygon { cursor: inherit; }
/* mode Routes : hexagone de départ */
.map-hexes polygon.is-selected { stroke: #b8321e; stroke-opacity: 1; stroke-width: 28; fill-opacity: calc(var(--map-tint, .45) + .25); }
.map-status { max-width: 32rem; text-align: right; }
/* légende du réseau */
.legend-road, .legend-river { display: inline-block; width: 1.6rem; height: .35rem; vertical-align: middle; border-radius: .2rem; }
.legend-road { background: #b8321e; box-shadow: 0 0 0 2px #fff6e5; }
.legend-river { background: #2f6db5; height: .45rem; }

/* Carte, mode Tracés : cours réel des fleuves cliquables, tracé en cours, points déplaçables, côtés de jeu proposés */
.course-hit { fill: none; stroke: #000; stroke-opacity: 0; stroke-width: 140; stroke-linecap: round; stroke-linejoin: round; }
.map-svg.mode-course .map-courses, .map-svg.mode-course .map-road-courses { pointer-events: auto; }
.map-svg.mode-course .map-courses .course, .map-svg.mode-course .map-road-courses .road,
.map-svg.mode-course .map-road-courses .road-casing { pointer-events: none; }
.map-svg.mode-course .course-hit { pointer-events: stroke; cursor: pointer; }
.map-svg.mode-course .map-courses g:hover .course { stroke: #e74a3b; }
.map-svg.mode-course .map-road-courses g:hover .road { stroke: #6f42c1; }
.map-svg.mode-course .map-rivers, .map-svg.mode-course .map-roads { display: inline; opacity: .35; }
.map-svg.mode-course .map-hexes polygon { cursor: crosshair; }
.map-svg.mode-course .map-hexes polygon:hover { fill-opacity: var(--map-tint, .45); stroke: #2b2418; stroke-opacity: .55; stroke-width: 6; }
.map-course-edit { pointer-events: none; }
.map-course-edit .course-preview { fill: none; stroke: #e74a3b; stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; }
.map-course-edit .course-preview-hit { fill: none; stroke: #000; stroke-opacity: 0; stroke-width: 120; pointer-events: stroke; cursor: copy; }
.map-course-edit .course-rubber { stroke: #e74a3b; stroke-width: 12; stroke-dasharray: 40 30; stroke-linecap: round; }
.map-course-edit .course-handle { fill: #fff; stroke: #e74a3b; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: all; cursor: move; }
.map-course-edit .course-handle.is-selected { fill: #e74a3b; }
.map-course-edit .link-add { stroke: #1cc88a; stroke-width: 56; stroke-linecap: round; }
.map-course-edit .link-remove { stroke: #e74a3b; stroke-width: 56; stroke-linecap: round; stroke-dasharray: 50 35; }
/* tracé de route en cours : violet (le rouge est celui des routes) */
.map-course-edit.is-road .course-preview, .map-course-edit.is-road .course-rubber { stroke: #6f42c1; }
.map-course-edit.is-road .course-handle { stroke: #6f42c1; }
.map-course-edit.is-road .course-handle.is-selected { fill: #6f42c1; }
.map-svg.mode-course.course-busy .course-hit { pointer-events: none; }     /* pendant un tracé : un clic pose un point */
.course-panel [hidden] { display: none !important; }    /* l'emporte sur .d-flex (display: flex !important) */

/* Carte : villes (point noir = petite, rouge = grosse ; nom autour du point) ; mode Villes : ajout, modification, déplacement */
.map-cities { pointer-events: none; }
.map-cities .city-hit { fill: #4e73df; fill-opacity: 0; }
.map-cities .city-dot { stroke: #fffaf0; stroke-width: 6; }
.map-cities .city-small .city-dot { fill: #111; }
.map-cities .city-large .city-dot { fill: #d1281b; stroke-width: 8; }
.map-cities .city-label {
    fill: #111;
    font-family: "DejaVu Sans", Arial, sans-serif;
    paint-order: stroke;
    stroke: #fffaf0;
    stroke-width: 16;
    stroke-linejoin: round;
    stroke-opacity: .9;
}
.map-cities .city-large .city-label { font-weight: bold; }
.map-svg.hide-cities .map-cities { display: none; }
.map-svg.mode-city .map-cities .city { pointer-events: all; cursor: move; }
.map-svg.mode-city .map-cities .city:hover .city-hit { fill-opacity: .25; }
.map-svg.mode-city .map-hexes polygon { cursor: crosshair; }
.map-svg.mode-city .map-hexes polygon:hover { fill-opacity: var(--map-tint, .45); stroke: #2b2418; stroke-opacity: .55; stroke-width: 6; }
.map-svg.mode-city.hide-grid .map-hexes polygon:hover { stroke-opacity: 0; }
/* légende et fenêtre des villes */
.legend-city { display: inline-block; width: .6rem; height: .6rem; vertical-align: middle; border-radius: 50%; background: #111; box-shadow: 0 0 0 2px #fffaf0; }
.legend-city.is-large { width: .8rem; height: .8rem; background: #d1281b; }
.city-label-picker {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: ". top ." "left dot right" ". bottom .";
    gap: .25rem;
    align-items: center;
    justify-items: center;
}
.city-label-picker .is-top { grid-area: top; }
.city-label-picker .is-bottom { grid-area: bottom; }
.city-label-picker .is-left { grid-area: left; justify-self: end; }
.city-label-picker .is-right { grid-area: right; justify-self: start; }
.city-label-picker .city-label-dot { grid-area: dot; width: .7rem; height: .7rem; border-radius: 50%; background: #5a5c69; }

/* Administration › Projets : liste des membres (cases à cocher), défilante si elle est longue */
.project-members { max-height: 16rem; overflow-y: auto; }

/* Barre du haut : choix du projet courant */
.project-switcher .custom-select { min-width: 12rem; max-width: 22rem; font-weight: 600; color: #4e73df; }
.project-switcher .custom-select:disabled { background-color: #f8f9fc; color: #4e73df; opacity: 1; }

/* Maps : vignette de l'image de fond d'une version */
.map-version-thumb { display: block; width: 6rem; height: 3.5rem; object-fit: cover; border-radius: .25rem; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
/* champ fichier Bootstrap 4 : bouton en français */
.custom-file-label::after { content: "Parcourir"; }
