@import url('../styles.css');
@import url('../styles/nav.css');
@import url('styles.css');


/* Onglets */
#filter--choices ul {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

#filter--choices li {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

#filter--choices li.active {
    border-bottom-color: var(--color-primary);
    font-weight: 600;
    color: var(--color-primary);
}

/* Formulaires */
#html--form,
#text--form {
    display: none;
}

#form input[type="text"],
#form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    box-sizing: border-box;
}

#form textarea {
    min-height: 200px;
    resize: vertical;
}

#submit--form {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#submit--form:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages d'erreur */
.error-message {
    background: #ffe6e6;
    color: #cc0000;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid #cc0000;
}

/* AFFICHAGE RESULTATS */
#results-section {
    display: none;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

/* Header des résultats */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 2rem;
    color: var(--color-4);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Méta informations */
#results-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#results-meta span {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--color-4);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

#meta-source{
    text-transform: uppercase;
}

/* Score global avec cercle de progression */
#results-global-score {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.global-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.global-score-circle .score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.global-score-circle .score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.global-score-circle .score-grade {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Scores par catégorie avec cercles */
#results-category-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-score-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-score-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    position: relative;
}

.category-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.category-circle .category-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
}

.category-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-4);
    margin-bottom: 0.5rem;
}

.category-max {
    font-size: 0.8rem;
    color: #64748b;
}

/* Couleurs de statut */
.status-excellent {
    stroke: #10b981;
}

.status-bon {
    stroke: #22c55e;
}

.status-moyen {
    stroke: #f59e0b;
}

.status-a-ameliorer {
    stroke: #ef4444;
}

.color-excellent {
    color: #10b981;
}

.color-bon {
    color: #22c55e;
}

.color-moyen {
    color: #f59e0b;
}

.color-a-ameliorer {
    color: #ef4444;
}

/* Sections des critères et recommandations */
.criteria-section,
.recommendations-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.criteria-section h3,
.recommendations-section h3 {
    font-size: 1.5rem;
    color: var(--color-4);
    margin-bottom: 0;
    font-weight: 600;
}

/* Items de critères et recommandations */
.criterion-item,
.recommendation-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 24px;
    margin-bottom: 1rem;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.criterion-item:hover,
.recommendation-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.criterion-item[data-status="excellent"],
.recommendation-item[data-status="excellent"] {
    border-left-color: #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, #f8fafc 100%);
}

.criterion-item[data-status="bon"],
.recommendation-item[data-status="bon"] {
    border-left-color: #22c55e;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.05) 0%, #f8fafc 100%);
}

.criterion-item[data-status="moyen"],
.recommendation-item[data-status="moyen"] {
    border-left-color: #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, #f8fafc 100%);
}

.criterion-item[data-status="a-ameliorer"],
.recommendation-item[data-status="a-ameliorer"] {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, #f8fafc 100%);
}

.criterion-label,
.recommendation-label {
    font-weight: 600;
    color: var(--color-4);
    display: contents;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    width: max-content;
}

.criterion-score,
.recommendation-score {
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.criterion-max,
.recommendation-max {
    color: #64748b;
    font-size: 0.9rem;
}

.criterion-detail,
.recommendation-detail {
    display: block;
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

.criterion-advice,
.recommendation-advice {
    display: block;
    padding: 0.75rem;
    background: rgba(35, 192, 197, 0.1);
    border-radius: 6px;
    color: var(--color-4);
    font-size: 0.9rem;
    border-left: 3px solid var(--color-primary);
}

h3.category--score {
    text-align: center;
    margin: 2rem 0;
    color: var(--color-4);
    font-size: 1.8rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#results-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    #results-meta {
        gap: 1rem;
    }

    #results-category-scores {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .global-score-circle {
        width: 150px;
        height: 150px;
    }

    .global-score-circle .score-value {
        font-size: 2.5rem;
    }

    .category-circle {
        width: 80px;
        height: 80px;
    }

    .criteria-section,
    .recommendations-section {
        padding: 1.5rem;
    }
}

/* === NOUVEAUX STYLES UX REFACTOR === */

/* Switcher d'onglets type pill */
#filter--choices ul {
    display: inline-flex;
    gap: 0;
    list-style: none;
    padding: 4px;
    margin: 0 0 1.25rem 0;
    background: #f1f5f9;
    border-radius: 8px;
}

#filter--choices li {
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: none;
    transition: all 0.15s;
}

#filter--choices li.active {
    background: #fff;
    color: var(--color-4);
    font-weight: 500;
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Champs de formulaire */
#form input[type="text"],
#form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 0.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    color: var(--color-4);
    transition: border-color 0.15s;
}

#form input[type="text"]:focus,
#form textarea:focus {
    border-color: #94a3b8;
}

#form textarea {
    min-height: 160px;
    resize: vertical;
}

/* Score global horizontal */
#results-global-score {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-bottom: 1.25rem;
    border-bottom: 0.5px solid #e2e8f0;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.global-score-circle {
    width: 150px;
    height: 150px;
    margin: 0 ;
    position: relative;
}

.global-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.global-score-circle .score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.global-score-circle .score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.global-score-circle .score-grade {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
}
.score-big-num {
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1;
    position: relative;
}

.score-circle-container {
    position: relative;
    display: inline-block;
}

.score-circle {
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}

.score-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-circle-text .score-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-4);
}

.score-global-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.score-global-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-4);
}

.score-global-sub {
    font-size: 1rem;
    color: #94a3b8;
}

.score-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 0.75rem;
    margin-top: 0.375rem;
}

.score-mini-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1rem;
    color: #64748b;
}

.score-mini-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Couleurs de statut (partagées) */
.status-excellent .score-mini-dot,
.score-mini-dot.status-excellent,
.acc-dot.status-excellent,
.acc-bar.status-excellent {
    background: #22c55e;
}

.status-bon .score-mini-dot,
.score-mini-dot.status-bon,
.acc-dot.status-bon,
.acc-bar.status-bon {
    background: #22c55e;
}

.score-mini-dot.status-moyen,
.acc-dot.status-moyen,
.acc-bar.status-moyen {
    background: #f59e0b;
}

.score-mini-dot.status-a-ameliorer,
.acc-dot.status-a-ameliorer,
.acc-bar.status-a-ameliorer {
    background: #ef4444;
}

.color-excellent,
.color-bon {
    color: #22c55e;
}

.color-moyen {
    color: #f59e0b;
}

.color-a-ameliorer {
    color: #ef4444;
}

/* Accordéon */
#results-criteria {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.acc-item {
    border: 0.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.acc-item.open {
    border-color: #cbd5e1;
}

.acc-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    min-height: 52px;
    cursor: pointer;
    background: #f8fafc;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.acc-item.open .acc-head {
    background: #fff;
    border-bottom: 0.5px solid #e2e8f0;
}

.acc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.acc-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: contents;
}

.acc-bar-wrap {
    width: 64px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

.acc-bar {
    height: 100%;
    border-radius: 999px;
}

.acc-score {
    font-size: 0.8125rem;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.acc-score-max {
    font-size: 0.6875rem;
    color: #94a3b8;
    font-weight: 400;
}

.acc-chevron {
    font-size: 0.625rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.acc-item.open .acc-chevron {
    transform: rotate(180deg);
}

.acc-body {
    display: none;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1rem;
    background: #fff;
}

.acc-item.open .acc-body {
    display: flex;
}

.acc-sub-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.acc-divider {
    height: 0.5px;
    background: #e2e8f0;
}

.acc-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.acc-criterion {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}


.acc-criterion-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-4);
}

.acc-criterion-detail {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    margin-top: 0.125rem;
}

.acc-criterion-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
    white-space: nowrap;
    margin-top: 0.125rem;
}

.acc-criterion-badge.status-excellent,
.acc-criterion-badge.status-bon {
    background: #dcfce7;
    color: #166534;
}

.acc-criterion-badge.status-moyen {
    background: #fef9c3;
    color: #854d0e;
}

.acc-criterion-badge.status-a-ameliorer {
    background: #fee2e2;
    color: #991b1b;
}

.acc-reco-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.acc-reco {
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
    background: #f8fafc;
}

.acc-reco[data-status="moyen"] {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.acc-reco[data-status="a-ameliorer"] {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.acc-reco[data-status="excellent"],
.acc-reco[data-status="bon"] {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.acc-reco-text {
    font-size: 0.8125rem;
    color: var(--color-4);
    line-height: 1.5;
}

.acc-reco-priority {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.acc-ok {
    font-size: 0.8125rem;
    color: #16a34a;
    padding: 0.625rem 0.875rem;
    background: #f0fdf4;
    border-radius: 8px;
}

/* Skeleton loader */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-acc {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    min-height: 52px;
    border: 0.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.skeleton {
    background: #e2e8f0;
    border-radius: 4px;
    animation: skPulse 1.4s ease-in-out infinite;
}

@keyframes skPulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.4
    }
}

.sk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sk-text {
    height: 13px;
    flex: 1;
}

.sk-bar {
    width: 64px;
    height: 3px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sk-num {
    width: 28px;
    height: 13px;
    flex-shrink: 0;
}

/* Responsive mobile */
@media (max-width: 768px) {

    #form input[type="text"],
    #form textarea {
        font-size: 1rem;
    }

    #submit--form {
        width: 100%;
        margin-top: 1rem;
        padding: 0.75rem;
    }

    #results-global-score {
        flex-wrap: wrap;
    }

    .score-big-num {
        font-size: 2rem;
    }

    .score-mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .acc-bar-wrap {
        width: 44px;
    }
}