/* =========================================================
   PAGE COMPÉTENCES — VERSION FINALE
   La sidebar et la navigation restent gérées par style.css.
========================================================= */

:root {
    --skills-blue: #3b82f6;
    --skills-green: #22c55e;
    --skills-orange: #f97316;
    --skills-teal: #14b8a6;

    --skills-text: #10233f;
    --skills-muted: #708097;
    --skills-surface: rgba(255, 255, 255, 0.96);
    --skills-border: #e5eaf2;
    --skills-shadow: 0 10px 28px rgba(18, 39, 70, 0.08);

    --footer-height: 34px;
}

.page,
.page * {
    box-sizing: border-box;
}

.page input,
.page select,
.page button {
    font: inherit;
}

/* =========================================================
   CONTENEUR PRINCIPAL
========================================================= */

.page {
    height: calc(92dvh - var(--footer-height));
    min-height: 0;

    padding: 10px 18px 6px;

    display: grid;
    grid-template-rows:
        auto
        auto
        minmax(0, 1fr);

    gap: 8px;

    overflow: hidden;
    color: var(--skills-text);
}

/* =========================================================
   EN-TÊTE
========================================================= */

.skills-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.skills-header h1 {
    margin: 0;

    text-align: center;

    font-size: clamp(1.8rem, 2.8vw, 2.9rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.04em;

    /* Couleur principale */
    color: #102a5c;

    /* Contour léger */
    -webkit-text-stroke: 3px rgba(23, 176, 214, 0.35);

    /* Relief / halo */
    text-shadow:
        0 1px 0 rgba(255,255,255,.15),
        0 0 6px rgba(59,130,246,.15),
        0 0 12px rgba(59,130,246,.08);
}


/* =========================================================
   CARTES DE SYNTHÈSE
========================================================= */

.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;

    margin: 0;
    padding: 12px;

    background:
        linear-gradient(
            145deg,
            #102b45,
            #0c1424 65%,
            #12142e
        );

    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;

    box-shadow:
        0 14px 34px rgba(15, 23, 42, 0.16);
}

.metric {
    --metric-accent: var(--skills-blue);

    position: relative;
    min-width: 0;
    min-height: 86px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 12px 14px;

    color: #f8fafc;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.055),
            rgba(255, 255, 255, 0.025)
        );

    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 15px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    overflow: hidden;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.metric::before {
    content: "";

    position: absolute;
    top: -48px;
    right: -38px;

    width: 120px;
    height: 120px;

    background:
        radial-gradient(
            circle,
            color-mix(
                in srgb,
                var(--metric-accent) 24%,
                transparent
            ),
            transparent 68%
        );

    pointer-events: none;
}

.metric::after {
    content: "";

    position: absolute;
    top: 0;
    left: 14px;
    right: 14px;

    height: 3px;

    background: var(--metric-accent);
    border-radius: 0 0 999px 999px;

    opacity: 0.92;
}

.metric:hover {
    transform: translateY(-2px);

    border-color:
        color-mix(
            in srgb,
            var(--metric-accent) 48%,
            transparent
        );

    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.metric .label,
.metric .value,
.metric .sub {
    position: relative;
    z-index: 1;
}

.metric .label {
    color: #cbd5e1;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric .value {
    margin-top: 5px;

    color: var(--metric-accent);

    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.04em;
}

.metric .sub {
    margin-top: 5px;

    color: #94a3b8;

    font-size: 0.62rem;
    line-height: 1.2;
}

.metric--average {
    --metric-accent: var(--skills-blue);
}

.metric--strong {
    --metric-accent: var(--skills-green);
}

.metric--growth {
    --metric-accent: var(--skills-orange);
}

.metric--filled {
    --metric-accent: var(--skills-teal);
}

/* =========================================================
   SÉLECTEUR MOBILE
========================================================= */

.skills-view-switch {
    display: none;
}

/* =========================================================
   CONTENU PRINCIPAL
========================================================= */

.layout {
    min-width: 0;
    min-height: 0;

    display: grid;
    grid-template-columns:
        minmax(340px, 0.9fr)
        minmax(500px, 1.4fr);

    gap: 10px;

    overflow: hidden;
}

.card {
    min-width: 0;
    min-height: 0;

    background: var(--skills-surface);
    border: 1px solid var(--skills-border);
    border-radius: 17px;

    box-shadow: var(--skills-shadow);

    overflow: hidden;
}

.chart-card {
    display: grid;
    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
}

.skills-card {
    display: grid;
    grid-template-rows:
        auto
        auto
        minmax(0, 1fr);
}

/* =========================================================
   EN-TÊTES DES CARTES
========================================================= */

.card-head {
    padding: 10px 14px 0;
}

.card-head h2 {
    margin: 0;

    color: var(--skills-text);

    font-size: 0.92rem;
    line-height: 1.2;
}

.hint {
    margin: 4px 0 0;

    color: var(--skills-muted);

    font-size: 0.68rem;
    line-height: 1.3;
}

/* =========================================================
   RADAR
========================================================= */

.radar-wrap {
    min-width: 0;
    min-height: 0;

    display: grid;
    place-items: center;

    padding: 2px 14px 0;

    overflow: visible;
}

#radar {
    display: block;

    max-width: 100%;
    max-height: 100%;
}

