﻿@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700;800&family=Barlow+Condensed:wght@600;700;800&display=swap');

/* *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --dark:#0d1a33;
  --dark2:#07101f;
  --pane:#e4eaf5;
  --orange:#fe8800;
  --green:#009B5A;
  --conn:#4a7aaa;
  --card-w:150px;
  --card-h:200px;
  --card-min-w:170px;
  --card-min-h:220px;
} */

/* html,body{height:100%;background:var(--dark);font-family:'Barlow',sans-serif;overflow:auto} */

/* ── HEADER ── */
/* #header{
  background:linear-gradient(180deg,var(--dark2) 0%,#162040 100%);
  padding:18px 40px 0;
  position:relative;
  z-index:10;
  box-shadow:0 4px 20px rgba(0,0,0,.5);
}
#header h1{
  font-family:'Barlow Condensed',sans-serif;
  font-size:clamp(18px,2.4vw,34px);
  font-weight:800;
  color:var(--orange);
  letter-spacing:2px;
  text-transform:uppercase;
  text-align:center;
}
#header p{
  font-size:clamp(9px,.9vw,13px);
  color:#8aabcc;
  text-align:center;
  margin-top:5px;
}
.tricolor{display:flex;height:5px;margin-top:14px}
.tricolor span{flex:1}
.tricolor span:nth-child(1){background:var(--orange)}
.tricolor span:nth-child(2){background:#fff}
.tricolor span:nth-child(3){background:var(--green)} */

/* ── TOOLBAR ── */
#toolbar {
    background: #f8f9fa;
    border-bottom: 2px solid #fe8800;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    position: relative;
}

#search-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 14px;
    color: #333;
    font-size: 12px;
    width: 220px;
    font-family: 'Barlow',sans-serif;
    outline: none;
    transition: border-color .2s;
}

    #search-box:focus {
        border-color: #fe8800;
        box-shadow: 0 0 8px rgba(254,136,0,0.3)
    }

    #search-box::placeholder {
        color: #999
    }

.filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 4px 12px;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: all .2s;
    font-family: 'Barlow',sans-serif;
}

    .filter-btn:hover, .filter-btn.active {
        background: #fe8800;
        border-color: #fe8800;
        color: #000;
        font-weight: 600
    }

#zoom-controls {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center
}

.zoom-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

    .zoom-btn:hover {
        background: #fe8800;
        color: #000;
        border-color: #fe8800;
        font-weight: 600
    }

#zoom-label {
    color: #666;
    font-size: 11px;
    min-width: 38px;
    text-align: center
}

#export-btn {
    background: linear-gradient(135deg,#fe8800,#ff9900);
    border: 1px solid #ffaa00;
    border-radius: 14px;
    padding: 4px 14px;
    color: #000;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Barlow',sans-serif;
    transition: all .2s;
}

    #export-btn:hover {
        background: linear-gradient(135deg,#ffaa00,#ffbb33);
        color: #000;
        font-weight: 600
    }

#result-count {
    color: #999;
    font-size: 11px;
    white-space: nowrap
}

/* ── CANVAS WRAPPER ── */
#canvas-wrapper {
    position: relative;
    overflow: auto;
    flex: 1;
    cursor: grab;
    background: var(--pane);
}

    #canvas-wrapper.grabbing {
        cursor: grabbing
    }

#chart-container {
    position: absolute;
    transform-origin: 0 0;
    user-select: none;
}

    #chart-container.auto-fit {
        transition: transform 0.35s ease;
    }

/* ── SVG CONNECTIONS ── */
#svg-connections {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

/* ── SECTION LABELS ── */
.sect-label {
    position: absolute;
    z-index: 2;
    color: #fff;
    font-family: 'Barlow Condensed',sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .8px;
    padding: 6px 22px;
    border-radius: 6px;
    text-transform: uppercase;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

/* ── CARDS ── */
.card {
    position: absolute;
    z-index: 1;
    background: #edf1f8;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
    cursor: pointer;
    transition: transform .18s,box-shadow .18s,opacity .25s;
    border: 1px solid rgba(200,210,228,.6);
    display: flex;
    flex-direction: column;
}

    .card:hover {
        transform: translateY(-6px) scale(1.05);
        box-shadow: 0 12px 32px rgba(0,0,0,.32);
        z-index: 100;
    }

    .card.ministre {
        background: #f0f4fb;
        border: 2px solid rgba(247,127,0,.4);
    }

    .card.institution {
        background: #e5ecf5
    }

    .card.dimmed {
        opacity: .2;
        pointer-events: none
    }

    .card.highlighted {
        box-shadow: 0 0 0 3px var(--orange),0 8px 24px rgba(247,127,0,.3) !important;
        transform: translateY(-3px)
    }

.c-bar {
    height: 6px;
    width: 100%
}

.c-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    border: 3px solid var(--sc);
    margin: -60px auto 0
}

