/* ===================================================================
// ==    FEUILLE DE STYLE : style.css                             ==
// ===================================================================
// "Beautiful is better than ugly." */

/* --- Variables et Style Global --- */
:root {
    --primary-color: #047481;
    --primary-color-hover: #035d68;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
    --container-bg: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Conteneurs principaux --- */
header, main, footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    height: 50px;
}

h1, h2 {
    color: var(--text-color);
}

main > div {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9em;
    color: #6c757d;
}

/* --- Éléments de formulaire et boutons --- */
input[type="email"], input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-color-hover);
}

#logout-button {
    background-color: #dc3545;
}

#download-zip-button {
    background-color: #28a745;
}

/* --- Notifications et utilitaires --- */
.hidden {
    display: none !important;
}

/* --- Popup accès non autorisé --- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.overlay-card {
    background: var(--container-bg);
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

.overlay-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.overlay-card h2 {
    margin: 0 0 0.5rem;
    font-weight: 800;
}

.overlay-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.overlay-card a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.overlay-card #back-to-portal {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    background: #0f172a;
}

.overlay-card #back-to-portal:hover {
    background: #1e293b;
}

#error-notification, #xml-error-notification {
    color: #dc3545;
    margin-top: 1rem;
}

/* --- Style de la table des résultats --- */
#results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#results-table th, #results-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

#results-table th {
    background-color: #f2f2f2;
    position: relative;
}

/* NOUVEAU : Styles pour le tri */
#results-table th[data-column] {
    cursor: pointer;
    user-select: none;
}

#results-table th[data-column]::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    margin-left: 10px;
    opacity: 0.3;
}

#results-table th.sort-asc::after {
    border-bottom: 5px solid var(--text-color);
    opacity: 1;
}

#results-table th.sort-desc::after {
    border-top: 5px solid var(--text-color);
    opacity: 1;
}

#total-sum {
    font-size: 1.1em;
    font-weight: bold;
    text-align: right;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}