/* =========================================================
   LÉGENDE
========================================================= */

.legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;

    padding: 2px 14px 8px;
}

.legend-item {
    min-width: 0;

    display: grid;
    grid-template-columns:
        9px
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 7px;

    font-size: 0.64rem;
}

.legend-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;
}

.legend-name {
    min-width: 0;

    color: #52647d;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-value {
    color: var(--skills-text);

    font-weight: 750;
    white-space: nowrap;
}

/* =========================================================
   FILTRES
========================================================= */

.controls {
    display: grid;
    grid-template-columns:
        minmax(170px, 1.25fr)
        minmax(130px, 0.75fr)
        minmax(120px, 0.65fr);

    gap: 7px;

    padding: 7px 10px;
}

.controls input,
.controls select {
    width: 100%;
    min-width: 0;
    height: 32px;

    padding: 0 10px;

    color: #43536a;
    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 8px;

    outline: none;

    font-size: 0.72rem;
}

.controls input:focus,
.controls select:focus {
    border-color: var(--skills-blue);

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.11);
}

/* =========================================================
   LISTE DES COMPÉTENCES
========================================================= */

.skills {
    min-width: 0;
    min-height: 0;

    padding: 0 9px 8px 12px;

    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

.skill {
    --skill-color: var(--skills-blue);
    --skill-soft: rgba(59, 130, 246, 0.09);

    min-width: 0;

    display: grid;
    grid-template-columns:
        minmax(230px, 1.4fr)
        minmax(110px, 0.78fr)
        36px;

    gap: 10px;
    align-items: center;

    padding: 5px 4px;

    border-bottom: 1px solid #edf1f6;
}

.skill:last-child {
    border-bottom: 0;
}

.skill-name {
    min-width: 0;

    color: #12305a;

    font-size: 0.72rem;
    font-weight: 780;
    line-height: 1.16;
}

.category-tag {
    display: block;

    margin-top: 2px;

    color: #91a0b2;

    font-size: 0.57rem;
    font-weight: 600;
}

.bar {
    height: 6px;

    background: #e8edf4;
    border-radius: 999px;

    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;

    background: var(--skill-color);
    border-radius: inherit;
}

.score {
    width: 30px;
    height: 25px;

    display: grid;
    place-items: center;

    color: var(--skill-color);
    background: var(--skill-soft);

    border-radius: 8px;

    font-size: 0.68rem;
    font-weight: 850;
}

.empty {
    padding: 30px 18px;

    color: var(--skills-muted);

    text-align: center;
}


/* =========================================================
   ÉCRANS PEU HAUTS
========================================================= */

@media (min-width: 901px) and (max-height: 720px) {
    :root {
        --footer-height: 30px;
    }

    .page {
        padding-top: 6px;
        padding-bottom: 4px;

        gap: 6px;
    }

    .skills-header h1 {
        font-size: 1.4rem;
    }

    .summary {
        padding: 8px;
        gap: 7px;
    }

    .metric {
        min-height: 70px;
        padding: 8px 10px;
    }

    .metric .label {
        font-size: 0.65rem;
    }

    .metric .value {
        margin-top: 3px;

        font-size: 1.15rem;
    }

    .metric .sub {
        display: none;
    }

    .card-head {
        padding-top: 7px;
    }

    .hint {
        display: none;
    }

    .controls {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .controls input,
    .controls select {
        height: 29px;
    }

    .skill {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .legend {
        padding-bottom: 5px;
    }
}

/* =========================================================
   TABLETTE / MOBILE
========================================================= */

@media (max-width: 900px) {
    :root {
        --footer-height: 30px;
    }

    .page {
        height: calc(100dvh - var(--footer-height));

        padding:
            64px
            9px
            8px;

        grid-template-rows:
            auto
            auto
            auto
            minmax(0, 1fr);

        gap: 8px;
    }

    .skills-header {
        padding-left: 44px;
    }

    .skills-header h1 {
        font-size: clamp(1.3rem, 5.8vw, 1.85rem);
    }

    .summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
        padding: 8px;

        border-radius: 15px;
    }

    .metric {
        min-height: 72px;

        padding: 8px 10px;

        border-radius: 12px;
    }

    .metric .label {
        font-size: 0.63rem;
    }

    .metric .value {
        margin-top: 3px;

        font-size: 1.15rem;
    }

    .metric .sub {
        margin-top: 3px;

        font-size: 0.55rem;
    }

    .skills-view-switch {
        display: grid;
        grid-template-columns:
            1fr
            1fr;

        gap: 4px;

        padding: 4px;

        background: #e7edf7;
        border: 1px solid #d9e2ef;
        border-radius: 11px;

        box-shadow:
            0 5px 16px rgba(18, 39, 70, 0.08);
    }

    .skills-view-switch button {
        min-height: 38px;

        padding: 8px 10px;

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 7px;

        color: #52647d;
        background: #ffffff;

        border: 1px solid transparent;
        border-radius: 8px;

        font-size: 0.76rem;
        font-weight: 800;

        cursor: pointer;
    }

    .skills-view-switch button span {
        font-size: 0.95rem;
    }

    .skills-view-switch button.is-active {
        color: #ffffff;

        background:
            linear-gradient(
                135deg,
                #1f6feb,
                #2f7df4
            );

        border-color: #1f6feb;

        box-shadow:
            0 5px 13px rgba(31, 111, 235, 0.28);
    }

    .layout {
        display: block;

        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .card {
        width: 100%;
        height: 100%;

        border-radius: 14px;
    }

    .chart-card,
    .skills-card {
        display: none;
    }

    .layout[data-mobile-view="chart"] .chart-card {
        display: grid;
    }

    .layout[data-mobile-view="skills"] .skills-card {
        display: grid;
    }

    .chart-card {
        grid-template-rows:
            auto
            minmax(0, 1fr)
            auto;
    }

    .skills-card {
        grid-template-rows:
            auto
            auto
            minmax(0, 1fr);
    }

    .card-head {
        padding: 9px 11px 0;
    }

    .card-head h2 {
        font-size: 0.86rem;
    }

    .hint {
        font-size: 0.61rem;
    }

    .radar-wrap {
        padding: 4px 14px 0;
    }

    .legend {
        grid-template-columns: 1fr;

        gap: 4px;

        padding: 4px 12px 9px;
    }

    .controls {
        grid-template-columns: 1fr;

        gap: 5px;

        padding: 7px 8px;
    }

    .controls input,
    .controls select {
        height: 32px;

        font-size: 0.7rem;
    }

    .skills {
        padding: 0 7px 7px 9px;
    }

    .skill {
        grid-template-columns:
            minmax(0, 1fr)
            32px;

        gap: 6px;

        padding: 7px 3px;
    }

    .skill .bar {
        grid-column: 1 / -1;
    }

    .skill-name {
        font-size: 0.7rem;
    }

    .score {
        width: 29px;
        height: 25px;
    }
}

@media (max-width: 430px) {
    .page {
        padding-left: 7px;
        padding-right: 7px;
    }

    .skills-header {
        padding-left: 40px;
    }

    .summary {
        gap: 6px;
        padding: 7px;
    }

    .metric {
        padding: 7px 8px;
    }

    .metric .value {
        font-size: 1.05rem;
    }
}

/* =========================================================
   IMPRESSION
========================================================= */

@media print {
    .page {
        height: auto;

        display: block;

        overflow: visible;
    }

    .skills-view-switch,
    .controls {
        display: none !important;
    }

    .layout {
        display: block;

        height: auto;
    }

    .chart-card,
    .skills-card {
        display: grid !important;

        height: auto;
        margin-bottom: 16px;
    }

    .skills {
        max-height: none;

        overflow: visible;
    }
}