@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    /* --- PALETTE DE COULEURS DARK --- */
    --bg-color: #0F172A;        /* Fond de page (Deep Blue) */
    --card-bg: #1E293B;         /* Fond des blocs (Slate) */
    --text-color: #cbd5e1;      /* Texte gris clair (plus doux que blanc pur) */
    --title-color: #ffffff;     /* Titres en blanc pur */
    
    --primary-color: #f08200;   /* Orange Important */
    --primary-hover: #d97706;   /* Orange un peu plus sombre au survol */
    --fc-page-bg-color:#0F172A;
    --border-color: #334155;    /* Bordures gris-bleu discrètes */
    --input-bg: #0F172A;        /* Fond des inputs (idem body pour effet creusé) */
    
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Liens */
a { color: var(--primary-color); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--title-color); }

/* Conteneur Principal */
.main-wrapper, .admin-container {
    width: 100%;
    max-width: 1100px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5); /* Ombre plus forte en dark */
    overflow: hidden;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

/* En-tête */
h1, h2, h3 {
    color: var(--title-color);
    margin-top: 0;
}

/* Formulaire */
.booking-form {
    background: rgba(15, 23, 42, 0.5); /* Un peu plus sombre que la carte */
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    border: 1px solid var(--border-color);
}

.input-group { display: flex; flex-direction: column; flex: 1; }
.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #94a3b8; /* Gris moyen pour les labels */
}

/* Inputs & Selects en Dark Mode */
input, select {
    background-color: var(--input-bg);
    color: var(--title-color);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(240, 130, 0, 0.2); /* Halo Orange */
}

/* Boutons */
button, .btn-submit {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 1rem;
}

button:hover, .btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}
.fc-theme-standard .fc-scrollgrid{
    border-color: rgba(255,255,255,0.1);
}
a.fc-event{
    background-color: rggba(255,255,255,0.1);
    cursor: pointer;
}
/* Alertes */
.alert { padding: 12px; border-radius: 8px; margin-bottom: 20px; text-align: center; }
.alert.success { background: rgba(22, 101, 52, 0.2); color: #4ade80; border: 1px solid #166534; }
.alert.error { background: rgba(153, 27, 27, 0.2); color: #f87171; border: 1px solid #991b1b; }

/* Tables (Admin) */
table { width: 100%; border-collapse: collapse; margin-top: 20px; border:none;border-radius: var(--border-radius);overflow: hidden;}
th, td { padding: 14px; border-bottom: 1px solid var(--border-color); text-align: left; }
th { background-color: rgba(255,255,255,0.05); color: var(--primary-color); }
tr:hover { background-color: rgba(255,255,255,0.02); }

/* --- FULLCALENDAR DARK MODE OVERRIDES --- */

/* Titre du calendrier */
.fc .fc-toolbar-title { color: var(--title-color); }

/* Boutons du calendrier (Mois/Semaine) */
.fc .fc-button-primary {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}
.fc .fc-button-primary:hover {
    background-color: #334155;
    border-color: #475569;
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Grille et Jours */
.fc-theme-standard td, .fc-theme-standard th { border-color: rgba(255,255,255,0.1); }
.fc .fc-col-header-cell-cushion { color: var(--text-color); }
.fc .fc-timegrid-slot-label-cushion { color: #64748b; } /* Heures sur le côté en gris */

/* Événements */
.fc-event {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: none;
}
.fc-event-main { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* Badge Admin */
.badge { background: var(--primary-color); color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.8em; font-weight: bold; }
@media (max-width: 600px) {
        .main-wrapper { padding: 10px; }
        .fc-toolbar-title { font-size: 1.2em !important; }
    }
    .admin-container{
        width: 100%;
    }
    /* --- MEDIA QUERIES (RESPONSIVE MOBILE) --- */

@media (max-width: 768px) {

    /* 1. Ajustement du conteneur global */
    .admin-container {
        padding: 15px;
        width: auto; /* Prend toute la largeur dispo */
        margin: 10px;
    }

    /* 2. Le formulaire d'ajout passe en vertical */
    .admin-container form {
        flex-direction: column;
        align-items: stretch; /* Les inputs prennent toute la largeur */
    }

    .admin-container form input, 
    .admin-container form button {
        width: 100%; /* Pleine largeur */
        margin-bottom: 10px;
        box-sizing: border-box; /* Évite que le padding dépasse */
    }

    /* 3. TRANSFORMATION DU TABLEAU EN CARTES (La partie importante) */
    
    /* On cache l'en-tête du tableau (Nom, Email, Temps) car inutile en mode carte */
    .admin-container table thead {
        display: none;
    }

    /* Le tableau et les lignes deviennent des blocs */
    .admin-container table, .admin-container  table tbody, .admin-container table tr, .admin-container  table td {
        display: block;
        width: 100%;
        box-sizing: border-box; /* Important pour les largeurs */
    }

    /* Chaque ligne devient une "Carte" */
    .admin-container table tr {
        margin-bottom: 15px;
        background-color: rgba(255, 255, 255, 0.03); /* Fond légèrement différent */
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
    }

    /* Les cellules */
    .admin-container table td {
        text-align: right; /* Contenu aligné à droite */
        position: relative;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* On enlève la bordure du dernier élément de la carte */
    .admin-container table td:last-child {
        border-bottom: 0;
    }

    /* On insère le titre de la colonne (via data-label) à gauche */
    .admin-container table td::before {
        content: attr(data-label); /* Récupère "Nom", "Email", etc. */
        font-weight: bold;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 0.75rem;
    }
    
    /* Ajustement du graphique pour qu'il ne déborde pas */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}
/* --- STATS GRID (HALL OF FAME) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.stat-card {
    background-color: rgba(30, 41, 59, 0.7); /* Fond un peu transparent */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(240, 130, 0, 0.15); /* Lueur orange au survol */
    border-color: var(--primary-color);
}

.stat-card .icon {
    font-size: 2rem;
    background: rgba(255,255,255,0.05);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8; /* Gris clair */
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .winner {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2px 0;
}

.stat-card .value {
    color: var(--primary-color); /* Orange */
    font-size: 0.85rem;
    font-weight: 500;
}
/* --- BONUS CARDS --- */
.bonus-card {
    flex: 1;
    min-width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
/* --- BOUTON DECONNEXION --- */
.btn-logout {
    background-color: #ef4444; /* Rouge moderne */
    color: white;
    border: none;
    padding: 8px 16px; /* Taille adaptée pour le header */
    border-radius: 8px; /* Même arrondi que les autres */
    font-weight: 600;
    text-decoration: none; /* Pas de soulignement */
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px; /* Espace entre l'icône et le texte */
}

.btn-logout:hover {
    background-color: #dc2626; /* Rouge plus foncé au survol */
    transform: translateY(-1px); /* Petit effet de rebond */
    color: white;
}
.bonus-card:hover { transform: translateY(-3px); }

/* Couleurs spécifiques */
.spotify:hover { border-color: #1DB954; background: rgba(29, 185, 84, 0.1); }
.issue:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.bonus-card strong { display: block; color: var(--title-color); font-size: 1rem; }
.bonus-card small { color: #94a3b8; font-size: 0.8rem; }

.icon-bonus {
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
}

.spotify .icon-bonus { color: #1DB954; } /* Vert Spotify */
.issue .icon-bonus { color: #ef4444; }   /* Rouge Alerte */
/* --- HEADER RESPONSIVE --- */
header {
    background: #1e293b; /* Fond sombre carte */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #334155;
    margin-bottom: 20px;
}

/* La barre du haut (Live status) */
.live-bar {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #94a3b8;
}

.live-dot {
    height: 10px; width: 10px; 
    border-radius: 50%; 
    display: inline-block;
}

/* La partie principale (Titre + Boutons) */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permet de passer à la ligne sur mobile */
    gap: 15px;
}

.brand h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

/* Groupe Utilisateur (Nom + Boutons) */
.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 0.9em;
    color: #cbd5e1;
    margin-right: 5px;
}

/* Boutons du header unifiés */
.btn-nav {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: filter 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-nav:hover { filter: brightness(1.1); }
.btn-nav.blue { background-color: #3b82f6; }
.btn-nav.indigo { background-color: #4f46e5; }
.btn-nav.red { background-color: #ef4444; }

/* --- VERSION MOBILE (< 768px) --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column; /* On empile verticalement */
        align-items: stretch; /* Prend toute la largeur */
        text-align: center;
    }
    
    .user-actions {
        justify-content: center; /* Centre les boutons */
        flex-wrap: wrap;
    }
    
    .user-name {
        display: none; /* On cache le "Salut Machin" sur mobile pour gagner de la place */
    }
    
    .brand h1 { font-size: 1.3rem; }
}