.c-initials {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: #c8d4e8;
    border-radius: 50%;
    border: 3px solid var(--sc);
    margin: -60px auto 0;
}

.card.ministre .c-initials {
    font-size: 46px;
    width: 140px;
    height: 140px
}

.c-initials:not(.card.ministre .c-initials) {
    font-size: 36px;
    height: 120px
}

.c-inst-block {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--sc);
    margin: -60px auto 0
}

.c-inst-sigle {
    font-family: 'Barlow Condensed',sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
    text-align: center;
    padding: 8px;
    line-height: 1.2;
}

.c-badge {
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: .3px;
    text-align: center;
    margin: 5px auto auto;
    width: fit-content;
}

.c-sep {
    height: 1px;
    background: #cdd5e4;
    margin: 4px 10px;
    display: none
}

.c-name {
    font-size: 11px;
    font-weight: 700;
    color: #1a2a40;
    text-align: center;
    padding: 0 6px 2px;
    min-height: 20px;
    line-height: 1.25;
}

.card.ministre .c-name {
    font-size: 12px
}

.c-title {
    font-size: 10px;
    color: #5a6a80;
    text-align: center;
    padding: 0 5px 6px;
    line-height: 1.35;
}

.card.ministre .c-title {
    font-size: 11px
}

.vacant {
    color: #aaa;
    font-style: italic
}

/* ── MODAL ── */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,16,31,.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

    #modal-overlay.open {
        display: flex
    }

#modal {
    background: linear-gradient(160deg,#0f1e38,#162040);
    border: 1px solid #2a4570;
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
    position: relative;
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        transform: scale(.92);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

#modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #5a7090;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color .15s;
}

    #modal-close:hover {
        color: #fff
    }

#modal-photo-wrap {
    width: 220px;
    height: 220px;
    border-radius: 18px;
    overflow: hidden;
    margin: 0 auto 24px;
    border: 4px solid var(--modal-color,#4a7aaa);
}

    #modal-photo-wrap img, #modal-initials-block, #modal-inst-block {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: flex;
        align-items: center;
        justify-content: center;
    }

#modal-initials-block {
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    background: #c8d4e8
}

#modal-inst-block {
    font-family: 'Barlow Condensed',sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    text-align: center;
    padding: 8px;
    line-height: 1.2
}

#modal-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

#modal-nom {
    font-family: 'Barlow Condensed',sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #e8f0fa;
    margin-bottom: 6px;
    text-align: center
}

#modal-titre {
    font-size: 13px;
    color: #8aabcc;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 14px
}

#modal-groupe {
    font-size: 11px;
    color: #4a6a8a;
    text-align: center;
    letter-spacing: .3px
}

.modal-divider {
    height: 1px;
    background: #1e3055;
    margin: 14px 0
}

#modal-hierarchy {
    font-size: 11px;
    color: #6a8aaa;
    line-height: 1.8
}

/* ── FOOTER ── */
/* #footer{
  background:#0d1422;color:#4a6070;
  font-size:10px;text-align:center;padding:8px 20px;
  border-top:1px solid #141e30;
} */

/* ── LOADING ── */
#loading {
    position: fixed;
    inset: 0;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .4s;
}

    #loading.fade {
        opacity: 0;
        pointer-events: none
    }

.loader-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid #1a2d4a;
    border-top-color: var(--orange);
    animation: spin .9s linear infinite;
    margin-bottom: 18px;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

#loading p {
    color: #4a6a8a;
    font-size: 13px
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh
}

#canvas-wrapper {
    flex: 1;
    min-height: 0
}
