/* ================================================================
 * OPEP LIVE STUDIO - Styles
 * ================================================================ */

/* --- CONSOLE PRINCIPALE --- */
.studio-console {
    background: #121212;
    color: #e0e0e0;
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* --- INPUTS --- */
.studio-console .studio-input {
    background: #1e1e1e !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    padding: 8px 10px;
    width: 100%;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 13px;
    margin-bottom: 8px;
}
.studio-console .studio-input:focus,
.studio-console .studio-input:active {
    outline: 2px solid #00bcd4 !important;
    background: #263238 !important;
    color: #fff !important;
}
.studio-console select.studio-input { height: 35px; }
.studio-console select option { background: #1e1e1e !important; color: #fff !important; }
.studio-console label { font-size: 10px !important; color: #aaa !important; display: block; margin-bottom: 2px; }

/* --- AUTOCOMPLETE --- */
#autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    background: #263238;
    border: 1px solid #00bcd4;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

/* --- ADN DISPLAY --- */
#adn-display {
    background: #1565c0;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    display: none;
    border: 1px solid #90caf9;
}

/* --- CARTES ACTION --- */
.action-card {
    background: #1e1e1e;
    border-left: 4px solid #90caf9;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.action-card.encours { border-left-color: #ff9800; background: #2b1d1d; }
.action-card.champion { border-left-color: #ffd700; background: #1a237e; }

/* --- GRILLE HISTORIQUE --- */
.grid-historique { width: 100%; font-size: 12px; border-collapse: collapse; margin-bottom: 8px; }
.grid-historique th { text-align: left; padding: 4px; color: #81d4fa; border-bottom: 1px solid #444; font-size: 11px; }
.grid-historique td { padding: 4px; font-weight: bold; }
.tech-val { color: #4caf50; }
.sub-info { font-size: 10px; color: #888; margin-bottom: 8px; font-family: monospace; }
.alert-anom { color: #ff5722; font-weight: bold; }
.badge-pupitre {
    background: #263238;
    color: #e0e0e0;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin: 2px;
    display: inline-block;
    border: 1px solid #37474f;
    font-family: monospace;
}

/* --- ARCHIVE --- */
#zone-archive { background: #1a1a1a; border: 1px solid #555; padding: 15px; border-radius: 6px; margin-top: 10px; display: none; }
.archive-group { margin-bottom: 10px; background: #263238; border-radius: 4px; padding: 8px; border-left: 3px solid #81d4fa; }
.archive-item { font-size: 12px; color: #fff; margin-bottom: 4px; }

/* --- PUPITRE --- */
.pupitre-card { background: #1c2326; border-left: 4px solid #4caf50; margin-top: 10px; border-radius: 6px; }
.pupitre-card.vierge { border-left-color: #ff9800; background-color: #2b1d1d; }
.pupitre-header {
    padding: 10px;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #263238;
}
.pupitre-body { padding: 10px; display: none; }

/* --- RESULTAT LIVE --- */
.live-result-box {
    background: #00333f;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    border: 1px solid #00bcd4;
}

/* --- OPTIONS --- */
.studio-console .option-tuile {
    background: #263238 !important;
    border: 1px solid #455a64 !important;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.studio-console .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #00333f !important;
    padding: 8px;
    border-radius: 4px;
    color: #fff !important;
    user-select: none;
}
.studio-console .checkbox-label:hover,
.studio-console .checkbox-label:focus-within {
    background: #004d60 !important;
    color: #fff !important;
}
.studio-console .option-texte { font-size: 12px; margin-top: 5px; color: #e0e0e0 !important; }
.studio-console .option-titre { font-size: 13px; margin: 0; font-weight: bold; color: #fff !important; }

/* --- BOUTONS --- */
.btn-action {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
    text-transform: uppercase;
    margin-top: 10px;
}
.btn-half { width: 48%; display: inline-block; }

/* --- FORMULAIRE CREATION --- */
#creation-form {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 6px;
    border: 2px dashed #00bcd4;
    margin-top: 10px;
    display: none;
}
.allure-box { background: #222; padding: 10px; border-radius: 6px; margin-bottom: 10px; border-left: 3px solid; }
.allure-box:first-child { border-left-color: #4caf50; }
.allure-box:nth-child(2) { border-left-color: #2196f3; }
.allure-box:nth-child(3) { border-left-color: #ff9800; }

/* --- GAMME OVERLAY --- */
#gamme-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #000;
    z-index: 99999;
    display: none;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}
#gamme-texte {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00e5ff;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
}
#gamme-controls { display: flex; gap: 10px; padding-bottom: 20px; flex-wrap: wrap; }
.btn-giant {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    min-width: 45%;
}
#gamme-video-container {
    flex: 1;
    display: none;
    justify-content: center;
    align-items: center;
    background: #111;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}
#gamme-video-player { width: 100%; height: 100%; object-fit: contain; }

/* --- LIGHTBOX PHOTO --- */
#photo-lightbox img { transition: transform 0.3s ease; }
#photo-lightbox img:hover { transform: scale(1.02); }

/* ================================================================
 * MODAL REMPLACEMENT AIMANT
 * ================================================================ */
.modal-remplacement-aimant {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-remplacement-aimant .modal-content {
    background: #1e1e1e;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-remplacement-aimant h3 { color: #f59e0b; margin-top: 0; font-size: 16px; }
.modal-remplacement-aimant .info-ancien {
    background: #263238;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #ccc;
}
.modal-remplacement-aimant .info-ancien strong { color: #81d4fa; }
.modal-remplacement-aimant .champ-recherche {
    width: 100%;
    padding: 10px;
    background: #121212;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
}
.modal-remplacement-aimant .liste-aimants { max-height: 300px; overflow-y: auto; margin-bottom: 15px; }
.modal-remplacement-aimant .aimant-item {
    padding: 10px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    color: #e0e0e0;
}
.modal-remplacement-aimant .aimant-item:hover,
.modal-remplacement-aimant .aimant-item.selected {
    background: #00333f;
    border-left: 3px solid #4caf50;
}
.modal-remplacement-aimant .aimant-item .dim { color: #81d4fa; font-weight: bold; }
.modal-remplacement-aimant .aimant-item .materiau { font-size: 10px; color: #aaa; }
.modal-remplacement-aimant .champ-orientation { display: flex; gap: 10px; margin-bottom: 15px; }
.modal-remplacement-aimant .btn-orientation {
    flex: 1;
    padding: 10px;
    border: 2px solid #444;
    background: #263238;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}
.modal-remplacement-aimant .btn-orientation.active-sud { border-color: #4caf50; background: #1b5e20; color: #fff; }
.modal-remplacement-aimant .btn-orientation.active-nord { border-color: #f44336; background: #b71c1c; color: #fff; }
.modal-remplacement-aimant .btn-confirmer {
    width: 100%;
    padding: 12px;
    background: #f59e0b;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}
.modal-remplacement-aimant .btn-annuler {
    width: 100%;
    padding: 10px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 5px;
}
.modal-remplacement-aimant .label-pivote {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
}
.modal-remplacement-aimant .label-pivote input { transform: scale(1.2); }
.modal-remplacement-aimant .commentaire-pose {
    width: 100%;
    padding: 8px;
    background: #121212;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 15px;
    resize: vertical;
    min-height: 40px;
}
.modal-remplacement-aimant .alert-gap {
    background: #b71c1c;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    display: none;
}

/* ================================================================
 * PLAN INLINE - AIMANTS CLIQUABLES
 * ================================================================ */
.aimant-modifie { position: relative; }
.aimant-modifie::after {
    content: "✏️";
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 8px;
    color: #f59e0b;
}
.aimant-clickable { cursor: pointer; transition: opacity 0.2s; }
.aimant-clickable:hover { opacity: 0.85; outline: 2px solid #f59e0b; }