/* TR-808 Drum Machine Styles */
:root {
    --main-bg-color: #222;
    --panel-bg-color: #333;
    --drum-machine-color: #f0f0f0;
    --accent-color: #ff5252;
    --secondary-color: #ff9800;
    --step-inactive: #444;
    --step-active: #ff5252;
    --step-playing: #ff9800;
    --knob-color: #ddd;
    --track-height: 60px;
    --knob-size: 80px;
    
    /* Doffere versies van de kleuren */
    --step-color-1: #c93945; /* Doffer rood */
    --step-color-2: #e08245; /* Doffer oranje */
    --step-color-3: #e9ad39; /* Doffer geel */
    --step-color-4: #d4d4d4; /* Doffer gebroken wit */
}

html, body {
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--main-bg-color);
    color: var(--drum-machine-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--panel-bg-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.transport-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 30px;
}

.tempo-control, .saturation-control, .swing-control, .clear-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 30px;
}

.tempo-control, .swing-control {
    position: relative;
    width: var(--knob-size);
    height: var(--knob-size);
    margin: 25px 0 35px;
}

.tempo-control {
    margin-right: 10px;
    margin-left: 20px;
}

.swing-control {
    margin-left: 30px;
}

/* Saturation control sectie rechts positioneren en vertikaal maken */
.saturation-control {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px; /* Meer ruimte rechts toegevoegd */
    min-width: 140px;
    justify-content: center; /* Centreer verticaal om op dezelfde hoogte te komen als andere knoppen */
}

.tempo-control label, .swing-control label {
    position: absolute;
    top: -25px;
    width: 100%;
    text-align: center;
    font-weight: bold;
}

.tempo-knob, .swing-knob {
    position: relative;
    width: 100%;
    height: 100%;
}

.knob {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #444, #222);
    border: 4px solid #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    --rotation: 0deg; /* Default rotation for middle value */
    touch-action: none;
}

.knob::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 40%;
    background-color: var(--accent-color);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(var(--rotation));
    border-radius: 2px;
}

.tempo-value, .swing-value {
    position: absolute;
    bottom: -30px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 20;
}

/* Hide the original range input but keep it functional */
.tempo-control input[type="range"], .swing-control input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    touch-action: none;
}

input[type="range"] {
    width: 200px;
    margin: 10px 0;
    -webkit-appearance: none;
    background: var(--panel-bg-color);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--knob-color);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button {
    padding: 8px 16px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    background-color: var(--step-inactive);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background-color: var(--accent-color);
}

button.active {
    background-color: var(--accent-color);
}

/* Play/Stop knoppen */
.play, .stop {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* Zorgt ervoor dat alles binnen de ronde vorm blijft */
    position: relative; /* Voor goede positionering van elementen erin */
}

.play {
    background-color: #4CAF50; /* Groene kleur in plaats van rood */
}

.play:hover {
    background-color: #45a049; /* Donkerdere groene kleur bij hover */
}

/* Donkerder groen wanneer in pauze-modus */
.play[data-state="pause"] {
    background-color: #3b8e3f; /* Donkerder groen voor pauze status */
}

.play[data-state="pause"]:hover {
    background-color: #327a36; /* Nog donkerder bij hover in pauze status */
}

.play-icon, .pause-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pauze-icoon styling - verbetering voor dikkere strepen */
.pause-icon {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.pause-icon::before,
.pause-icon::after {
    content: "";
    position: absolute;
    height: 40%;
    width: 6px;
    background-color: white;
    border-radius: 3px;
}

.pause-icon::before {
    left: calc(50% - 10px);
}

.pause-icon::after {
    right: calc(50% - 10px);
}

/* Wanneer de knop in pause-state is, toon dan het pause icoon */
.play[data-state="pause"] .play-icon {
    display: none;
}

.play[data-state="pause"] .pause-icon {
    display: flex;
}

.stop {
    background-color: #666;
}

.stop:hover:not(:disabled) {
    background-color: #888;
}

/* Stijl voor de disabled stop-knop */
.stop:disabled {
    background-color: #444;
    cursor: not-allowed;
    box-shadow: none;
}

.stop:disabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

/* Verwijder de oude stijl die een vierkante overlay veroorzaakte */
.stop:disabled .stop-icon {
    opacity: 1;
}

.stop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Mode buttons verticaal stapelen */
.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.mode-buttons .tooltip {
    width: 100%;
}

/* Styling voor saturation knoppen - gebaseerd op pattern control knoppen */
#mode-clean, #mode-sat, #mode-sat2 {
    width: 100%;
    min-width: 150px; /* Vergroot de breedte voor langere tekst */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

/* Kleuren voor de saturation knoppen */
#mode-clean, #mode-sat, #mode-sat2 {
    background-color: #777;
}

/* Hover states */
#mode-clean:hover, #mode-sat:hover, #mode-sat2:hover {
    filter: brightness(1.1);
}

/* Active state styling - verbeterde visuele feedback */
.mode-buttons button.active {
    background-color: #FF8800; /* Oranje kleur in TR-808 stijl */
    box-shadow: 0 0 10px rgba(255, 136, 0, 0.7);
    color: white;
    font-weight: bold;
    border: 2px solid white;
    position: relative;
}

/* Verwijder het vinkje */
/* Icon indicator voor actieve knop */
/* .mode-buttons button.active::before {
    content: "✓";
    position: absolute;
    left: 10px;
    font-size: 14px;
    color: white;
} */

/* Niet-actieve knoppen krijgen een andere kleur en styling */
#mode-clean:not(.active), #mode-sat:not(.active), #mode-sat2:not(.active) {
    background-color: #555;
    border: 2px solid transparent;
    font-weight: normal;
}

/* Voor responsive schermen */
@media (max-width: 1024px) {
    .saturation-control {
        min-width: 120px;
    }
}

.sequencer-container {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 20px;
    overflow-x: hidden; /* Geen horizontaal scrollen */
    overflow-y: hidden; /* Geen verticaal scrollen */
}

