/* style.css - Version "Confort & Lisibilité" */

:root {
    --primary-color: #2c3e50;      /* Bleu nuit profond */
    --secondary-color: #34495e;    /* Bleu gris */
    --accent-color: #e67e22;       /* Orange chaleureux (pièces d'échecs) */
    --accent-hover: #d35400;
    --bg-color: #f4f6f7;           /* Gris très clair, reposant pour les yeux */
    --white: #ffffff;
    --text-main: #2c3e50;
    --text-light: #546e7a;
    --success: #27ae60;
    --error: #c0392b;
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.08); /* Ombre douce et diffuse */
    --radius: 12px;                /* Arrondis plus prononcés */
}

/* --- Global & Typographie --- */
body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.8; /* Interligne augmenté pour la lisibilité */
    font-size: 18px;  /* Taille de base augmentée (défaut souvent 16px) */
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    margin-top: 0;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; color: var(--secondary-color); }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p { margin-bottom: 1.5rem; }

a { color: var(--accent-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* --- Header Simple (pour les pages internes) --- */
header {
    background: var(--primary-color);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 { color: var(--white); margin: 0; font-size: 2.2rem; }

/* --- Navigation --- */
.main-nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 25px; /* Espace plus grand entre les liens */
    align-items: center;
    flex-wrap: wrap;
}

.nav-container a {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem; /* Liens plus gros */
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-container a:hover, .nav-container a.active {
    background: #ecf0f1;
    color: var(--accent-color);
    text-decoration: none;
}

/* --- Conteneur Principal --- */
.container {
    max-width: 1000px; /* Largeur optimisée pour la lecture */
    margin: 40px auto;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

/* --- Tableaux (Classement & Tournois) --- */
table {
    width: 100%;
    border-collapse: separate; /* Pour les arrondis */
    border-spacing: 0;
    margin: 30px 0;
    font-size: 1rem; /* Taille de police confortable dans le tableau */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: var(--radius);
    overflow: hidden; /* Pour que les coins arrondis fonctionnent */
}

thead {
    background: var(--secondary-color);
    color: var(--white);
}

th, td {
    padding: 18px 20px; /* Cellules plus hautes et aérées */
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th { font-weight: 600; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.5px; }
tr:last-of-type td { border-bottom: none; }
tr:hover { background-color: #f9fbfc; } /* Survol léger pour suivre la ligne */

/* --- Formulaires (Login, Admin, Settings) --- */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 15px; /* Champ de saisie plus grand et confortable */
    font-size: 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    box-sizing: border-box; /* Important pour que le padding ne dépasse pas */
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}

/* --- Boutons --- */
.btn, button[type="submit"] {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 50px; /* Boutons très arrondis */
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(230, 126, 34, 0.2);
}

.btn:hover, button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(230, 126, 34, 0.3);
    text-decoration: none;
}

.btn:active, button[type="submit"]:active {
    transform: translateY(0);
}

/* --- Alertes & Messages --- */
.alert, .success {
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    border-left: 6px solid;
}

.alert {
    background: #fadbd8;
    color: #721c24;
    border-color: #c0392b;
}

.success {
    background: #d4efdf;
    color: #155724;
    border-color: #27ae60;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 60px;
    border-top: 1px solid #dfe6e9;
}

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    body { font-size: 16px; } /* Un peu plus petit sur mobile pour gagner de la place */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .nav-container {
        justify-content: center;
        gap: 10px;
    }
    
    th, td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    /* Empiler les tableaux sur très petits écrans si nécessaire, 
       mais ici on garde le scroll horizontal natif du navigateur */
    table { display: block; overflow-x: auto; }
}
        .guide-card { background: white; padding: 15px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
        
        /* NOUVEAU : Styles pour les badges de rôle */
        .role-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; display: inline-block; }
        .role-badge-admin { background: #f1c40f; color: #000; }
        .role-badge-invite { background: #9b59b6; color: #fff; }
        .role-badge-membre { background: #bdc3c7; color: #333; }

        /* Style pour l'accordéon des manches du tournoi */
details {
    transition: all 0.3s ease-in-out;
}

details[open] summary {
    margin-bottom: 10px;
    color: #2c3e50;
}

details summary::-webkit-details-marker {
    color: #2980b9;
}

details ul li:last-child {
    border-bottom: none;
}
.historique-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.historique-header small {
    color: #7f8c8d;
}

.historique-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    margin-top: 30px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.historique-header h3 {
    margin: 0;
}

.historique-header small {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: normal;
}

/* Version épurée et discrète du bouton PDF */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background: #fff;
    color: #b3631b; /* Orange plus discret/sombre par défaut */
    border: 1.5px solid #e2e8f0; /* Bordure grise très claire et fine */
    padding: 6px 14px;
    font-size: 0.85rem; /* Légèrement plus petit pour la discrétion */
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-pdf:hover {
    background: #e67e22; /* S'allume en orange vif au survol */
    border-color: #e67e22;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(230, 126, 34, 0.2);
}

/* Version épurée et discrète du bouton Supprimer */
.btn-annuler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background: #fff;
    color: #94a3b8; /* Gris neutre et discret par défaut, il s'efface visuellement */
    border: 1.5px solid #e2e8f0; /* Même bordure grise claire */
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-annuler:hover {
    background: var(--error); /* Devient rouge vif uniquement au survol */
    border-color: var(--error);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(192, 57, 43, 0.2);
}