/* ==========================================================================
   COMPONENTS.CSS - Couleurs
   ========================================================================== */
:root {
    /* Couleurs principales */
    --color-primary: #4f46e5; /* Mauve */
    --color-primary-light: #eef2ff;
    --color-primary-hover: #4338ca;
    
    /* Couleurs de fond et bordures */
    --color-bg: #f3f4f6; /* Gris Clair */
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
/*    --color-header: linear-gradient(135deg, #667eea, #764ba2); */
    /* A voir background: linear-gradient(135deg, var(--color-primary-dark, #2c3e50), var(--color-primary, #3498db)); */
    
    
    /* Textes */
    --color-text-main: #1f2937;
    --color-text-muted: #6b7280;
    
    /* Statuts (Succès, Danger, Warning) */
    --color-success: #22c55e;
    --color-success-bg: #dcfce7;
    --color-danger: #ef4444;
    --color-danger-bg: #fef2f2;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-info: #4f46e5;
    --color-info-bg: #eef2ff;

    /* Tailles et Espacements */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;
    
    /* Tailles et Espacements */
    --font-xs: 12px;     /* Badges, métadonnées */
    --font-sm: 14px;     /* Contenu principal */
    --font-lg: 20px;     /* Sections principales Titre card */
    --font-xxl: 32px;    /* Titres de pages */
}

/* ==========================================================================
   COMPONENTS.CSS - Boutons, Badges, Formulaires et Avatars unifiés
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BOUTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md, 12px);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn--primary { background: var(--color-primary, #4f46e5); color: var(--color-surface); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.btn--primary:hover { background: var(--color-primary-hover, #4338ca); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3); }
.btn--gray { background: var(--color-bg, #f3f4f6); color: var(--color-text-main, #1f2937); }
.btn--gray:hover { background: var(--color-border, #e5e7eb); }
.btn--outline { background: transparent; border: 1px solid var(--color-primary, #4f46e5); color: var(--color-primary, #4f46e5); }
.btn--outline:hover { background: var(--color-primary, #4f46e5); color: #ffffff; }
.btn--danger { background: var(--color-danger-bg, #fef2f2); color: var(--color-danger, #ef4444); }
.btn--danger:hover { background: var(--color-danger, #ef4444); color: #ffffff; }
.btn--success { background: var(--color-success, #22c55e); color: #ffffff; }
.btn--success:hover { background: #16a34a; }
.btn--full { width: 100%; }
.btn--icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; flex-shrink: 0; }

.btn--s--gray { background: var(--color-bg, #f3f4f6); color: var(--color-text-main, #1f2937); }
.btn--s--gray:hover { background: var(--color-border, #e5e7eb); }

/* Ajoute ceci dans theme.css */
.btn--sm {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   2. BADGES & PILLS
   -------------------------------------------------------------------------- */
.badges-container { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; }

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--font-xs);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.badge--success { background: var(--color-success-bg, #dcfce7); color: #166534; border: 1px solid #bbf7d0; }
.badge--success::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f00c";
    margin-right: 6px;
} /* 🚨 C'est l'accolade qui manquait ici ! 🚨 */

.badge--warning { background: var(--color-warning-bg, #fef3c7); color: #d97706; border: 1px solid #fde68a; }
.badge--danger { background: var(--color-danger-bg, #fef2f2); color: #991b1b; border: 1px solid #fecaca; }
.badge--neutral { background: var(--color-bg, #f3f4f6); color: var(--color-text-muted, #4b5563); border: 1px solid var(--color-border, #e5e7eb); }
.badge--info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid var(--color-border, #e5e7eb); }
.badge--primary { background: var(--color-primary-light, #eef2ff); color: var(--color-primary, #4f46e5); border: 1px solid #c7d2fe; }

/* --------------------------------------------------------------------------
   3. Les textes
   -------------------------------------------------------------------------- */
.game-name { font-size: var(--font-sm); color: var(--color-primary); }

/* --------------------------------------------------------------------------
   4. AVATARS
   -------------------------------------------------------------------------- */
.avatar {
    border-radius: 50%; object-fit: cover; background: var(--color-border, #e5e7eb);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--color-text-muted, #6b7280); font-weight: 700;
}
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 80px; height: 80px; border: 4px solid #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); font-size: 24px; }

/* --------------------------------------------------------------------------
   5. FORMULAIRES UNIFIÉS
   -------------------------------------------------------------------------- */
.form-control {
    width: 100%; padding: 12px 16px; border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 12px); font-size: 14px; background: #f9fafb;
    transition: all 0.2s ease; outline: none; font-family: inherit; color: var(--color-text-main, #1f2937); margin-bottom: 16px;
}
.form-control:focus { border-color: var(--color-primary, #4f46e5); background: #ffffff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
textarea.form-control { resize: vertical; min-height: 100px; max-height: 250px; }

/* Le Toggle/Switch propre */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--color-border, #d1d5db); transition: .4s; border-radius: 34px; }
.switch__slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.switch input:checked + .switch__slider { background-color: var(--color-success, #22c55e); }
.switch input:checked + .switch__slider:before { transform: translateX(20px); }

/* Header style Profil */
.profile-header, .login-header {
    background: linear-gradient(90deg, #4f46e5, #9333ea); padding: 40px 20px; text-align: center;
    position: relative; height: 96px; color: white; flex-shrink: 0;
}
.avatar-wrapper { position: absolute; bottom: -32px; left: 24px; }
.avatar-img { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--white); box-shadow: 0 4px 6px rgba(0,0,0,0.1); object-fit: cover; background: var(--white); }

/* Grilles */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Toggles / Switch classiques */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.toggle-info { display: flex; flex-direction: column; text-align: left; }
.toggle-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.toggle-desc { font-size: 11px; color: var(--text-muted); }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--border); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- CONTRÔLES D'AJOUT DE JEU --- */
.add-game-controls { display: flex; gap: 12px; margin-top: 24px; margin-bottom: 16px; align-items: stretch; }
.add-game-controls select, .add-game-controls .btn-primary, .add-game-controls .btn-missing-game { height: 44px; margin: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.add-game-controls select { flex: 1; cursor: pointer; }
.add-game-controls .btn-primary { padding: 0 20px; }

/* --- LISTE DE JEUX DANS LE PROFIL --- */
.games-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.game-card { display: flex; align-items: center; gap: 10px; background: #f9fafb; padding: 8px 12px; border-radius: 12px; border: 1px solid #e5e7eb; }
.game-level-select { width: auto !important; margin-bottom: 0 !important; padding: 4px 8px !important; font-size: 12px !important; }
.btn-remove-game { background: none; border: none; color: #ef4444; cursor: pointer; padding: 4px; }
.btn-missing-game { background: var(--primary-light); color: var(--primary); border: 1px dashed var(--primary); padding: 0 16px; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.btn-missing-game:hover { background: var(--primary); color: var(--white); border-style: solid; }

/* Footer & Boutons */
.form-footer { background: var(--gray-light); padding: 20px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; }

/* --- AGENDA & TIMELINE --- */
.week-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.day-btn { flex: 1 1 calc(14% - 8px); min-width: 45px; padding: 8px 4px; background: white; border: 1px solid #e5e7eb; border-radius: 12px; text-align: center; font-size: 12px; font-weight: 700; cursor: pointer; transition: 0.2s ease; user-select: none; }
.day-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.timeline-bar { display: flex; height: 6px; background: #f3f4f6; border-radius: 10px; margin-top: 8px; overflow: hidden; width: 100%; }
.timeline-segment { height: 100%; transition: width 0.3s ease; }
.segment-avail { background: #22c55e; }
.segment-unavail { background: #ef4444; }

.day-edit-panel { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; }
.time-slot-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.time-slot-row input { margin-bottom: 0 !important; }
.panel-header { font-size: 14px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

.status-radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.status-radio { position: relative; }
.status-radio input { position: absolute; opacity: 0; }
.status-radio label { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.status-radio input:checked + label { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.time-slots-list { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px dashed var(--border); }
.btn-icon { background: var(--danger-light); color: var(--danger); border: none; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }
.btn-icon:hover { background: var(--danger); color: var(--white); }
.btn-text-add { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* --- AFFICHAGE PROFIL JOUEUR --- */
.profile-bio { margin-top: 16px; padding: 16px; background: #f9fafb; border-radius: 12px; border: 1px solid #e5e7eb; font-size: 14px; line-height: 1.6; }
.action-buttons { display: flex; gap: 10px; margin: 20px 0; }

/* Agenda en lecture seule */
.display-agenda { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; width: 100%;}
.display-day-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: white; border: 1px solid #e5e7eb; border-radius: 10px; }
.display-day-name { font-weight: 700; font-size: 13px; color: #4b5563; min-width: 40px; }
.status-badge-green { color: #166534; font-size: 12px; font-weight: 600; }
.status-badge-red { color: #991b1b; font-size: 12px; font-weight: 600; }

.badges-group { display: flex; flex-direction: column; gap: 4px; }
.badges-group .badge { background: white; color: #1f2937; border: 1px solid #e5e7eb; }

/* Compte à rebourd */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}