/* Drum track styling */
.drum-track {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    height: var(--track-height);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0 10px;
}

.track-controls {
    display: flex;
    align-items: center;
    width: 320px;
    padding-right: 20px;
}

.track-name {
    width: 50px;
    font-weight: bold;
    text-align: center;
    margin-right: 20px;
    min-width: 50px;
    flex: 0 0 50px; /* Vaste breedte: flex-grow: 0, flex-shrink: 0, flex-basis: 50px */
    cursor: pointer; /* Laat zien dat het klikbaar is */
    user-select: none; /* Voorkomt selecteren van tekst bij klikken */
    position: relative; /* Voor positionering van het mute-icoon */
    transition: color 0.2s; /* Soepele overgang voor kleurverandering */
}

/* Styling voor gemute track names */
.track-name.muted {
    color: #888; /* Grijze kleur voor gemute tracks */
}

/* Mute icoon */
.mute-icon {
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    font-size: 10px; /* Klein icoon */
    opacity: 0; /* Standaard onzichtbaar */
    transition: opacity 0.2s;
}

/* Toon mute icoon alleen wanneer gemute */
.track-name.muted .mute-icon {
    opacity: 1; /* Maak zichtbaar wanneer gemute */
}

.track-settings {
    display: flex;
    align-items: center;
    flex: 1;
    width: 100%;
}

.volume-control {
    display: flex;
    align-items: center;
    margin-right: 15px;
    width: 95px;
    flex: 0 0 95px;
}

.volume-control label {
    margin-right: 5px;
    min-width: 25px;
    flex: 0 0 25px;
}

.volume-control input {
    width: 65px;
    flex: 1;
}

.sample-selector {
    display: flex;
    align-items: center;
    width: 130px;
    flex: 0 0 130px;
    margin-right: 10px;
}

.sample-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.sample-controls label {
    min-width: 58px;
    flex: 0 0 58px;
    margin-right: 0;
}

.sample-controls select {
    background-color: var(--panel-bg-color);
    color: white;
    border: 1px solid #555;
    padding: 3px;
    border-radius: 3px;
    width: 45px;
    text-align: center;
    font-size: 14px;
}

.preview-button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background-color: #4CAF50; /* Groene kleur */
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.preview-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Step sequencer styling */
.steps, .accent-steps {
    display: flex;
    flex: 1;
    margin-left: 10px;
    padding: 0;
    gap: 0;
    width: 100%;
    overflow: visible; /* Voorkom dat steps worden afgeknipt */
}

.step, .accent-step {
    height: 40px;
    margin: 0 2px;
    flex: 1 1 0%;
    background-color: var(--step-inactive);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

/* Verschillende kleuren voor elke 4 stappen */
.step[data-step="0"],
.step[data-step="1"],
.step[data-step="2"],
.step[data-step="3"] {
    background-color: var(--step-color-1);
}

.step[data-step="4"],
.step[data-step="5"],
.step[data-step="6"],
.step[data-step="7"] {
    background-color: var(--step-color-2);
}

.step[data-step="8"],
.step[data-step="9"],
.step[data-step="10"],
.step[data-step="11"] {
    background-color: var(--step-color-3);
}

.step[data-step="12"],
.step[data-step="13"],
.step[data-step="14"],
.step[data-step="15"] {
    background-color: var(--step-color-4);
}

/* Indicator voor stappen (zowel actief als inactief) */
.step::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background-color: #111;
    border-radius: 50%;
    border: 2px solid #000;
}

.step.active::before {
    background-color: #ff3333;
    box-shadow: 0 0 8px 2px rgba(255, 51, 51, 0.9);
    border: 2px solid #000;
}

.step.playing {
    opacity: 0.7;
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: #999;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .track-controls {
        width: 180px;
    }
}

/* Rotatie suggestie voor mobiele apparaten in portrait mode */
.rotate-device-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.rotate-device-message.visible {
    display: flex;
}

.rotate-device-message a {
    color: var(--accent-color);
    text-decoration: underline;
    margin-top: 10px;
}

.rotate-device-message a:hover {
    color: #ff8282;
}

.rotate-icon {
    font-size: 70px;
    margin-bottom: 20px;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(90deg);
    }
}

/* Verwijder automatische weergave op basis van oriëntatie, we gebruiken nu JavaScript */
@media (max-width: 1024px) and (orientation: portrait) {
    /* Verberg de container alleen op de hoofdpagina, niet op de documentatiepagina */
    body:not(.documentation) .container {
        display: none;
    }
}

/* Mobiele weergave - Landscape mode (gedraaide telefoon/tablet) */
@media (max-width: 1024px) and (orientation: landscape) {
    body {
        padding: 5px;
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    header h1 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    /* Maak de controls compacter */
    .controls {
        padding: 8px;
        margin-bottom: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .transport-controls {
        flex-direction: column; /* Zet terug naar column om knoppen boven elkaar te houden */
        margin-right: 15px;
        position: relative;
        left: -40px; /* Verplaats de transport knoppen verder naar links op mobiele apparaten (was -20px) */
    }
    
    /* Maak de knoppen kleiner en dicht op elkaar */
    .play, .stop {
        width: 45px;
        height: 45px;
        margin: 3px; /* Kleinere margin zodat ze dichter bij elkaar staan */
    }
    
    /* Maak de knoppen kleiner */
    :root {
        --knob-size: 50px;
        --track-height: 40px;
    }
    
    .tempo-control, .swing-control {
        margin: 20px 10px 20px;
    }
    
    .tempo-control label, .swing-control label {
        top: -20px;
        font-size: 12px;
    }
    
    .tempo-value, .swing-value {
        bottom: -20px;
        font-size: 12px;
    }
    
    .saturation-control {
        margin: 5px;
    }
    
    .mode-buttons {
        margin-top: 5px;
    }
    
    button {
        padding: 4px 8px;
        font-size: 12px;
        margin: 2px;
    }
    
    /* Pas de sequencer aan */
    .sequencer-container {
        padding: 10px;
    }
    
    .drum-track {
        height: var(--track-height);
        margin-bottom: 5px;
        padding: 0 5px;
    }
    
    /* Compactere track controls voor tablet */
    .track-controls {
        width: 210px;
        padding-right: 5px;
    }
    
    .track-name {
        width: 28px;
        min-width: 28px;
        flex: 0 0 28px;
        margin-right: 5px;
        font-size: 12px;
    }
    
    .volume-control {
        width: 72px;
        flex: 0 0 72px;
        margin-right: 5px;
    }
    
    .sample-selector {
        width: 90px;
        flex: 0 0 90px;
        margin-right: 15px;
    }
    
    /* Meer ruimte tussen controls en steps */
    .steps {
        margin-left: 10px;
    }
    
    .preview-button {
        margin-right: 2px;
    }
    
    .sample-controls label {
        min-width: 35px;
        flex: 0 0 35px;
        font-size: 12px;
    }

    .sample-controls select {
        width: 42px;
        font-size: 12px;
    }
    
    .step {
        height: 30px;
        margin: 0 1px;
    }
    
    .step::before {
        top: 7px;
        width: 8px;
        height: 8px;
        border-width: 1px;
    }
    
    /* Pas de footer aan */
    footer {
        margin-top: 20px;
        font-size: 11px;
        padding: 10px 0;
    }
    
    .clear-control, .history-controls {
        margin: 5px 15px 15px;
    }
    
    .history-controls {
        gap: 3px;
    }
    
    .pattern-controls {
        margin: 5px 15px;
    }
    
    .control-button {
        min-width: 120px;
        padding: 6px;
        font-size: 12px;
    }
    
    .preview-button {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Extra aanpassingen voor zeer smalle schermen (kleine smartphones in landscape) */
@media (max-width: 640px) and (orientation: landscape) {
    :root {
        --knob-size: 40px;
        --track-height: 30px;
    }
    
    body {
        padding: 2px;
    }
    
    .container {
        padding: 5px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    /* Compactere track controls */
    .track-controls {
        width: 150px;
        padding-right: 0;
        margin-right: 2px;
    }
    
    /* Track naam verkleinen */
    .track-name {
        width: 20px;
        min-width: 20px;
        flex: 0 0 20px;
        margin-right: 2px;
        font-size: 10px;
        padding: 0;
    }
    
    /* Volume control verder verkleinen */
    .volume-control {
        width: 45px;
        flex: 0 0 45px;
        margin-right: 2px;
    }
    
    .volume-control label {
        min-width: 15px;
        flex: 0 0 15px;
        font-size: 10px;
    }
    
    .volume-control input {
        width: 30px;
    }
    
    /* Sample selector aanpassen */
    .sample-selector {
        width: 68px;
        flex: 0 0 68px;
        margin-right: 25px; /* Veel meer ruimte tussen selector en steps */
        position: relative;
        left: -3px; /* Verschuif naar links */
    }
    
    .sample-controls {
        gap: 2px;
    }
    
    .sample-controls label {
        min-width: 18px;
        flex: 0 0 18px;
        font-size: 10px;
    }

    .sample-controls select {
        width: 32px;
        font-size: 10px;
        padding: 2px;
        position: relative;
        left: -2px; /* Verschuif dropdown naar links */
    }
    
    /* Meer ruimte maken voor de steps */
    .steps {
        margin-left: 32px; /* Veel meer ruimte links van de steps */
    }
    
    /* Preview knop verder verkleinen */
    .preview-button {
        width: 14px;
        height: 14px;
        font-size: 7px;
        margin-right: 5px;
        position: relative;
        left: -3px; /* Verschuif preview knop naar links */
    }
    
    .step {
        height: 25px;
    }
    
    .step::before {
        top: 5px;
        width: 6px;
        height: 6px;
    }
    
    .pattern-controls {
        margin: 2px 10px;
        gap: 2px;
    }
    
    .control-button {
        min-width: 100px;
        padding: 5px;
        font-size: 11px;
    }
    
    .transport-controls {
        left: -45px; /* Verplaats de transport knoppen nog meer naar links op kleinere apparaten (was -25px) */
    }
}

/* Extra aanpassingen voor extreem kleine smartphone schermen */
@media (max-width: 480px) and (orientation: landscape) {
    .track-controls {
        width: 140px;
    }
    
    .track-name {
        width: 18px;
        min-width: 18px;
        flex: 0 0 18px;
        margin-right: 1px;
        font-size: 9px;
    }
    
    .volume-control {
        width: 36px;
        flex: 0 0 36px;
        margin-right: 1px;
    }
    
    .volume-control label {
        min-width: 13px;
        flex: 0 0 13px;
        font-size: 9px;
    }
    
    .volume-control input {
        width: 22px;
    }
    
    .sample-selector {
        width: 65px;
        flex: 0 0 65px;
        margin-right: 30px; /* Nog meer ruimte bij zeer kleine schermen */
        position: relative;
        left: -5px; /* Verschuif naar links */
    }
    
    .steps {
        margin-left: 40px; /* Meer ruimte tussen controls en steps */
    }
    
    .step {
        height: 22px;
        margin: 0 1px;
    }
    
    .step::before {
        top: 4px;
        width: 5px;
        height: 5px;
    }
    
    .sample-controls label {
        min-width: 16px;
        flex: 0 0 16px;
        font-size: 9px;
    }
}

/* Extra aanpassingen voor de allerkleinste smartphones */
@media (max-width: 400px) and (orientation: landscape) {
    .track-controls {
        width: 130px;
    }
    
    .track-name {
        width: 16px;
        min-width: 16px;
        flex: 0 0 16px;
        margin-right: 1px;
        font-size: 8px;
    }
    
    .volume-control {
        width: 30px;
        flex: 0 0 30px;
        margin-right: 0;
    }
    
    .volume-control label {
        min-width: 10px;
        flex: 0 0 10px;
        font-size: 7px;
    }
    
    .volume-control input {
        width: 19px;
    }
    
    .sample-selector {
        width: 60px;
        flex: 0 0 60px;
        margin-right: 35px; /* Extreme ruimte rechts voor kleinste schermen */
        position: relative;
        left: -8px; /* Verschuif naar links */
    }
    
    .sample-controls {
        gap: 1px;
    }
    
    .sample-controls label {
        min-width: 13px;
        flex: 0 0 13px;
        font-size: 7px;
    }
    
    .sample-controls select {
        width: 24px;
        font-size: 7px;
        padding: 0;
        position: relative;
        left: -2px; /* Verschuif dropdown naar links */
    }
    
    .preview-button {
        width: 8px;
        height: 8px;
        font-size: 4px;
        margin-right: 15px;
        position: relative;
        left: -5px; /* Verschuif preview knop naar links */
    }
    
    .steps {
        margin-left: 52px; /* Extreem veel ruimte voor de steps */
    }
    
    .step {
        height: 20px;
        margin: 0 1px;
    }
    
    .step::before {
        top: 3px;
        width: 4px;
        height: 4px;
    }
}

/* Extra aanpassingen voor zeer smalle telefoons (320px en kleiner) */
@media (max-width: 350px) and (orientation: landscape) {
    .track-controls {
        width: 120px;
    }
    
    .track-name {
        width: 14px;
        min-width: 14px;
        flex: 0 0 14px;
        font-size: 7px;
    }
    
    .volume-control {
        width: 26px;
        flex: 0 0 26px;
    }
    
    .volume-control label {
        min-width: 8px;
        flex: 0 0 8px;
        font-size: 6px;
    }
    
    .volume-control input {
        width: 16px;
    }
    
    .sample-selector {
        width: 55px;
        flex: 0 0 55px;
        margin-right: 40px; /* Extreme ruimte rechts voor kleinste schermen */
        position: relative;
        left: -10px; /* Verschuif naar links */
    }
    
    .sample-controls label {
        min-width: 11px;
        flex: 0 0 11px;
        font-size: 6px;
    }
    
    .sample-controls select {
        width: 22px;
        font-size: 7px;
        position: relative;
        left: -3px; /* Verschuif dropdown naar links */
    }
    
    .preview-button {
        width: 8px;
        height: 8px;
        font-size: 4px;
        margin-right: 18px;
        position: relative;
        left: -7px; /* Verschuif preview knop naar links */
    }
    
    .steps {
        margin-left: 62px; /* Extreme ruimte voor de steps */
    }
    
    .step {
        height: 18px;
        margin: 0 1px;
    }
    
    .step::before {
        top: 3px;
        width: 4px;
        height: 4px;
    }
}

/* Extreme aanpassingen voor de allerkleinste telefoons (tot 320px) */
@media (max-width: 320px) and (orientation: landscape) {
    .track-controls {
        width: 110px;
    }
    
    .track-name {
        width: 12px;
        min-width: 12px;
        flex: 0 0 12px;
        font-size: 6px;
    }
    
    .volume-control {
        width: 22px;
        flex: 0 0 22px;
    }
    
    .volume-control label {
        min-width: 6px;
        flex: 0 0 6px;
        font-size: 5px;
    }
    
    .volume-control input {
        width: 14px;
    }
    
    .sample-selector {
        width: 52px;
        flex: 0 0 52px;
        margin-right: 42px;
        position: relative;
        left: -13px;
    }
    
    .sample-controls label {
        min-width: 10px;
        flex: 0 0 10px;
        font-size: 6px;
    }
    
    .sample-controls select {
        width: 20px;
        font-size: 6px;
        position: relative;
        left: -4px;
    }
    
    .preview-button {
        width: 7px;
        height: 7px;
        font-size: 3px;
        margin-right: 22px;
        position: relative;
        left: -10px;
    }
    
    .steps {
        margin-left: 70px; /* Extreme ruimte voor de steps */
    }
    
    .step {
        height: 16px;
        margin: 0 1px;
    }
    
    .step::before {
        top: 2px;
        width: 3px;
        height: 3px;
    }
}

.clear-control {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 30px 30px;
}

.clear {
    background-color: #9e9e9e;
    transition: all 0.2s;
}

.clear:hover {
    background-color: #ff5252;
}

/* Tooltips styling - basisstijl aangepast voor betere positionering */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    opacity: 0;
    width: 220px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 200;
    bottom: 150%; /* Verhoogd van 125% naar 150% voor meer afstand */
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s;
    font-size: 13px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    margin-bottom: 10px; /* Extra marge toegevoegd */
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

/* Tooltip positions */
.tooltip-top {
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-bottom {
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-left {
    top: 50%;
    right: 125%;
    transform: translateY(-50%);
}

.tooltip-right {
    top: 50%;
    left: 125%;
    transform: translateY(-50%);
}

/* Only show tooltips on non-touch devices on hover after delay */
@media (hover: hover) {
    .tooltip:hover .tooltiptext {
        visibility: visible;
        opacity: 1;
        transition-delay: 0.7s;
    }
}

/* Ensure tooltips are hidden on touch devices */
@media (hover: none) {
    .tooltip .tooltiptext {
        display: none;
    }
}

/* Tooltip position adjustments for specific elements */
.tempo-control .tooltiptext,
.swing-control .tooltiptext,
.clear-control .tooltiptext {
    bottom: auto;
    left: 100%; /* Verplaatst naar rechts van het element */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
    margin-left: 20px; /* Ruimte tussen element en tooltip */
    text-align: left;
}

/* Pijl aanpassen voor tooltips aan de rechterkant */
.tempo-control .tooltiptext::after,
.swing-control .tooltiptext::after,
.clear-control .tooltiptext::after {
    top: 50%;
    left: -10px;
    margin-left: 0;
    margin-top: -5px;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
}

/* Tooltips voor tempo knoppen (+ en -) */
.tempo-buttons-wrapper .tooltip .tooltiptext {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: auto;
    right: auto;
    transform: translate(30px, -50%); /* 30px rechts van de muis */
    margin-top: 0;
    margin-left: 0;
    width: 200px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    z-index: 9999;
}

/* Accent label tooltip - rechts van de muis */
.accent-label .tooltiptext {
    width: 280px;
    left: 100%;
    right: auto;
    margin-left: 20px;
    transform: none;
    text-align: left;
    bottom: auto;
    top: 0;
}

.accent-label .tooltiptext::after {
    top: 15px;
    left: -10px;
    margin-left: 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
    transform: rotate(180deg);
}

/* Tooltips voor Play en Stop knoppen (rechts plaatsen) */
.transport-controls .tooltip .tooltiptext {
    bottom: auto;
    top: 0;
    left: 100%;
    right: auto;
    margin-left: 20px;
    transform: none;
    text-align: left;
}

.transport-controls .tooltip .tooltiptext::after {
    top: 15px;
    left: -10px;
    margin-left: 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
    transform: rotate(180deg);
}

/* Verplaats de tooltips voor track elementen naar een positie rechts van de muis */
.track-name .tooltiptext {
    width: 280px;
    left: 100%;
    right: auto;
    margin-left: 20px; /* Afstand van het element (rechts van de muis) */
    transform: none;
    text-align: left;
    bottom: auto;
    top: 0;
}

.track-name .tooltiptext::after {
    top: 15px;
    left: -10px;
    margin-left: 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
    transform: rotate(180deg);
}

.volume-control .tooltiptext {
    width: 240px;
    bottom: auto;
    top: 0;
    text-align: left;
    left: 100%;
    right: auto;
    margin-left: 20px; /* Afstand van het element (rechts van de muis) */
    transform: none;
}

.volume-control .tooltiptext::after {
    top: 15px;
    left: -10px;
    margin-left: 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
    transform: rotate(180deg);
}

.sample-selector .tooltiptext {
    width: 240px;
    bottom: auto;
    top: 0;
    text-align: left;
    left: 100%;
    right: auto;
    margin-left: 20px; /* Afstand van het element (rechts van de muis) */
    transform: none;
}

.sample-selector .tooltiptext::after {
    top: 15px;
    left: -10px;
    margin-left: 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
    transform: rotate(180deg);
}

/* Verwijder steps tooltip stijlen, we gebruiken geen tooltips voor de steps meer */
/* 
.steps .tooltiptext {
    width: 250px;
    bottom: auto;
    top: -45px;
    right: 20px;
    left: auto;
    transform: none;
    text-align: left;
}

.steps .tooltiptext::after {
    left: auto;
    right: 20px;
    margin-left: 0;
}
*/

/* Herstel de tempo en swing waarden positie */
.tempo-value, .swing-value {
    position: absolute;
    bottom: -30px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 20;
}

/* History Controls (Undo/Redo) */
.history-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 30px 30px;
    gap: 5px;
}

.history-controls button {
    width: 100%;
    min-width: 120px; /* Zelfde breedte als clear button */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.undo {
    background-color: #607D8B; /* Grijsblauw */
    transition: all 0.2s;
}

.redo {
    background-color: #689F38; /* Grijsgroen */
    transition: all 0.2s;
}

.undo:hover:not(:disabled) {
    background-color: #455A64; /* Donkerder grijsblauw */
}

.redo:hover:not(:disabled) {
    background-color: #558B2F; /* Donkerder grijsgroen */
}

/* LED styling voor undo/redo knoppen */
.undo .led, .redo .led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--led-inactive);
    transition: background-color 0.2s;
}

.undo.active .led, .redo.active .led {
    background-color: var(--led-active);
    box-shadow: 0 0 5px var(--led-active);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pattern controls (Clear Pattern, Undo, Redo) */
.pattern-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.pattern-controls .tooltip, .save-load-controls .tooltip {
    width: 100%;
}

.control-button {
    background-color: #515151;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    width: 100%;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.control-button:hover {
    background-color: #666;
}

/* Clear Pattern knop */
.clear {
    background-color: #FFA000; /* Amber kleur */
    transition: all 0.2s;
}

.clear:hover {
    background-color: #FF8F00; /* Donkerder amber bij hover */
}

/* Undo knop */
.undo {
    background-color: #607D8B; /* Blauwgrijs */
    transition: all 0.2s;
}

.undo:hover:not(:disabled) {
    background-color: #455A64; /* Donkerder blauwgrijs bij hover */
}

/* Redo knop */
.redo {
    background-color: #689F38; /* Groen */
    transition: all 0.2s;
}

.redo:hover:not(:disabled) {
    background-color: #558B2F; /* Donkerder groen bij hover */
}

/* Verbeterde disabled state voor alle knoppen */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

/* Overlay effect voor disabled knoppen */
button:disabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Verwijder oude LED-gerelateerde stijlen */
.control-button .led,
.control-button.active .led {
    display: none;
}

.clear-control, .history-controls {
    display: none; /* Verberg oude stijlen */
}

.save {
    background-color: #2E7D32;
}

.save:hover {
    background-color: #388E3C;
}

.load {
    background-color: #1565C0;
}

.load:hover {
    background-color: #1976D2;
}

.help {
    background-color: #7B1FA2;
}

.help:hover {
    background-color: #9C27B0;
}

/* Voor telefoons in portrait mode met voldoende breedte */
@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
    /* Toon de interface toch, zelfs in portrait mode */
    .rotate-device-message {
        display: none;
    }
    
    .container {
        display: block;
        max-width: 100%;
        padding: 10px;
    }
    
    body {
        padding: 5px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    /* Maak de track controls kleiner om te zorgen dat ze passen */
    .track-controls {
        width: 200px;
    }
    
    .sample-selector {
        margin-right: 20px;
    }
    
    .steps {
        margin-left: 20px;
    }
    
    /* Verklein de step size */
    .step {
        height: 30px;
        margin: 0 1px;
    }
}

/* About Section Styling */
.about-section {
    background-color: var(--background-color-lighter);
    padding: 30px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.about-section h2 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 24px;
}

.about-section p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-color-secondary);
}

.about-section ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.about-section li {
    margin-bottom: 8px;
    color: var(--text-color-secondary);
}

.about-section strong {
    color: var(--accent-color);
}

/* Enhanced Footer Styling */
footer {
    background-color: var(--background-color-darker);
    color: var(--text-color-secondary);
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    line-height: 1.5;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--highlight-color);
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--background-color-lighter);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: var(--border-color);
    text-decoration: none;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.copyright a {
    color: var(--accent-color);
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

/* Mobile Responsive Adjustments for New Sections */
@media (max-width: 1024px) {
    .about-section {
        padding: 20px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        margin-bottom: 25px;
    }
}

@media (max-width: 640px) {
    .about-section h2 {
        font-size: 20px;
    }
    
    .about-section {
        padding: 15px;
    }
    
    .social-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* Tempo buttons styling - verticaal links van de knop */
.tempo-buttons-wrapper {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    gap: 8px;
    z-index: 20;
}

.tempo-knob {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.tempo-button {
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    background-color: var(--step-inactive);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent; /* Verwijder highlight op mobiel */
    user-select: none; /* Voorkom selectie bij snel tappen */
}

.tempo-button:hover {
    background-color: var(--accent-color);
}

.tempo-button:active {
    transform: scale(0.95);
}

/* Verbeter touch interactie op de knoppen */
.knob {
    touch-action: none;
}

.tempo-control input[type="range"] {
    touch-action: none;
}

/* Media query voor kleinere schermen */
@media (max-width: 768px) {
    .tempo-buttons-wrapper {
        left: -40px; /* Wijziging van -30px naar -40px, verder naar links */
    }

    .tempo-button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Extra media query voor mobiele apparaten */
@media (max-width: 1024px) and (orientation: landscape) {
    .tempo-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .tempo-buttons-wrapper {
        left: -45px; /* Nieuwe regel: zet knoppen nog verder naar links op telefoons */
    }
}

/* Verwijder de oude tempo-controls-wrapper stijlen */
.tempo-controls-wrapper {
    display: none;
}

/* Save Pattern knop */
.save {
    background-color: #3F51B5; /* Indigo kleur */
    transition: all 0.2s;
}

.save:hover:not(:disabled) {
    background-color: #303F9F; /* Donkerder indigo bij hover */
}

/* Load Pattern knop */
.load {
    background-color: #009688; /* Teal kleur */
    transition: all 0.2s;
}

.load:hover:not(:disabled) {
    background-color: #00796B; /* Donkerder teal bij hover */
}

/* Container voor de knoppen (flexbox row layout) */
.pattern-controls-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 0 20px;
}

/* Save/Load controls */
.save-load-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

/* Voor kleinere schermen, zorg dat knoppen goed worden gestapeld */
@media (max-width: 768px) {
    .pattern-controls-container {
        flex-direction: column;
        gap: 5px;
    }
    
    .pattern-controls, .save-load-controls {
        width: 100%;
    }
}

/* Accent track styling */
.accent-track {
    height: var(--track-height);
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 0 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: visible; /* Voorkom dat steps worden afgeknipt */
}

.accent-label {
    width: 50px;
    font-weight: bold;
    text-align: center;
    margin-right: 20px;
    min-width: 50px;
    flex: 0 0 50px;
    color: #ffcc00; /* Goudkleurig voor de accent label */
}

/* Container voor lege ruimte die normaal door controls wordt gebruikt */
.accent-spacer {
    width: 250px; /* Iets breder om de rij meer naar rechts te verschuiven */
    flex: 0 0 250px;
}

/* Stijl voor geaccentueerde steps (steps met accent) */
.step.accented.active {
    background-color: #4488ff; /* Blauw voor geaccentueerde steps */
    box-shadow: 0 0 8px rgba(68, 136, 255, 0.7);
}

/* Verschillende kleuren voor elke 4 geaccentueerde steps */
.step.accented.active[data-step="0"],
.step.accented.active[data-step="1"],
.step.accented.active[data-step="2"],
.step.accented.active[data-step="3"] {
    background-color: #4488ff;
}

.step.accented.active[data-step="4"],
.step.accented.active[data-step="5"],
.step.accented.active[data-step="6"],
.step.accented.active[data-step="7"] {
    background-color: #5599ff;
}

.step.accented.active[data-step="8"],
.step.accented.active[data-step="9"],
.step.accented.active[data-step="10"],
.step.accented.active[data-step="11"] {
    background-color: #66aaff;
}

.step.accented.active[data-step="12"],
.step.accented.active[data-step="13"],
.step.accented.active[data-step="14"],
.step.accented.active[data-step="15"] {
    background-color: #77bbff;
}

/* Accent step specifieke stijlen */
.accent-step.active {
    background-color: #ffaa00; /* Goudkleurig voor geactiveerde accent steps */
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.7);
}

.accent-step.playing {
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.9);
}

.accent-step {
    min-width: calc((100% - 32px) / 18); /* Smaller than normal steps for desktop */
    width: calc((100% - 32px) / 18); /* Smaller than normal steps for desktop */
}

/* Voor tablets en smartphones - maak accent steps dunner en verschuif naar links */
@media (max-width: 1024px) {
    .accent-step {
        min-width: calc((100% - 32px) / 16.8); /* Perfecte breedte tussen te dik (16.5) en te dun (17) */
        width: calc((100% - 32px) / 16.8); /* Perfecte breedte tussen te dik (16.5) en te dun (17) */
    }
    
    /* Kleiner maken voor meer ruimte en verder naar links schuiven */
    .accent-spacer {
        width: 130px;
        flex: 0 0 130px;
    }
}

/* Voor kleinere smartphones - maak accent steps nog dunner en verschuif verder naar links */
@media (max-width: 768px) {
    .accent-step {
        min-width: calc((100% - 32px) / 18.84); /* Specifieke breedte op verzoek */
        width: calc((100% - 32px) / 18.84); /* Specifieke breedte op verzoek */
    }
    
    /* Nog kleiner maken voor kleinere schermen */
    .accent-spacer {
        width: 90px;
        flex: 0 0 90px;
    }
}

/* Voor zeer kleine smartphones - verschuif accent steps extreem ver naar links */
@media (max-width: 640px) {
    .accent-spacer {
        width: 70px;
        flex: 0 0 70px;
    }
}

/* Read more box styling */
.read-more-box {
    text-align: left;
    margin: 25px 0 10px;
}

.read-more-box a {
    display: inline-block;
    background-color: var(--accent-color); /* Rood van de rest van de pagina */
    color: white;
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.read-more-box a:hover {
    background-color: #ff3333; /* Lichtere rode tint bij hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Recording controls styling */
.recording-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.record-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--main-bg-color);
    border: 2px solid #ff3333;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.record-button:hover {
    background-color: rgba(255, 51, 51, 0.2);
}

.record-button.recording {
    background-color: #ff3333;
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.7);
    animation: pulse 1.5s infinite;
}

.record-icon {
    color: #ff3333;
    font-size: 24px;
}

.record-button.recording .record-icon {
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 51, 51, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0);
    }
}

/* Mobile styling voor record knop */
@media (max-width: 768px) {
    .record-button {
        width: 45px;
        height: 45px;
    }
    
    .record-icon {
        font-size: 20px;
    }
}

/* New Recording Section Styling */
.recording-section {
    background-color: var(--step-bg-color);
    border: 2px solid var(--control-border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.recording-section h3 {
    color: var(--heading-color);
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.recording-section p {
    color: var(--text-color);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 20px;
}
.recording-options {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.quality-settings {
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.quality-settings label {
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.quality-settings select {
    background-color: var(--main-bg-color);
    color: var(--text-color);
    border: 1px solid var(--control-border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    height: 40px;
    width: 100%;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.quality-settings select:hover, 
.quality-settings select:focus {
    border-color: var(--accent-color);
}

.recording-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.recording-buttons-container {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.recording-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.button-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-color);
    margin-top: 5px;
}

.stop-record-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--main-bg-color);
    border: 2px solid #e0e0e0;  /* Gebroken wit border */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.stop-record-button:hover:not(:disabled) {
    background-color: rgba(224, 224, 224, 0.2);  /* Gebroken wit hover */
}

.stop-record-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(224, 224, 224, 0.5);
    border-radius: 50%;
    overflow: hidden;
}

.stop-icon {
    color: #e0e0e0;  /* Gebroken wit icoon */
    font-size: 24px;  /* Dezelfde grootte als record-icon */
}

.recording-info {
    background-color: rgba(255, 255, 200, 0.2);
    border: 1px solid rgba(255, 200, 0, 0.3);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.recording-info p {
    color: var(--text-color);
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
}

.recording-info strong {
    color: #ff7700;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .recording-options {
        flex-direction: column;
    }
    
    .quality-settings {
        width: 100%;
    }
    
    .recording-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .recording-section h3 {
        font-size: 1.2rem;
    }
    
    .recording-section p {
        font-size: 0.9rem;
    }
}

.record-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 51, 51, 0.5);
    border-radius: 50%;
    overflow: hidden;
}

/* Documentation page responsive behavior - always show in portrait mode */
.docs-container {
    display: block !important;
}

@media (max-width: 1024px) and (orientation: portrait) {
    body.documentation {
        overflow-y: auto;
    }
    
    .docs-container {
        display: block !important;
        overflow-y: auto;
        max-height: none;
    }
}

/* Documentation page mobile optimizations */
@media (max-width: 768px) {
    .docs-container {
        padding: 15px;
    }
    
    .docs-image {
        max-width: 100%;
        height: auto;
    }
    
    .docs-section {
        margin-bottom: 25px;
    }
    
    .docs-table {
        font-size: 14px;
    }
    
    .docs-table th, 
    .docs-table td {
        padding: 8px 5px;
    }
}

/* Documentation Page Specific Styles */
.documentation .container {
    display: block !important;
    overflow-x: auto;
    max-width: 100%;
}

.documentation .rotate-device-message {
    display: none !important;
}

/* Verbeteringen voor mobiele apparaten */
@media (max-width: 1024px) {
    .docs-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    .docs-image {
        max-width: 100%;
        height: auto;
    }
    
    .docs-section {
        margin-bottom: 20px;
    }
    
    .docs-table {
        font-size: 14px;
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .docs-container {
        padding: 8px;
    }
    
    .docs-section h2 {
        font-size: 20px;
    }
    
    .docs-section h3 {
        font-size: 18px;
    }
    
    .docs-table {
        font-size: 12px;
    }
}

/* Waiting text for recording end */
.waiting-text {
    color: #ff4444;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 500;
    padding: 8px;
    background-color: rgba(255, 68, 68, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Record button styling */
.record-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--main-bg-color);
    border: 2px solid #ff3333;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

/* Step Mode Section Styling */
.step-mode-section {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 15px;
}

.step-mode-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.step-count-buttons {
    display: flex;
    gap: 8px;
}

.step-count-button {
    background-color: #444;
    color: #ddd;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 80px;
}

.step-count-button:hover {
    background-color: #555;
}

.step-count-button.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.5);
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-nav-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #444;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.page-nav-button:hover:not(:disabled) {
    background-color: #666;
}

.page-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.page-nav-button:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.page-indicator {
    background-color: rgba(0, 0, 0, 0.25);
    padding: 6px 14px;
    border-radius: 4px;
    color: #eee;
    font-weight: bold;
    font-size: 16px;
    min-width: 50px;
    text-align: center;
}

.nav-icon {
    font-size: 18px;
    line-height: 1;
}

/* Auto-scroll toggle styling */
.auto-scroll-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-scroll-toggle label {
    color: #eee;
    font-size: 14px;
    cursor: pointer;
}

.auto-scroll-toggle input[type="checkbox"] {
    position: relative;
    width: 36px;
    height: 18px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    outline: none;
    border-radius: 10px;
    transition: .5s;
    cursor: pointer;
}

.auto-scroll-toggle input:checked[type="checkbox"] {
    background: var(--accent-color);
}

.auto-scroll-toggle input[type="checkbox"]:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    background: #ddd;
    transition: .5s;
}

.auto-scroll-toggle input:checked[type="checkbox"]:before {
    left: 19px;
}

.auto-scroll-toggle input:disabled[type="checkbox"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Current step highlight for step page */
.step.current-page {
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Current step during playback */
.step.playing {
    opacity: 0.7;
    box-shadow: 0 0 5px var(--step-playing);
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .step-mode-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .step-count-buttons {
        justify-content: center;
    }
    
    .page-navigation {
        justify-content: center;
        margin-top: 8px;
    }
}

/* Nieuwe CSS voor de step-mode sectie tooltips */
.step-mode-section .tooltip .tooltiptext {
    position: fixed; /* Verander naar fixed positioning voor step-mode section tooltips */
    margin-top: -50px; /* Extra ruimte aan de bovenkant */
    z-index: 9999; /* Garandeert dat tooltips altijd boven alles verschijnen */
}

/* Zorg dat de step-count-buttons tooltips goed gepositioneerd worden */
.step-count-buttons .tooltip .tooltiptext {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: auto;
    right: auto;
    transform: translate(30px, -50%); /* Plaats 30px rechts van de muis en centreer verticaal */
    margin-top: 0;
    margin-left: 0;
    width: 250px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    z-index: 9999;
}

/* Pijl aan de linkerkant voor step-count-buttons tooltips */
.step-count-buttons .tooltip .tooltiptext::after {
    top: 50%;
    left: -10px;
    margin-left: 0;
    margin-top: -5px; /* Centreer de pijl verticaal */
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
}

/* Tooltips voor page navigation en auto-scroll */
.page-navigation .tooltip .tooltiptext,
.auto-scroll-toggle .tooltiptext {
    position: fixed;
    top: auto;
    bottom: auto;
    margin-top: -60px; /* Iets meer ruimte aan de bovenkant */
    width: 240px; /* Bredere tooltip voor betere leesbaarheid */
    font-size: 13px;
    line-height: 1.4;
}

/* Specifieke stijl voor de page-indicator tooltip */
.page-navigation .tooltip:nth-child(2) .tooltiptext {
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Voorkom dat meerdere tooltips tegelijk verschijnen bij de tempo controls */
.tempo-control > .tooltiptext {
    display: none;
}

.tempo-control:hover > .tooltiptext {
    display: block;
}

/* Verberg de hoofdtooltip wanneer er over een tempo knop wordt gezweefd */
.tempo-buttons-wrapper:hover ~ .tooltiptext {
    display: none !important;
}

.tempo-knob:hover ~ .tooltiptext {
    display: none !important;
}

/* Verberg andere tooltips wanneer er over één tooltip wordt gezweefd */
.tempo-buttons-wrapper .tooltip:hover ~ .tooltip .tooltiptext {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Tooltips voor recording buttons (start/stop record) */
.recording-button-group .tooltip .tooltiptext {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: auto;
    right: auto;
    transform: translate(30px, -50%); /* 30px rechts van de muispointer */
    margin-top: 0;
    margin-left: 0;
    width: 250px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    z-index: 9999;
}

/* Pijl aan de linkerkant voor recording button tooltips */
.recording-button-group .tooltip .tooltiptext::after {
    top: 50%;
    left: -10px;
    margin-left: 0;
    margin-top: -5px;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
}

/* Styling for the MIDI Export Section */
.midi-export-section {
    background-color: var(--step-bg-color);
    border: 2px solid var(--control-border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.midi-export-section h3 {
    color: var(--heading-color);
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.midi-export-section p {
    color: var(--text-color);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 20px;
}

.midi-export-options {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.midi-export-selector {
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.midi-export-selector label {
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.midi-export-selector select {
    background-color: var(--main-bg-color);
    color: var(--text-color);
    border: 1px solid var(--control-border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    height: 40px;
    width: 100%;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.midi-export-selector select:hover, 
.midi-export-selector select:focus {
    border-color: var(--accent-color);
}

.midi-export-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-midi-button {
    background-color: #4CAF50; /* Green color for MIDI export */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.export-midi-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.export-midi-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.export-icon {
    font-size: 1.2rem;
}

.midi-export-info {
    background-color: rgba(200, 255, 200, 0.2);
    border: 1px solid rgba(0, 200, 0, 0.3);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.midi-export-info p {
    color: var(--text-color);
    font-size: 0.85rem;
    margin: 0;
    margin-bottom: 5px;
    text-align: center;
}

.midi-export-info p:last-child {
    margin-bottom: 0;
}

.midi-export-info strong {
    color: #4CAF50;
}

/* Tooltip for MIDI export button */
.midi-export-button-container .tooltip .tooltiptext {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: auto;
    right: auto;
    transform: translate(30px, -50%); /* 30px rechts van de muispointer */
    margin-top: 0;
    margin-left: 0;
    width: 250px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    z-index: 9999;
}

/* Pijl aan de linkerkant voor MIDI export tooltip */
.midi-export-button-container .tooltip .tooltiptext::after {
    top: 50%;
    left: -10px;
    margin-left: 0;
    margin-top: -5px;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .midi-export-options {
        flex-direction: column;
    }
    
    .midi-export-selector {
        width: 100%;
    }
    
    .midi-export-button-container {
        width: 100%;
    }
}