/* --- GENERAL STYLES --- */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    margin: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

/* --- FLASH OVERLAY (NEW) --- */
#flashOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

/* --- HAMBURGER MENU STYLES --- */
.header-bar {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    padding-top: max(15px, env(safe-area-inset-top) + 10px); 
}

.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.menu-overlay.open { display: block; opacity: 1; }

/* The Sliding Drawer */
.menu-drawer {
    position: fixed; top: 0; left: 0; 
    width: 280px;
    background: #1e1e1e;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    padding: 20px;
    
    /* GLOBAL DRAWER SCROLLING */
    height: 100dvh; 
    box-sizing: border-box;
    display: block; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
}
.menu-drawer.open { transform: translateX(0); }

.menu-header { font-size: 22px; font-weight: bold; margin-bottom: 20px; color: #03dac6; border-bottom: 1px solid #333; padding-bottom: 10px; margin-top: 30px;}
.close-menu-btn {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; color: #888; font-size: 24px; cursor: pointer;
}

/* --- ACCORDION MENU STYLES --- */
.accordion-btn {
    background-color: #252525;
    color: #eee;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    font-weight: bold;
    transition: 0.2s;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}
.accordion-btn.active, .accordion-btn:hover {
    background-color: #333;
}
.accordion-btn:after {
    content: '\002B'; 
    color: #03dac6;
    font-weight: bold;
    float: right;
    margin-left: 5px;
}
.accordion-btn.active:after {
    content: "\2212"; 
}

.accordion-panel {
    padding: 0 5px; 
    background-color: #1e1e1e;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-bottom: 10px;
}

.menu-text { font-size: 14px; line-height: 1.5; color: #ddd; margin-top: 10px; padding: 0 5px; }

/* Saved Songs List Styles */
#savedSongsList { margin-top: 5px; }

.saved-song-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 10px; border-bottom: 1px solid #333; color: #ccc; cursor: pointer;
}
.saved-song-item:last-child { border-bottom: none; }
.saved-song-item:hover { background: #252525; color: #fff; }
.saved-song-name { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delete-song-btn {
    background: none; border: none; color: #ff5252; 
    font-size: 18px; cursor: pointer; padding: 0 10px;
}

/* Sound Radio Buttons */
.sound-option {
    display: flex; align-items: center; gap: 12px; padding: 12px 10px;
    color: #ccc; cursor: pointer; border-bottom: 1px solid #333;
}
.sound-option:last-child { border-bottom: none; }
.sound-option:hover { background: #252525; color: white; }

.sound-option input[type="radio"] {
    width: 20px; height: 20px; accent-color: #03dac6; margin: 0; cursor: pointer;
}
.sound-option span { font-size: 15px; font-weight: 500; }

.coffee-btn {
    display: block; background-color: #FFDD00; color: #000; text-decoration: none;
    padding: 12px; border-radius: 8px; text-align: center; font-weight: bold;
    margin-top: 10px; margin-bottom: 20px; 
}

.version-text {
    text-align: center; font-size: 11px; color: #555; margin-bottom: 40px; font-family: monospace;
}

/* --- TABS --- */
.tabs {
    display: flex; width: 90%; max-width: 340px; margin-top: 60px;
    background: #222; border-radius: 8px; padding: 4px; flex-shrink: 0; z-index: 10;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; background: transparent;
    color: #888; font-weight: bold; font-size: 14px; cursor: pointer; border-radius: 6px;
}
.tab-btn.active { background: #333; color: #03dac6; }

/* --- PANELS --- */
.panel {
    display: none; flex-direction: column; align-items: center;
    width: 100%; flex: 1; padding-top: 20px; overflow-y: auto; padding-bottom: 180px; 
}
.panel.active { display: flex; }

.controls {
    background-color: #1e1e1e; padding: 20px; border-radius: 15px;
    width: 85%; max-width: 320px; text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); margin-bottom: 20px;
    position: relative; z-index: 2;
}

h1 { margin: 0 0 20px 0; font-size: 20px; color: #e0e0e0; }
.row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; color: #aaaaaa; font-size: 12px; }

input[type="number"], select {
    background-color: #333; border: 1px solid #444; color: white;
    padding: 10px; border-radius: 5px; text-align: center;
    font-size: 18px; font-weight: bold; width: 100%; box-sizing: border-box; outline: none;
}
input:focus { border-color: #03dac6; }

.beat-visualizer {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 20px 0; min-height: 30px;
}
.beat-dot {
    width: 20px; height: 20px; background-color: #333;
    border-radius: 50%; cursor: pointer; border: 2px solid #555; transition: transform 0.1s;
}
.beat-dot[data-level="1"] { background-color: #03dac6; border-color: #03dac6; } 
.beat-dot[data-level="2"] { background-color: #ff5252; border-color: #ff5252; } 
.beat-dot.playing { transform: scale(1.3); box-shadow: 0 0 10px white; border-color: #fff; }

/* --- ADVANCED LIST --- */
.step-list { width: 90%; max-width: 340px; position: relative; z-index: 2; }

.count-in-box {
    background: #1a2525; border: 1px solid #033631; 
    border-radius: 8px; padding: 10px; margin-bottom: 20px; position: relative;
}
.count-in-box.disabled { opacity: 0.5; border-color: #333; background: #222; }
.count-in-box.active { border: 2px solid #03dac6; box-shadow: 0 0 15px rgba(3, 218, 198, 0.2); }

.count-in-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
    border-bottom: 1px solid #333; padding-bottom: 5px;
}
.count-in-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: bold; color: #03dac6; }
.count-in-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #03dac6; }

.step-item {
    background: #252525; border-radius: 8px; padding: 10px;
    margin-bottom: 15px; border-left: 4px solid #444; position: relative;
}
.step-item.active { border-left-color: #03dac6; background: #2f2f2f; }

.step-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.step-name-input {
    background: transparent; border: none; color: #ccc; font-weight: bold; font-size: 14px;
    width: 80%; outline: none; padding: 5px 0; border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.step-name-input:focus { border-bottom: 1px solid #03dac6; color: #fff; }
.step-name-input::placeholder { color: #666; }

.delete-btn { color: #ff5252; background: none; border: none; font-size: 20px; font-weight: bold; padding: 0 10px; cursor: pointer;}

.step-inputs { display: flex; gap: 5px; margin-bottom: 10px; }
.step-input-group { flex: 1; }
.step-input-group label { font-size: 10px; margin-bottom: 2px;}
.step-input-group input, .step-input-group select { font-size: 14px; padding: 5px; height: 35px; }

/* Container voor de bolletjes: centreren en meer ruimte */
.step-accents { 
    display: flex; 
    gap: 10px;               /* Meer tussenruimte (was 5px) */
    flex-wrap: wrap; 
    justify-content: center; /* Centreert de bolletjes in het midden */
    padding-top: 10px; 
    border-top: 1px solid #333; 
    margin-top: 8px;
}

/* De bolletjes zelf: groter en makkelijker te raken */
.mini-dot { 
    width: 22px;             /* Groter (was 15px) */
    height: 22px;            /* Groter (was 15px) */
    border-radius: 50%; 
    border: 1px solid #555; 
    background: #333; 
    cursor: pointer; 
    transition: all 0.1s; 
    flex-shrink: 0;          /* Zorgt dat ze niet 'geplet' worden op kleine schermen */
}

/* Kleuren en speel-status blijven hetzelfde */
.mini-dot[data-level="1"] { background-color: #03dac6; border-color: #03dac6; }
.mini-dot[data-level="2"] { background-color: #ff5252; border-color: #ff5252; }
.mini-dot.playing {
    transform: scale(1.3);   /* Iets subtielere schaal (was 1.5) omdat ze nu al groter zijn */
    box-shadow: 0 0 10px white; 
    border-color: #fff; 
    z-index: 10;
}

.add-btn {
    background: #333; color: #fff; border: 1px dashed #666; cursor: pointer;
    width: 100%; padding: 15px; border-radius: 8px; margin-top: 10px; font-weight: bold;
}

/* ACTION BUTTONS */
.action-btn-container { display: flex; gap: 10px; margin-top: 15px; }
.secondary-btn {
    flex: 1; background: #333; color: #ccc; border: 2px solid #444; 
    cursor: pointer; padding: 15px; border-radius: 8px; font-weight: bold;
    display: flex; align-items: center; justify-content: center; gap: 5px; transition: 0.2s;
}
.secondary-btn:hover { background: #444; color: #fff; }
.btn-save { border-color: #033631; color: #03dac6; }
.btn-save:hover { background: #033631; }
.btn-reset { border-color: #555; color: #aaa; }
.btn-reset:hover { background: #444; border-color: #666; color: #fff;}

.repeat-wrapper {
    margin-top: 25px; width: 90%; max-width: 340px;
    display: flex; align-items: center; gap: 10px;
    background: #252525; padding: 12px; border-radius: 8px;
    border-top: 2px solid #444;
    position: relative; z-index: 2;
}
.repeat-wrapper input { width: 22px; height: 22px; accent-color: #03dac6; margin: 0; }
.repeat-wrapper label { font-size: 15px; color: #fff; margin: 0; cursor: pointer; font-weight: bold; }

.status-display {
    position: fixed; top: 70px; left: 0; width: 100%; text-align: center;
    pointer-events: none; z-index: 10;
}
.status-text {
    background: rgba(0,0,0,0.85); padding: 5px 15px; border-radius: 20px;
    font-size: 14px; color: #03dac6; font-weight: bold;
}
.huge-counter { font-size: 40px; font-weight: 900; color: #fff; text-shadow: 0 2px 10px #000; }

.main-btn-container { position: fixed; bottom: 20px; width: 85%; max-width: 320px; z-index: 100; }
button#mainActionBtn {
    background-color: #03dac6; color: #000; border: none;
    padding: 15px; font-size: 20px; border-radius: 50px; cursor: pointer;
    width: 100%; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
button#mainActionBtn.stop { background-color: #ff5252; color: white; }

/* --- TAP TEMPO BUTTON --- */
.tap-btn {
    background: transparent;
    border: 2px solid #444;
    color: #888;
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tap-btn:active, .tap-btn.active {
    border-color: #03dac6;
    color: #fff;
    background-color: rgba(3, 218, 198, 0.1);
    transform: scale(0.98);
}

/* --- TEMPO DROPDOWN (AANGEPAST) --- */
.tempo-dropdown {
    width: 100%;           /* Volle breedte */
    margin-top: 0px;       /* Reset */
    margin-bottom: 5px;    /* Ruimte aan de onderkant */
    background-color: transparent; /* Transparant oogt strakker op deze plek */
    color: #03dac6;        /* Accentkleur */
    border: 1px solid #333;
    border-radius: 8px;    /* Iets ronder */
    padding: 8px;          /* Iets meer lucht */
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    text-align-last: center; 
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    text-transform: uppercase; /* Hoofdletters staat vaak netter voor labels */
    letter-spacing: 1px;
}

.tempo-dropdown:focus {
    border-color: #03dac6;
    background-color: #1e1e1e;
}
