/* Feuille de style partagée par tout le panel (admin.php, settings.php, multistream.php, planning.php).
   Fusion des styles auparavant dupliqués (et parfois incohérents) dans chaque page. */

body { font-family: 'Segoe UI', sans-serif; background: #0e0e10; color: #efeff1; margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* Écran de connexion */
.login-container { display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; }
.login-panel { background: #18181b; padding: 40px; border-radius: 8px; border-top: 4px solid #9146ff; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.5); max-width: 450px; width: 90%; }

/* Header Top Navigation */
.top-header { display: flex; justify-content: space-between; align-items: center; background: #18181b; padding: 0 20px; height: 70px; border-bottom: 2px solid #9146ff; flex-shrink: 0; }
.header-left, .header-right { display: flex; align-items: center; gap: 15px; }
.header-avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid #9146ff; }
.header-nav { display: flex; gap: 15px; }
.tab-link { color: #efeff1; text-decoration: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; transition: 0.3s; background: #2a2a2d; }
.tab-link:hover, .tab-link.active { background: #9146ff; color: white; }

/* Layout Principal */
.main-content { padding: 10px 20px; flex: 1; overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }
.dashboard-layout { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: auto 1fr; gap: 12px; height: 100%; overflow-y: auto; padding-right: 5px; }

.feed-section { grid-column: 1; grid-row: span 2; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.video-section { grid-column: 2 / span 2; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.chat-section { grid-column: 4; grid-row: span 2; display: flex; flex-direction: column; min-height: 0; }
.tools-section { grid-column: 2; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.actions-section { grid-column: 3; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 12px; } /* Pour les pages Paramètres/Admin/Planning */

/* Boîtes et formulaires */
.box { background: #2a2a2d; padding: 12px; border-radius: 6px; border: 1px solid #3a3a3d; display: flex; flex-direction: column; }
.box h3 { margin-top: 0; margin-bottom: 10px; color: #bf94ff; font-size: 1.05em; }
input[type="text"], input[type="date"], input[type="datetime-local"], input[type="number"] { width: 100%; padding: 8px; margin: 5px 0 10px 0; background: #3a3a3d; border: 1px solid #555; color: white; border-radius: 4px; box-sizing: border-box; font-size: 0.9em; }
textarea { resize: vertical; min-height: 60px; margin-bottom: 0; flex: 1; font-size: 0.9em; padding: 8px; background: #3a3a3d; border: 1px solid #555; color: white; border-radius: 4px; box-sizing: border-box;}
label { font-weight: bold; color: #bf94ff; font-size: 0.9em; }
.checkbox-label { display: flex; align-items: center; color: #efeff1; cursor: pointer; margin-bottom: 10px; font-size: 0.9em; }
.checkbox-label input { margin-right: 8px; }

.btn { display: inline-block; background: #9146ff; color: white; padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; width: 100%; font-weight: bold; font-size: 0.95em; transition: 0.3s; text-align: center; text-decoration: none; box-sizing: border-box; margin-bottom: 8px; }
.btn:hover { background: #772ce8; }
.btn-discord { background: #5865F2; }
.btn-discord:hover { background: #4752c4; }
.btn-logout { background: #3a3a3d; margin: 0; }
.btn-logout:hover { background: #d92d2d; }
.btn-red { background: #dc2626; }
.btn-red:hover { background: #b91c1c; }
.btn-blue { background: #2563eb; }
.btn-blue:hover { background: #1d4ed8; }
.btn-grey { background: #4b5563; }
.btn-grey:hover { background: #374151; }
.btn-green { background: #10b981; }
.btn-green:hover { background: #059669; }
.btn-orange { background: #f59e0b; }
.btn-orange:hover { background: #d97706; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center; display: none; }

.success, .error { padding: 10px; border-radius: 4px; text-align: center; margin-bottom: 15px; flex-shrink: 0; font-weight: bold; }
.success { color: #4ade80; background: #14532d; }
.error { color: #fca5a5; background: #7f1d1d; }

.twitch-embed-admin { border-radius: 8px; overflow: hidden; background: #18181b; box-shadow: 0 4px 10px rgba(0,0,0,0.3); flex-shrink: 0; display: flex; flex-direction: column; }

/* Lecteur vidéo multi-plateforme (empile Twitch/YouTube/Kick, un seul visible à la fois) */
.video-player-stack { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 34vh; }
.video-player-stack .twitch-embed-admin { position: absolute; inset: 0; }
.video-switcher { padding: 6px 8px; }
.video-switcher .platform-badge { width: 30px; height: 30px; font-size: 0.85em; }

.chat-tabs { display: flex; flex-shrink: 0; background: #2a2a2d; border-bottom: 1px solid #3a3a3d; }
.chat-tab-btn { background: transparent; border: none; color: #aaa; padding: 10px 15px; cursor: pointer; font-weight: bold; font-size: 0.9em; border-bottom: 3px solid transparent; transition: 0.3s; }
.chat-tab-btn.active { color: #bf94ff; border-bottom-color: #9146ff; }
.chat-container { height: 100%; }

.checklist label { font-weight: normal; color: #efeff1; display: block; margin-bottom: 8px; cursor: pointer; }
.toolbox ul { list-style: none; padding: 0; margin: 0; }
.toolbox li { margin-bottom: 10px; }
.toolbox a { color: #4ade80; text-decoration: none; font-weight: bold; }
.toolbox a:hover { text-decoration: underline; }

.main-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; height: 100%; overflow-y: auto; padding-right: 10px; align-items: start; }

/* Objectif / barre de progression (reprise de l'ancien index.php, désormais partagée) */
.goal-container { background: #18181b; border: 1px solid #3a3a3d; border-radius: 8px; padding: 15px; margin: 20px auto; max-width: 500px; }
.goal-title { margin: 0 0 10px 0; font-size: 1.2em; font-weight: bold; color: #4ade80; }
.progress-bar { background: #3a3a3d; border-radius: 20px; height: 25px; width: 100%; overflow: hidden; position: relative; }
.progress-fill { background: #9146ff; height: 100%; transition: width 0.5s; }
.progress-text { position: absolute; top: 0; left: 0; width: 100%; text-align: center; line-height: 25px; font-weight: bold; font-size: 0.9em; text-shadow: 1px 1px 2px black; }

@media (max-width: 1400px) { .dashboard-layout { grid-template-columns: repeat(3, 1fr); } .feed-section { grid-column: 1 / span 3; grid-row: auto; } .video-section { grid-column: 1 / span 2; } .chat-section { grid-column: 3; } .tools-section { grid-column: 1; } .actions-section { grid-column: 2; } }
@media (max-width: 1100px) { .dashboard-layout { grid-template-columns: repeat(2, 1fr); } .video-section { grid-column: 1 / span 2; } .chat-section { grid-column: 1 / span 2; grid-row: auto; height: 500px; } .tools-section { grid-column: 1; } .actions-section { grid-column: 2; } .feed-section { grid-column: 1 / span 2; } }
@media (max-width: 800px) { .dashboard-layout, .main-layout { grid-template-columns: 1fr; } .tools-section, .actions-section, .video-section, .chat-section, .feed-section { grid-column: 1; } }

/* Curseurs (range) personnalisés */
input[type="range"] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: #3a3a3d; border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb {
    height: 16px; width: 16px; border-radius: 50%; background: #9146ff; cursor: pointer;
    -webkit-appearance: none; margin-top: -5px; transition: transform 0.2s, background 0.2s; box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
input[type="range"]::-webkit-slider-thumb:hover { background: #bf94ff; transform: scale(1.2); }
input[type="range"]::-moz-range-track { width: 100%; height: 6px; cursor: pointer; background: #3a3a3d; border-radius: 4px; }
input[type="range"]::-moz-range-thumb {
    height: 16px; width: 16px; border-radius: 50%; background: #9146ff; cursor: pointer;
    transition: transform 0.2s, background 0.2s; border: none; box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
input[type="range"]::-moz-range-thumb:hover { background: #bf94ff; transform: scale(1.2); }

/* ── Passe de polish visuel ─────────────────────────────────────────────── */

/* Profondeur douce sur les boîtes, cohérente partout */
.box { box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.box h3 { letter-spacing: 0.02em; }

/* États de focus (absents jusqu'ici sur les champs) */
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus, textarea:focus {
    outline: none;
    border-color: #9146ff;
    box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.25);
}

/* Retour tactile sur les boutons */
.btn:active { transform: scale(0.98); }
.header-avatar { transition: transform 0.2s; }
.header-avatar:hover { transform: scale(1.05); }

/* Badges de plateforme (Twitch/YouTube/Kick) : identité compacte, barrée quand indisponible */
.platform-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 7px; font-weight: bold; font-size: 0.8em;
    color: white; flex-shrink: 0; position: relative; user-select: none;
    transition: opacity 0.2s;
}
.platform-badge.twitch { background: #9146ff; }
.platform-badge.youtube { background: #ff0000; }
.platform-badge.kick { background: #53fc18; color: #111; }
.platform-badge.discord { background: #5865f2; }
.platform-badge.google { background: #efeff1; color: #3a3a3d; }
.platform-badge.unavailable { background: #3a3a3d !important; color: #666 !important; }
.platform-badge.unavailable::after {
    content: ''; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px;
    background: #888; transform: rotate(-18deg);
}
.platform-badge svg { width: 60%; height: 60%; }
.platform-stat { display: flex; align-items: center; gap: 8px; text-align: left; }
.platform-stat-label { color: #aaa; font-size: 0.75em; text-transform: uppercase; }
.platform-picker { display: inline-flex; gap: 4px; }
.platform-picker .platform-badge { cursor: pointer; opacity: 0.55; }
.platform-picker .platform-badge:hover { opacity: 0.85; }
.platform-picker .platform-badge.selected { opacity: 1; box-shadow: 0 0 0 2px #efeff1; }

/* Barre d'objectif : dégradé + brillance légère au lieu d'un aplat */
.progress-fill {
    background: linear-gradient(90deg, #772ce8, #9146ff 60%, #bf94ff);
    background-size: 200% 100%;
    box-shadow: inset 0 0 8px rgba(255,255,255,0.15);
}

/* Ligne de compte lié (Paramètres) : badge + statut + action, au lieu d'une bannière pleine largeur par compte */
.account-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #18181b; border: 1px solid #3a3a3d; border-radius: 6px; margin-bottom: 8px; }
.account-row .platform-badge { width: 34px; height: 34px; font-size: 0.9em; border-radius: 8px; }
.account-row-info { flex: 1; min-width: 0; }
.account-row-info strong { display: block; font-size: 0.95em; }
.account-row-status { font-size: 0.8em; color: #666; }
.account-row-status.connected { color: #4ade80; }
.account-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.account-row-actions .btn, .account-row-actions form { width: auto; margin: 0; }
.account-row-actions .btn { padding: 6px 10px; font-size: 0.8em; }

/* Ascenseur fin et sombre sur les zones défilantes */
.dashboard-layout::-webkit-scrollbar, .main-layout::-webkit-scrollbar, ::-webkit-scrollbar {
    width: 8px; height: 8px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }
