/* ========================================== */
/* PALETTE DE COULEURS ET VARIABLES GLOBALES  */
/* ========================================== */

/* Thème Clair */
:root {
    --color-primary: #3521a6;      /* Bleu violet (principal) */
    --color-secondary: #00A99D;     /* Sarcelle pour les actions positives */
    --color-accent: #b4aaef;        /* Violet clair (accent) */
    --color-accent-hover: #3521a6;   /* Survol */

    --bg-color: #F8F9FA;            /* Fond du site (gris très clair) */
    --card-bg-color: #FFFFFF;       /* Fond des cartes (blanc) */
    --subtle-bg-color: #F1F3F5;     /* Fond subtil (en-têtes, etc.) */

    --text-color: #212529;          /* Texte (quasi-noir) */
    --text-muted-color: #6C757D;    /* Texte secondaire (gris) */
    --border-color: #DEE2E6;        /* Bordures */

    --font-title: 'Barlow Condensed', sans-serif;
    --font-text: 'Montserrat', sans-serif;
}

/* Thème Sombre */
body.dark-mode {
    --color-primary: #8A78F3;       /* Violet clair pour le mode sombre */
    --color-secondary: #26C6DA;     /* Sarcelle clair */
    --color-accent: #b4aaef;        /* Violet clair (accent) */
    --color-accent-hover: #988ee7;   /* Survol */
    
    --bg-color: #121212;            /* Fond (noir subtil) */
    --card-bg-color: #1E1E1E;       /* Fond des cartes (gris sombre) */
    --subtle-bg-color: #2c2c2e;     /* Fond subtil */
    
    --text-color: #EAEAEA;          /* Texte (blanc cassé) */
    --text-muted-color: #A0AEC0;    /* Texte secondaire */
    
    --border-color: #424242;        /* Bordures */
}

/* ========================================== */
/* MISE EN PAGE PRINCIPALE "APP-STYLE"        */
/* ========================================== */

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-text);
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-layout {
    --sidebar-width: 260px; /* Largeur de la sidebar étendue */
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    transition: grid-template-columns 0.3s ease-in-out;
}

.main-content {
    padding: 2rem 3rem;
    overflow-y: auto; /* Permet de scroller le contenu si il est trop long */
}

/* ========================================== */
/* SIDEBAR (MENU LATÉRAL)                     */
/* ========================================== */

.sidebar {
    background-color: var(--card-bg-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: width 0.3s ease-in-out; /* Note: la largeur n'est plus utilisée, mais la transition reste pour d'autres propriétés */
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    width: 80%;
    max-width: 150px;
    display: block;
    margin: 0 auto;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.main-menu {
    list-style: none;
    padding: 1rem;
    margin: 0;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    color: var(--text-muted-color);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.menu-item a i {
    font-size: 1.2rem;
}

.menu-item:hover a {
    color: var(--text-color);
    background-color: var(--subtle-bg-color);
}

.menu-item.active a {
    background-color: var(--color-primary);
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.sidebar .menu-text {
    transition: opacity 0.2s ease-in-out;
}

/* --- État de la sidebar réduite --- */
.app-layout.sidebar-collapsed {
    --sidebar-width: 80px; /* Largeur réduite */
}

.app-layout.sidebar-collapsed .sidebar .menu-text,
.app-layout.sidebar-collapsed .sidebar .app-logo {
    opacity: 0;
    visibility: hidden;
}

.app-layout.sidebar-collapsed #sidebar-toggle .fa-solid {
    transform: rotate(180deg);
}


/* ========================================== */
/* STYLES GÉNÉRAUX DES COMPOSANTS             */
/* ========================================== */

.card { 
    background-color: var(--card-bg-color); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 25px; 
}

h1, h2 { 
    font-family: var(--font-title); 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
}

h2 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--subtle-bg-color);
    padding-bottom: 10px;
    margin-top: 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-family: var(--font-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--color-primary);
}
.btn-primary:hover {
    background-color: var(--color-accent);
}

/* ========================================== */
/* STYLES SPÉCIFIQUES AUX PAGES               */
/* ========================================== */

/* --- Conteneur général du dashboard (index, equipe, classement_joueuses) --- */
.dashboard-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.full-width-card {
    grid-column: 1 / -1;
}

/* --- Prochains Matchs (index.html) --- */
#matchs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; 
}
.match-block {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.match-details {
    padding: 0.75rem 1rem;
    background-color: var(--subtle-bg-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted-color);
}
.match-details .match-day {
    font-weight: bold;
    color: var(--text-color);
}
.match-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}
.team-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}
.team-logo-small {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}
.vs-separator {
    font-weight: bold;
    color: var(--text-muted-color);
}

/* --- Tableaux (classement.html, etc.) --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.ranking table, .ranking-details table, .ranking-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}
.ranking th, .ranking td, .ranking-details th, .ranking-details td, .ranking-table th, .ranking-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.ranking-details table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.ranking-details th, .ranking-details td { text-align: center; }
.ranking-details th:not(:last-child), .ranking-details td:not(:last-child) { border-right: 1px solid var(--border-color); }
.ranking-details tbody tr:last-child td { border-bottom: none; }
.ranking-details tbody td:nth-child(2) { text-align: left; font-weight: 600; }
.ranking-details tbody tr:hover { background-color: var(--subtle-bg-color); }

/* --- Page Équipes (equipes.html) --- */
#teams-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}
.team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--subtle-bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}
.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}
.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* --- Dashboard Équipe (equipe.html) --- */
.team-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--card-bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.team-header h1 { margin: 0; color: var(--color-primary); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; }
.kpi-item .kpi-value { font-family: var(--font-title); font-size: 2.2rem; color: var(--color-primary); display: block; }
.kpi-item .kpi-label { font-size: 0.8rem; color: var(--text-muted-color); text-transform: uppercase; }
.form-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); text-align: center; }
.form-indicators { display: flex; gap: 4px; justify-content: center; }
.form-indicator { width: 20px; height: 20px; border-radius: 4px; }
.form-win { background-color: #28a745; }
.form-loss { background-color: #dc3545; }
.form-draw { background-color: #6c757d; }
.form-unknown { background-color: #e0e0e0; }
.chart-container { position: relative; height: 300px; width: 100%; max-width: 350px; margin: 0 auto; }
.list-card ul { list-style: none; padding: 0; margin: 0; }
.list-card li { display: flex; justify-content: space-between; padding: 0.8rem 0; border-bottom: 1px solid var(--border-color); }
.list-card li:last-child { border-bottom: none; }
.result-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }

/* Mise à jour de la grille pour plus de colonnes */
.players-list-grid { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr 0.8fr 0.6fr 0.6fr; 
    gap: 8px; 
    align-items: center; 
    padding: 8px 0; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.statut-select {
    font-size: 0.8rem;
    padding: 3px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
}

.min-input {
    width: 35px;
    padding: 3px;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.btn-event {
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: 0.2s;
}

.btn-yellow { background: #ffd700; color: #000; }
.btn-red { background: #ff4136; color: #fff; }
.btn-goal { background: #eee; border: 1px solid #ccc; }