/* Results page styles */

/* ── Menu de navigation ancres ── */
#page-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 2px solid #e8edf2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#page-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

#page-nav li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

#page-nav li a:hover {
    color: #0173B2;
    border-bottom-color: #0173B2;
}

#page-nav li a.active {
    color: #0173B2;
    border-bottom-color: #0173B2;
}

/* scroll-margin pour compenser le menu sticky */
h2[id], h3[id] {
    scroll-margin-top: 56px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.main-wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 32px 24px;
    margin-bottom: 40px;
}

/* Skip links for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #0173B2;
    color: #ffffff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation styles */
nav a {
    color: #0173B2;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

nav a:hover, nav a:focus {
    background-color: rgba(1, 115, 178, 0.1);
    text-decoration: underline;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    border-bottom: 3px solid #0173B2;
    padding-bottom: 12px;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 32px;
    margin-bottom: 16px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.chart-container {
    background: #f5f5f5;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
    position: relative;
    height: 400px;
}

.chart-container canvas {
    max-height: 350px;
}

.chart-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.table-container {
    overflow-x: auto;
    margin-top: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th {
    background: #0173B2;
    color: #ffffff;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #0173B2;
}

td {
    padding: 16px;
    border-bottom: 1px solid #e8e8e8;
}

tr:hover {
    background: #f5f5f5;
}

tr:last-child td {
    border-bottom: none;
}

.score-badge {
    display: inline-block;
    background: #0173B2;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.score-good {
    background: #0173B2;
}

.score-fair {
    background: #6b7280;
}

.score-low {
    background: #9ca3af;
}

.list-name {
    font-weight: 600;
    color: #0173B2;
}

.contact-info {
    font-size: 0.9rem;
    color: #666666;
}

a {
    color: #0173B2;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #DE8F05;
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #0173B2;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0173B2;
    margin-bottom: 8px;
}

.stat-label {
    color: #666666;
    font-size: 0.9rem;
}

.ranking {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.ranking-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0173B2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.legend {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Responsive tablet */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 350px;
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    h2 {
        font-size: 1.6rem;
    }

    .main-wrapper {
        padding: 16px;
    }

    .container {
        padding: 0 12px 24px;
    }

    .table-container {
        font-size: 0.9rem;
    }

    th, td {
        padding: 12px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-container {
        height: 300px;
    }
}

/* Details section styles */
.liste-details {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.liste-details h3 {
    background: #f8f9fa;
    padding: 16px;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.liste-details h3:hover {
    background: #e9ecef;
}

.toggle-icon {
    float: right;
    font-size: 1.2em;
    transition: transform 0.2s;
}

.details-content {
    padding: 0;
}

.details-content h4 {
    color: #0173B2;
    margin: 16px 16px 8px 16px;
    font-size: 1.2rem;
    font-weight: 600;
}

.details-content p {
    margin: 0 16px 16px 16px;
    line-height: 1.5;
    font-size: 1rem;
}

/* Harmonisation des éléments dans les sections de détails */
.details-content div[style*="margin-left: 16px"] {
    font-size: 1rem;
    line-height: 1.5;
}

.details-content strong {
    font-weight: 600;
    color: #0173B2;
}

.details-content a {
    color: #0173B2;
    text-decoration: none;
}

.details-content a:hover {
    text-decoration: underline;
}
