/* ==========================================
   1. VARIABLES & REINITIALISATION
   ========================================== */
:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e1e8ed;
    --highlight-bg: #fff9db; /* Jaune doux pour les notes/remarques */
    --highlight-text: #856404;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ==========================================
   2. CONTENEURS & TYPOGRAPHIE
   ========================================== */
.container {
    max-width: 850px; /* S'adapte aussi bien à l'index qu'aux tableaux */
    width: 100%;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

h1 {
    font-size: 2.2rem;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    text-align: center;
}

.intro-text {
    font-size: 1.15rem;
    margin-bottom: 20px;
}

/* Fil d'Ariane / Breadcrumb (Pages secondaires) */
.breadcrumb {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    font-weight: bold;
    color: var(--text-color);
}

/* ==========================================
   3. NAVIGATION ET BOUTONS
   ========================================== */
/* Menu principal de cartes (index.html) */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.nav-card {
    display: inline-block;
    padding: 14px 24px;
    background-color: #f0f4f8;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}

.nav-card:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
    text-decoration: none;
}

/* Bouton Contact (magmuu3a.html) */
.btn-contact {
    display: inline-block;
    padding: 6px 16px;
    background-color: #eef5fc;
    color: var(--primary-color);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 25px;
    transition: all 0.2s;
}

.btn-contact:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ==========================================
   4. TABLEAU MODERNE & RESPONSIVE
   ========================================== */
.table-container {
    /* overflow-x: visible au lieu de auto pour débloquer le sticky header */
    overflow-x: visible; 
    margin-bottom: 25px;
}

.data-table {
    width: 100%;
    border-collapse: separate; /* IMPORTANT : 'separate' au lieu de 'collapse' pour que le sticky fonctionne sur <th> sur tous les navigateurs */
    border-spacing: 0;
    margin-top: 10px;
    text-align: right;
}

/* Fixation de l'en-tête avec gestion des écrans de smartphones */
.data-table th {
    position: -webkit-sticky;
    position: sticky;
    
    /* Repère le haut de l'écran tout en respectant l'encoche / la barre système du smartphone */
    top: 0px; 
    top: env(safe-area-inset-top, 0px); 
    
    z-index: 10;
    background-color: #f1f5f9;
    font-weight: bold;
    color: #1a1a1a;
    font-size: 1rem;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* Style des remarques */
.note-highlight {
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
}

/* ==========================================
   5. FOOTER & LIENS DE RETOUR
   ========================================== */
.home-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.home-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.home-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.back-to-top {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.back-to-top a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-top a:hover {
    color: var(--primary-color);
}