/* ==========================================
   HARDBEAT PRO - GLOBAL STYLE (FINAL NEON)
   ========================================== */

:root {
    --bg-color: #0d0d0d;
    --panel-color: #1a1a1a;
    --accent-color: #00f3ff; /* Cyan Néon */
    --led-off: #330000;
    --led-on: #ff0000;
    --accent-on: #ffaa00; /* Orange */
    --accent-off: #332200;
    --grid-gap: 8px;
    --col-width: 55px;
}

body {
    background-color: var(--bg-color);
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

#rack-container {
    width: 1050px;
    background: var(--panel-color);
    border: 3px solid #333;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border-top: 5px solid #444;
}

/* --- HEADER --- */
#master-control {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #333; padding-bottom: 20px; margin-bottom: 20px;
}
.logo { 
    font-size: 24px; font-weight: bold; letter-spacing: 3px; 
    color: var(--accent-color); text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); 
}
#master-play-stop {
    background: #222; color: #fff; border: 2px solid var(--accent-color);
    padding: 10px 30px; cursor: pointer; font-weight: bold; transition: all 0.2s;
}
#master-play-stop:hover { background: var(--accent-color); color: #000; }

.rack-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid #222; padding: 15px; margin-bottom: 20px; border-radius: 4px;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
h2 { margin: 0; font-size: 14px; text-transform: uppercase; color: #888; letter-spacing: 1px; }

/* --- GRID & ACCENTS --- */
.step-grid, .freq-sliders-container {
    display: grid;
    grid-template-columns: repeat(16, var(--col-width));
    gap: var(--grid-gap);
    justify-content: center;
    margin: 10px 0;
}

.step-column {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.step-pad {
    width: 50px; height: 50px;
    background: linear-gradient(145deg, #222, #111);
    border: 1px solid #333; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: border 0.1s; position: relative;
}
.step-pad:hover { border-color: var(--accent-color); }
.step-pad.active { background: #333; border-color: #555; }

/* Styles pour les pas désactivés (Polyrythmie) */
.step-pad.disabled {
    opacity: 0.2; pointer-events: none; border-color: #222; background: #111;
}
.step-pad.disabled .led { background: #110000; }
.step-pad.disabled span { color: #444 !important; }

.led {
    width: 8px; height: 8px; background: var(--led-off);
    border-radius: 50%; box-shadow: inset 0 0 3px rgba(0,0,0,0.8);
}
.step-pad span {
    position: absolute; top: 2px; left: 4px; font-size: 9px;
    font-family: 'Courier New', monospace; font-weight: bold; color: #fff !important;
    opacity: 0.6; pointer-events: none; z-index: 2;
}

/* BOUTON ACCENT */
.accent-pad {
    width: 50px; height: 12px;
    background: var(--accent-off);
    border: 1px solid #333;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    transition: background 0.1s;
}
.accent-pad:hover { border-color: #666; }
.accent-pad.active {
    background: var(--accent-on);
    box-shadow: 0 0 8px var(--accent-on);
    border-color: #ffcc00;
}

/* --- TRACK UNITS (MUTE / SOLO / SELECT) --- */
.track-selectors {
    display: flex; align-items: center; gap: 8px; margin: 10px 0; height: 55px;
}
.track-unit { display: flex; gap: 2px; }
.ms-group { display: flex; flex-direction: column; width: 20px; }

.btn-mute, .btn-solo {
    height: 50%; border: 1px solid #333; background: #111;
    color: #555; font-size: 9px; cursor: pointer; padding: 0; font-weight: bold;
}
.btn-mute:hover { color: #fff; }
.btn-mute.active { background: #cc0000; color: #fff; border-color: #ff0000; }
.btn-solo:hover { color: #fff; }
.btn-solo.active { background: #00cc00; color: #000; border-color: #00ff00; }

.track-btn {
    background: #222; border: 1px solid #444; color: #888;
    padding: 0 12px; font-size: 11px; cursor: pointer; height: 100%; width: 50px;
}
.track-btn.active, .page-btn.active {
    border-color: var(--accent-color); color: var(--accent-color); background: #002a2d;
}
.page-btn { background: #222; border: 1px solid #444; color: #888; padding: 5px 12px; font-size: 11px; cursor: pointer; }

/* --- PARAMETRES --- */
#instruments-params-container {
    display: flex; flex-wrap: nowrap; margin-left: 15px;
    border-left: 2px solid #333; padding-left: 15px; align-items: center;
}
.instr-params { display: none; gap: 12px; align-items: center; }
.instr-params .group { display: flex; flex-direction: column; align-items: center; min-width: 55px; }
.instr-params label { font-size: 8px; color: #666; margin-bottom: 2px; text-transform: uppercase; }
.instr-params input[type="range"] { width: 45px !important; cursor: pointer; }
.label-cyan { font-size: 9px; color: var(--accent-color); font-weight: bold; margin-right: 5px; }

/* --- FADERS & HZ LABELS (MODIFIÉ ICI) --- */
.fader-unit { display: flex; flex-direction: column; align-items: center; height: 160px; }
.freq-fader { appearance: slider-vertical; width: 12px; height: 130px; background: #222; cursor: ns-resize; }

/* LE CHANGEMENT EST ICI : CLAIR ET NEON */
.hz-label { 
    font-size: 9px; 
    color: var(--accent-color); /* Cyan */
    margin-bottom: 5px; 
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.4); /* Petite lueur */
}

/* --- SYNTH MASTER --- */
.synth-master-fixed {
    display: flex; gap: 20px; background: #111; padding: 10px;
    border: 1px solid #333; margin-top: 10px; align-items: center; border-radius: 4px;
}
.synth-master-fixed .group label { font-size: 9px; color: #888; text-transform: uppercase; }
.synth-master-fixed input[type="range"] { width: 70px; }

/* --- GLOBAL ACCENT SLIDER --- */
.drum-rack-row { margin-top: 10px; }
.accent-control-unit {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); padding: 10px 5px; border: 1px solid #444; border-radius: 4px; height: auto;
}
.accent-control-unit label {
    font-size: 10px; color: #ffaa00; font-weight: bold; margin-bottom: 8px;
    writing-mode: vertical-rl; transform: rotate(180deg);
}
.accent-control-unit input[type=range] {
    appearance: slider-vertical; width: 8px; height: 100px; background: #333; cursor: ns-resize;
}

/* --- FOOTER --- */
#ui-footer { margin-top: 30px; }
#add-seq-btn {
    width: 100%; padding: 15px; background: #1a1a1a; border: 1px dashed #444;
    color: #666; font-weight: bold; cursor: pointer; transition: all 0.3s;
}
#add-seq-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: #001516; }

.bpm-control { display: flex; align-items: center; gap: 10px; font-size: 12px; }
#display-bpm1, #display-bpm2 {
    color: var(--accent-color); font-weight: bold; font-family: 'Courier New', monospace; cursor: ns-resize;
}
.step-slider { accent-color: #ffffff; }

/* --- FADERS & HZ LABELS (NEON) --- */
.fader-unit { display: flex; flex-direction: column; align-items: center; height: 160px; }
.freq-fader { appearance: slider-vertical; width: 12px; height: 130px; background: #222; cursor: ns-resize; }
.hz-label { 
    font-size: 9px; color: var(--accent-color); margin-bottom: 5px; 
    font-family: 'Courier New', monospace; font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.4);
}

/* --- SYNTH CONTROLS (MUTE & RANDOM) --- */
.synth-controls {
    display: flex; gap: 15px; margin-top: 15px; justify-content: flex-start;
}

/* Bouton Random existant (rappel) */
.btn-random {
    background: #222; border: 1px solid #444; color: #888;
    padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px;
}
.btn-random:hover { background: var(--accent-color); color: #000; }

/* Nouveau Bouton Mute Synth */
.btn-synth-mute {
    background: #222; border: 1px solid #444; color: #888;
    padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px;
    font-weight: bold; transition: all 0.2s;
}
.btn-synth-mute:hover {
    color: #fff; border-color: #666;
}
.btn-synth-mute.active {
    background: #cc0000;
    color: #fff;
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255,0,0,0.3);
}

/* ==========================================
   MEMORY BANK STYLES
   ========================================== */
.memory-bank {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #111;
    padding: 5px 15px;
    border: 1px solid #333;
    border-radius: 4px;
    margin-right: 20px; /* Espace avec le Play Button */
}

/* Bouton SAVE */
.btn-mem-action {
    background: #330000;
    color: #888;
    border: 1px solid #550000;
    padding: 8px 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 10px;
    border-radius: 3px;
    transition: all 0.2s;
}

/* Mode SAVE ACTIF (Clignote Rouge) */
.btn-mem-action.saving {
    background: #ff0000;
    color: #fff;
    border-color: #ffaaaa;
    animation: blink-save 0.5s infinite;
}

@keyframes blink-save {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Groupe de Slots 1-2-3-4 */
.slots-group {
    display: flex;
    gap: 5px;
}

.btn-mem-slot {
    width: 25px;
    height: 25px;
    background: #222;
    border: 1px solid #444;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
}

/* Slot qui contient des données (Vert) */
.btn-mem-slot.has-data {
    background: #003300;
    color: #00ff00;
    border-color: #005500;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.2);
}

/* Slot survolé */
.btn-mem-slot:hover {
    border-color: #fff;
    color: #fff;
}

/* Flash de confirmation (utilisé en JS) */
.flash-success {
    background: #fff !important;
    transition: background 0.1s;
}

/* ==========================================
   (RAPPEL DES STYLES PRECEDENTS INDISPENSABLES)
   ========================================== */
/* Je remets ici les styles critiques pour être sûr */
:root { --bg-color: #0d0d0d; --panel-color: #1a1a1a; --accent-color: #00f3ff; --led-off: #330000; --led-on: #ff0000; --accent-on: #ffaa00; --accent-off: #332200; --grid-gap: 8px; --col-width: 55px; }
body { background-color: var(--bg-color); color: #e0e0e0; font-family: 'Segoe UI', sans-serif; margin: 0; padding: 20px; display: flex; justify-content: center; }
#rack-container { width: 1050px; background: var(--panel-color); border: 3px solid #333; border-radius: 8px; padding: 25px; box-shadow: 0 0 50px rgba(0,0,0,0.8); border-top: 5px solid #444; }
#master-control { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #333; padding-bottom: 20px; margin-bottom: 20px; }
.logo { font-size: 24px; font-weight: bold; letter-spacing: 3px; color: var(--accent-color); text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
#master-play-stop { background: #222; color: #fff; border: 2px solid var(--accent-color); padding: 10px 30px; cursor: pointer; font-weight: bold; }
#master-play-stop:hover { background: var(--accent-color); color: #000; }
.rack-section { background: rgba(255,255,255,0.02); border: 1px solid #222; padding: 15px; margin-bottom: 20px; border-radius: 4px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.step-grid, .freq-sliders-container { display: grid; grid-template-columns: repeat(16, var(--col-width)); gap: var(--grid-gap); justify-content: center; margin: 10px 0; }
.step-column { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-pad { width: 50px; height: 50px; background: linear-gradient(145deg, #222, #111); border: 1px solid #333; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.step-pad:hover { border-color: var(--accent-color); } .step-pad.active { background: #333; border-color: #555; }
.step-pad.disabled { opacity: 0.2; pointer-events: none; border-color: #222; background: #111; }
.led { width: 8px; height: 8px; background: var(--led-off); border-radius: 50%; }
.step-pad span { position: absolute; top: 2px; left: 4px; font-size: 9px; font-family: 'Courier New'; font-weight: bold; color: #fff !important; opacity: 0.6; pointer-events: none; }
.accent-pad { width: 50px; height: 12px; background: var(--accent-off); border: 1px solid #333; border-radius: 2px; cursor: pointer; }
.accent-pad.active { background: var(--accent-on); box-shadow: 0 0 8px var(--accent-on); border-color: #ffcc00; }
.accent-control-unit { display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); padding: 10px 5px; border: 1px solid #444; border-radius: 4px; height: auto; }
.accent-control-unit label { font-size: 10px; color: #ffaa00; font-weight: bold; margin-bottom: 8px; writing-mode: vertical-rl; transform: rotate(180deg); }
.accent-control-unit input[type=range] { appearance: slider-vertical; width: 8px; height: 100px; background: #333; cursor: ns-resize; }
.track-selectors { display: flex; align-items: center; gap: 8px; margin: 10px 0; height: 55px; }
.track-unit { display: flex; gap: 2px; }
.ms-group { display: flex; flex-direction: column; width: 20px; }
.btn-mute, .btn-solo { height: 50%; border: 1px solid #333; background: #111; color: #555; font-size: 9px; cursor: pointer; padding: 0; font-weight: bold; }
.btn-mute.active { background: #cc0000; color: #fff; border-color: #ff0000; }
.btn-solo.active { background: #00cc00; color: #000; border-color: #00ff00; }
.track-btn { background: #222; border: 1px solid #444; color: #888; padding: 0 12px; font-size: 11px; cursor: pointer; height: 100%; width: 50px; }
.track-btn.active { border-color: var(--accent-color); color: var(--accent-color); background: #002a2d; }
.page-btn { background: #222; border: 1px solid #444; color: #888; padding: 5px 12px; font-size: 11px; cursor: pointer; }
.fader-unit { display: flex; flex-direction: column; align-items: center; height: 160px; }
.freq-fader { appearance: slider-vertical; width: 12px; height: 130px; background: #222; cursor: ns-resize; }
.hz-label { font-size: 9px; color: var(--accent-color); margin-bottom: 5px; font-family: 'Courier New'; font-weight: bold; text-shadow: 0 0 5px rgba(0, 243, 255, 0.4); }
.synth-master-fixed { display: flex; gap: 20px; background: #111; padding: 10px; border: 1px solid #333; margin-top: 10px; align-items: center; border-radius: 4px; }
.synth-master-fixed .group label { font-size: 9px; color: #888; text-transform: uppercase; }
.synth-master-fixed input[type="range"] { width: 70px; }
#ui-footer { margin-top: 30px; }
#add-seq-btn { width: 100%; padding: 15px; background: #1a1a1a; border: 1px dashed #444; color: #666; font-weight: bold; cursor: pointer; transition: all 0.3s; }
#add-seq-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: #001516; }
.bpm-control { display: flex; align-items: center; gap: 10px; font-size: 12px; }
#display-bpm1, #display-bpm2 { color: var(--accent-color); font-weight: bold; font-family: 'Courier New'; cursor: ns-resize; }
.step-slider { accent-color: #ffffff; }
.synth-controls { display: flex; gap: 15px; margin-top: 15px; justify-content: flex-start; }
.btn-random { background: #222; border: 1px solid #444; color: #888; padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px; }
.btn-random:hover { background: var(--accent-color); color: #000; }
.btn-synth-mute { background: #222; border: 1px solid #444; color: #888; padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px; font-weight: bold; transition: all 0.2s; }
.btn-synth-mute.active { background: #cc0000; color: #fff; border-color: #ff0000; box-shadow: 0 0 10px rgba(255,0,0,0.3); }

#btn-clear-all {
    background: #443300;
    color: #ccaa00; /* Or */
    border-color: #665500;
    margin-right: 5px; /* Petit espace avec Save */
}

#btn-clear-all:hover {
    background: #ffcc00;
    color: #000;
    border-color: #ffdd00;
}

#btn-clear-all:active {
    background: #fff;
}

.track-selectors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    height: 65px; /* Un peu plus haut pour loger les 3 boutons confortablement */
}

.track-unit {
    display: flex;
    gap: 2px;
    height: 100%;
}

.ms-group {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 100%;
}

/* Les 3 boutons se partagent la hauteur équitablement */
.btn-mute, .btn-solo, .btn-drum-rand {
    height: 33.33%;
    border: 1px solid #333;
    background: #111;
    color: #555;
    font-size: 8px; /* Un peu plus petit pour le R */
    cursor: pointer;
    padding: 0;
    font-weight: bold;
    transition: all 0.1s;
}

/* MUTE (Rouge) */
.btn-mute:hover { color: #fff; }
.btn-mute.active { background: #cc0000; color: #fff; border-color: #ff0000; }

/* SOLO (Vert) */
.btn-solo:hover { color: #fff; }
.btn-solo.active { background: #00cc00; color: #000; border-color: #00ff00; }

/* RANDOM (Violet/Cyan) */
.btn-drum-rand {
    color: #00f3ff; /* Cyan par défaut */
}
.btn-drum-rand:hover {
    background: #00f3ff;
    color: #000;
}
.btn-drum-rand:active {
    background: #fff;
    color: #000;
}

/* TRACK BTN (Ajustement hauteur) */
.track-btn {
    background: #222;
    border: 1px solid #444;
    color: #888;
    padding: 0 12px;
    font-size: 11px;
    cursor: pointer;
    height: 100%;
    width: 50px;
}
.track-btn.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #002a2d;
}

/* ... (Le reste du CSS : accents, memory bank, faders... inchangé) ... */
.memory-bank { display: flex; gap: 15px; align-items: center; background: #111; padding: 5px 15px; border: 1px solid #333; border-radius: 4px; margin-right: 20px; }
.btn-mem-action { background: #330000; color: #888; border: 1px solid #550000; padding: 8px 12px; font-weight: bold; cursor: pointer; font-size: 10px; border-radius: 3px; transition: all 0.2s; }
.btn-mem-action.saving { background: #ff0000; color: #fff; border-color: #ffaaaa; animation: blink-save 0.5s infinite; }
@keyframes blink-save { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
.slots-group { display: flex; gap: 5px; }
.btn-mem-slot { width: 25px; height: 25px; background: #222; border: 1px solid #444; color: #555; font-size: 11px; font-weight: bold; cursor: pointer; border-radius: 3px; }
.btn-mem-slot.has-data { background: #003300; color: #00ff00; border-color: #005500; box-shadow: 0 0 5px rgba(0, 255, 0, 0.2); }
.btn-mem-slot:hover { border-color: #fff; color: #fff; }
.flash-success { background: #fff !important; transition: background 0.1s; }
#btn-clear-all { background: #443300; color: #ccaa00; border-color: #665500; margin-right: 5px; }
#btn-clear-all:hover { background: #ffcc00; color: #000; border-color: #ffdd00; }
#btn-clear-all:active { background: #fff; }
.synth-controls { display: flex; gap: 15px; margin-top: 15px; justify-content: flex-start; }
.btn-random { background: #222; border: 1px solid #444; color: #888; padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px; }
.btn-random:hover { background: var(--accent-color); color: #000; }
.btn-synth-mute { background: #222; border: 1px solid #444; color: #888; padding: 8px 15px; font-size: 10px; cursor: pointer; letter-spacing: 1px; font-weight: bold; transition: all 0.2s; }
.btn-synth-mute.active { background: #cc0000; color: #fff; border-color: #ff0000; box-shadow: 0 0 10px rgba(255,0,0,0.3); }
.fader-unit { display: flex; flex-direction: column; align-items: center; height: 160px; }
.freq-fader { appearance: slider-vertical; width: 12px; height: 130px; background: #222; cursor: ns-resize; }
.hz-label { font-size: 9px; color: var(--accent-color); margin-bottom: 5px; font-family: 'Courier New', monospace; font-weight: bold; text-shadow: 0 0 5px rgba(0, 243, 255, 0.4); }

/* --- SYSTEME D'AIDE (TOOLTIPS) --- */

/* Le point d'interrogation */
.help-tip {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: #333;
    color: #888;
    border-radius: 50%;
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: 8px;
    border: 1px solid #555;
    position: relative;
}

.help-tip:hover {
    background-color: var(--accent-color);
    color: #000;
    border-color: #fff;
}

/* La bulle de texte (cachée par défaut) */
.help-tip:before {
    content: attr(data-text); /* Prend le texte écrit dans le HTML */
    position: absolute;
    bottom: 25px; /* Au-dessus du point */
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    padding: 10px;
    border-radius: 4px;
    background-color: #000;
    color: #fff;
    font-size: 11px;
    font-family: sans-serif;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0, 243, 255, 0.2);
    display: none; /* Caché */
    z-index: 1000;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
}

/* La petite flèche en bas de la bulle */
.help-tip:after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
    display: none;
    z-index: 1000;
}

/* Affichage au survol */
.help-tip:hover:before, .help-tip:hover:after {
    display: block;
}

/* Nouvelle colonne pour M, S, R et ? */
.track-controls-col {
    display: flex;
    flex-direction: column; /* Empile verticalement */
    align-items: center;    /* CENTRE horizontalement (C'est la clé !) */
    width: 20px;            /* Largeur fixe */
    height: 100%;           /* Prend toute la hauteur */
    gap: 1px;               /* Petit espace entre les boutons */
}

/* Ajustement pour que les boutons prennent bien la place */
.track-controls-col .btn-mute,
.track-controls-col .btn-solo,
.track-controls-col .btn-drum-rand {
    width: 100%;            /* Remplissent la largeur de 20px */
    margin: 0;
    flex-grow: 1;           /* Se partagent la hauteur */
}

/* Petit ajustement pour le ? */
.track-controls-col .help-tip {
    margin: 2px 0 0 0;      /* Un peu d'espace au-dessus, pas à gauche */
    margin-left: 0 !important; /* Force le centrage (annule la marge précédente) */
}
