/**
 * ═══════════════════════════════════════════════════════════════════════════
 * INDEX - PLAYER CONTROLS (PANNEAU DE RÉGLAGES)
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * OBJECTIF:
 * Panneau de réglages flottant pour contrôler le comportement du player:
 * - Rotation automatique (durée, activation)
 * - Lecture des clips (ordre, autoplay, volume)
 * - Affichage (qualité, mode théâtre)
 * - Notifications
 * 
 * FONCTIONNALITÉS:
 * - Panneau overlay qui s'ouvre/ferme avec animation
 * - Bouton settings en haut à droite du player
 * - Sections organisées par catégorie
 * - Inputs (select, number, checkbox) stylisés
 * - Sauvegarde automatique des préférences
 * 
 * CHARGEMENT: Avec cache busting
 * TAILLE: 7.9 KB
 * 
 * DÉPENDANCES:
 * - JavaScript: player-options-toggle.js (gère l'ouverture/fermeture)
 * - LocalStorage: Sauvegarde des préférences utilisateur
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   BOUTON SETTINGS EN OVERLAY
   ═══════════════════════════════════════════════════════════════════════════
   Bouton fixe en haut à droite du player pour ouvrir le panneau de réglages.
   Quand le panneau est ouvert, le bouton s'élargit et affiche "Réglages".
*/
.player-settings-overlay-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 111, 177, 0.4);
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    white-space: nowrap;
}

.player-settings-overlay-btn .btn-text {
    display: none;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

.player-settings-overlay-btn .btn-icon {
    display: inline-block;
}

.player-settings-overlay-btn:hover {
    background: rgba(255, 111, 177, 0.3);
    border-color: rgba(255, 111, 177, 1);
    transform: scale(1.05);
}

.player-settings-overlay-btn:active {
    transform: scale(0.95);
}

/* Quand le panneau est ouvert */
.player-settings-panel.open ~ .player-settings-overlay-btn,
.player-settings-overlay-btn.panel-open {
    width: 200px;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.98), rgba(30, 20, 45, 0.98));
    justify-content: center;
}

.player-settings-overlay-btn.panel-open .btn-text {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANNEAU FLOTTANT DES OPTIONS
   ═══════════════════════════════════════════════════════════════════════════
   Panneau qui descend du bouton settings avec toutes les options.
   Caché par défaut (max-height: 0), s'ouvre avec animation smooth.
*/
.player-settings-panel {
    position: absolute !important;
    top: 3.5rem !important;
    right: 1rem !important;
    transform: translateY(0) !important;
    transform-origin: top right !important;
    width: 200px !important;
    max-width: calc(100vw - 2rem) !important;
    max-height: 0 !important;
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.98), rgba(30, 20, 45, 0.98)) !important;
    backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 111, 177, 0.4) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 111, 177, 0.3) !important;
    z-index: 100 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
}

.player-settings-panel.open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 400px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENU DU PANNEAU
   ═══════════════════════════════════════════════════════════════════════════
   Zone scrollable contenant toutes les sections de contrôles
*/
.panel-content {
    padding: 0.7rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(255, 111, 177, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 111, 177, 0.3);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 111, 177, 0.5);
}

/* ===== SECTIONS DE CONTRÔLES ===== */
.control-section {
    margin-bottom: 0.7rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 111, 177, 0.15);
}

.control-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-section.hidden {
    display: none !important;
}

.control-section h5 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary, #FF6FB1);
    margin: 0 0 0.5rem 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

/* ===== GROUPES DE CONTRÔLES ===== */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.control-group.control-group-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.control-group.control-group-inline label {
    margin: 0 !important;
    width: auto !important;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label:not(.checkbox-label) {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    text-align: left;
    width: 100%;
}

/* ===== INPUTS ===== */
.control-group select {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(255, 111, 177, 0.3);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    width: 100%;
}

.control-group input[type="number"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(255, 111, 177, 0.3);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    width: 60px;
    text-align: center;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary, #FF6FB1);
    box-shadow: 0 0 0 3px rgba(255, 111, 177, 0.2);
}

/* ===== CHECKBOXES ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-primary, white);
    transition: color 0.2s ease;
    padding: 0.2rem 0;
    width: 100%;
}

.checkbox-label:hover {
    color: var(--primary, #FF6FB1);
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary, #FF6FB1);
    flex-shrink: 0;
}

.checkbox-label span {
    flex: 1;
    text-align: left;
    font-size: 0.75rem;
}

/* ===== INPUT AVEC UNITÉ ===== */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
}

.input-with-unit input {
    flex: 0 0 60px;
}

.input-with-unit .unit {
    font-size: 0.75rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    white-space: nowrap;
}

/* ===== OVERLAY POUR FERMER ===== */
.player-controls-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 99 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.player-controls-overlay.open {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .player-settings-overlay-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .player-settings-panel {
        max-width: 95%;
        max-height: 85vh;
        right: 0.75rem !important;
        top: 3rem !important;
    }
    
    .panel-content {
        padding: 1rem;
    }
    
    .control-section {
        margin-bottom: 1rem;
        padding-bottom: 0.875rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FIN DU FICHIER
   ═══════════════════════════════════════════════════════════════════════════
   
   RÉSUMÉ:
   Ce fichier gère le panneau de réglages du player avec toutes les options
   de personnalisation (rotation, clips, qualité, notifications, etc.).
   
   SECTIONS:
   - Rotation automatique: Durée entre les streamers, activation on/off
   - Clips: Ordre de lecture, autoplay, volume, reprise
   - Affichage: Qualité vidéo, mode théâtre
   - Notifications: Alertes de changement de streamer
   
   TECHNIQUE:
   - Panneau overlay avec backdrop-filter blur
   - Animation d'ouverture via max-height (0 → 400px)
   - Scrollbar personnalisée pour le contenu
   - Inputs stylisés avec accent-color
   
   SAUVEGARDE:
   Les préférences sont sauvegardées automatiquement dans localStorage
   via player-options-toggle.js
   
   MAINTENANCE:
   Pour ajouter une nouvelle option, créer un .control-group dans une .control-section
   Pour changer les couleurs, modifier les valeurs rgba() et var(--primary)
   
   DERNIÈRE MISE À JOUR: 6 mai 2026
   ═══════════════════════════════════════════════════════════════════════════
*/
