/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Define CSS Variables */
:root {
    /* Dark Theme Colors (default) */
    --bg-primary: #1a1a1a; /* Main background, footer, header gradient end */
    --bg-secondary: #2d2d2d; /* Header gradient start, controls, sections, modal */
    --text-primary: #ffffff; /* Main text color */
    --text-secondary: #ccc; /* Subtitle, labels, info text */
    --accent-primary: #ff6b35; /* Primary accent (orange) */
    --accent-hover: #f7931e; /* Accent hover */
    --border-color: #333; /* General borders, sliders, inputs */
    --border-hover: #555; /* Hover/active borders */
    --button-dark-bg: #333; /* Buttons with dark background */
    --button-dark-hover: #555; /* Hover for dark buttons */
    --input-bg: #333; /* Input backgrounds */
    --page-dot-inactive: #555; /* Page indicator dots */
    
    /* Specific active/state colors (usually remain same across themes for consistency) */
    --red-active: #e74c3c;
    --red-active-dark: #c0392b;
    --blue-button: #3498db;
    --blue-button-hover: #2980b9;
    --playing-step: #f1c40f;
    --yellow-active: #f39c12;
    --purple-label: #9b59b6;
    --green-active: #27ae60;

    /* Shadow colors (can be simplified if needed) */
    --shadow-dark: rgba(0,0,0,0.3);
    --shadow-dark-medium: rgba(0,0,0,0.5);
    --shadow-accent: rgba(255,107,53,0.3);
    --shadow-accent-strong: rgba(255,107,53,0.4);
    --shadow-blue: rgba(52,152,219,0.3);
    --shadow-blue-strong: rgba(52,152,219,0.4);
    --shadow-red: rgba(231,76,60,0.3);
    --shadow-playing: rgba(241,196,15,0.7);
    --shadow-green: rgba(39, 174, 96, 0.3);
}

/* Light Theme overrides */
body.light-theme {
    --bg-primary: #e0e0e0; /* Lighter background */
    --bg-secondary: #ffffff; /* Even lighter for sections/controls */
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-primary: #007bff; /* Blue accent */
    --accent-hover: #0056b3; /* Darker blue */
    --border-color: #bbbbbb; /* Lighter border */
    --border-hover: #999999;
    --button-dark-bg: #f5f5f5; /* Light grey buttons */
    --button-dark-hover: #e8e8e8; /* Slightly darker hover */
    --input-bg: #ffffff; /* White input background */
    --page-dot-inactive: #cccccc; /* Lighter page dots */
    
    /* Adjust gradients for light theme to use light theme colors */
    .header, .transport-controls, .pattern-length-section, .bottom-nav, .burger-menu {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    }
}

/* Base styles using variables */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary); /* Use variable */
    color: var(--text-primary); /* Use variable */
    overflow-x: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    padding-top: 70px; /* Add padding to prevent content from going under the fixed header */
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); /* Use variables */
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color); /* Use variable */
    box-shadow: 0 2px 10px var(--shadow-dark);
    position: fixed; /* Make header fixed */
    top: 0; /* Position at the top */
    width: 100%; /* Take full width */
    z-index: 100; /* Ensure it stays on top of other content */
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary); /* Use variable */
    text-shadow: 2px 2px 4px var(--shadow-dark-medium);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary); /* Use variable */
    margin-top: 0.2rem;
}

.btn-menu {
    background: var(--button-dark-bg); /* Use variable */
    border: none;
    color: var(--text-primary); /* Use variable */
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-menu:hover {
    background: var(--button-dark-hover); /* Use variable */
    transform: scale(1.05);
}

/* Main content / View container */
.view-container {
    flex: 1; /* Takes up available vertical space */
    position: relative;
    overflow-y: hidden; /* Hide overflow for the container itself, sections will manage their own scroll */
}

.section {
    width: 100%;
    height: 100%;
    padding: 1rem; /* Padding for all sections */
    overflow-y: auto; /* Allow individual sections to scroll */
    display: none;
    flex-direction: column;
    box-sizing: border-box; /* Ensure padding is included in width/height */
}

.section.active {
    display: flex;
}

/* Styles for the sequencer section */
.sequencer-section {
    /* No additional styles needed here beyond what .section provides,
       as its content already has specific styling */
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.back-btn {
    background: var(--button-dark-bg);
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--button-dark-hover);
    transform: scale(1.05);
}

/* Transport controls */
.transport-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-dark);
    gap: 0.5rem;
}

.transport-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-accent);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transport-btn.export-btn {
    background: linear-gradient(135deg, var(--blue-button) 0%, var(--blue-button-hover) 100%);
    box-shadow: 0 4px 15px var(--shadow-blue);
}

.transport-btn.export-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-blue-strong);
}

.transport-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-accent-strong);
}

.transport-btn.playing {
    background: linear-gradient(135deg, var(--red-active) 0%, var(--red-active-dark) 100%);
    box-shadow: 0 4px 15px var(--shadow-red);
}

.tempo-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 0.5rem;
}

.tempo-control label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

#tempoSlider {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

#tempoSlider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-accent);
}

#tempoValue {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-top: 0.5rem;
}

/* Pattern Length Control styles */
.pattern-length-section {
    display: flex;
    flex-direction: column; /* Changed to column to stack elements */
    align-items: center; /* Center horizontally */
    gap: 0.5rem; /* Reduced gap */
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-dark);
}

/* New wrapper for length selector and navigation buttons to put them on one line */
.pattern-top-row {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between the length control and navigation buttons */
    justify-content: center; /* Center the items within this row */
    width: 100%; /* Take full width of parent to assist with centering */
}

.pattern-length-control {
    display: flex; /* Ensure label and select are inline */
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#patternLengthSelect {
    background: var(--input-bg);
    border: 2px solid var(--border-hover);
    color: var(--text-primary);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    padding-right: 2em;
}

body.light-theme #patternLengthSelect {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

#patternLengthSelect:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.sequencer-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* Sequencer grid */
.sequencer-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sample-import {
    background: var(--button-dark-bg);
    border: 2px solid var(--border-hover);
    border-radius: 6px;
    padding: 0.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

.sample-import:hover {
    background: var(--button-dark-hover);
    border-color: var(--accent-primary);
}

.sample-import input[type="file"] {
    display: none;
}

.track-label {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-dark);
}

.track-label.kick { background: var(--red-active); }
.track-label.snare { background: var(--blue-button); }
.track-label.hihat { background: var(--yellow-active); }
.track-label.openhat { background: var(--purple-label); }

.track-label.muted {
    opacity: 0.5;
    text-decoration: line-through;
}

.step-buttons {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.step-btn {
    background: var(--button-dark-bg);
    border: 2px solid var(--border-hover);
    border-radius: 8px;
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex:1;
    min-height: 40px;
}

.step-btn:hover {
    background: var(--button-dark-hover);
    transform: scale(1.05);
}

.step-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--shadow-accent);
}

.step-btn.playing {
    background: var(--playing-step);
    border-color: var(--playing-step);
    box-shadow: 0 0 20px var(--shadow-playing);
    animation: pulse 0.2s ease-in-out;
}

.step-btn.beat-emphasis {
    background: #2a2a2a;
    border-color: #444;
}

.step-btn.beat-emphasis:hover {
    background: #333;
    transform: scale(1.05);
}

.step-btn.beat-emphasis.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--shadow-accent);
}

.step-btn.beat-emphasis.playing {
    background: var(--playing-step);
    border-color: var(--playing-step);
    box-shadow: 0 0 20px var(--shadow-playing);
    animation: pulse 0.2s ease-in-out;
}

body.light-theme .step-btn.beat-emphasis {
    background: #d0d0d0;
    border-color: #aaa;
}

body.light-theme .step-btn.beat-emphasis:hover {
    background: #c0c0c0;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Pattern controls */
.pattern-controls {
    display: none;
}

/* Action buttons under sequencer */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.action-buttons .action-btn {
    background: var(--button-dark-bg);
    border: none;
    color: var(--text-primary);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .action-btn:hover {
    transform: scale(1.1);
    background: var(--button-dark-hover);
    box-shadow: 0 6px 20px var(--shadow-dark-medium);
}

.action-buttons .action-btn:active {
    transform: scale(0.95);
}

.action-buttons .action-icon {
    font-size: 0.9rem;
}

/* Hide original floating actions */
.floating-actions {
    display: none;
}

/* Mixer */
.mixer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.channel-strip {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.channel-label {
    font-weight: bold;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.channel-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 60px;
}

.control-slider {
    flex: 1;
    margin: 0 1rem;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--shadow-accent);
}

.control-value {
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: center;
    font-size: 0.9rem;
}

.mute-btn, .solo-btn {
    background: var(--button-dark-bg);
    border: 2px solid var(--border-hover);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: bold;
}

.mute-btn:hover, .solo-btn:hover {
    border-color: var(--accent-primary);
}

.mute-btn.active {
    background: var(--red-active);
    border-color: var(--red-active);
    color: white;
}

.solo-btn.active {
    background: var(--yellow-active);
    border-color: var(--yellow-active);
    color: white;
}

/* Effects */
.effects-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.effect-control {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.effect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.effect-title {
    font-weight: bold;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.effect-toggle {
    background: var(--button-dark-bg);
    border: 2px solid var(--border-hover);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: bold;
}

.effect-toggle:hover {
    border-color: var(--accent-primary);
}

.effect-toggle.active {
    background: var(--green-active);
    border-color: var(--green-active);
    color: white;
}

.effect-params {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.param-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.param-slider {
    flex: 1;
    margin: 0 1rem;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.param-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--shadow-accent);
}

.param-value {
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: center;
    font-size: 0.9rem;
}

/* Settings */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.setting-item label {
    font-weight: bold;
    color: var(--accent-primary);
}

.install-btn, .info-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.install-btn:hover, .info-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

#themeSelect {
    background: var(--input-bg);
    border: 2px solid var(--border-hover);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    padding-right: 2em;
}

body.light-theme #themeSelect {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

/* Bottom navigation */
.bottom-nav {
    display: flex;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-top: 2px solid var(--border-color);
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px var(--shadow-dark);
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.05);
}

.nav-btn.active {
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    display: flex; /* Make footer a flex container */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
    flex-wrap: wrap; /* Allow items to wrap if screen is too narrow */
    gap: 0.5rem; /* Space between items */
    min-height: auto; /* Adjust height dynamically based on content */
}

.version-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-text a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: bold;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 8px 32px var(--shadow-dark-medium);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--accent-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-body {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-btn.cancel {
    background: var(--button-dark-bg);
    color: var(--text-primary);
}

.modal-btn.cancel:hover {
    background: var(--button-dark-hover);
}

.modal-btn.confirm {
    background: var(--accent-primary);
    color: white;
}

.modal-btn.confirm:hover {
    background: var(--accent-hover);
}

/* Styles for help modal content - make lists readable */
.modal-body ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.modal-body ul ul {
    list-style-type: circle;
    margin-left: 15px;
    font-size: 0.95em;
}

.modal-body h3, .modal-body h4 {
    color: var(--accent-primary);
    margin-top: 15px;
    margin-bottom: 8px;
}

.modal-body p {
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .transport-controls {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .transport-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .tempo-control {
        margin: 0;
        width: auto;
    }
    
    .track-info {
        gap: 0.3rem;
    }
    
    .track-label {
        min-width: 50px;
        font-size: 0.8rem;
    }
    
    .sample-import {
        font-size: 0.7rem;
        padding: 0.25rem;
    }
    
    .step-position-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .step-nav-btn {
        background: var(--button-dark-bg);
        border: none;
        color: var(--text-primary);
        padding: 0.4rem 0.8rem;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }
    
    .step-nav-btn:hover {
        background: var(--button-dark-hover);
        border-color: var(--accent-primary);
        transform: translateY(-2px);
    }
    
    .step-indicator {
        font-size: 1rem;
        color: var(--text-secondary);
        margin: 0 0.5rem;
    }
    
    .nav-label {
        font-size: 0.6rem;
    }
}

/* Prevenir pull-to-refresh */
body {
    overscroll-behavior: contain;
}

/* Prevenir zoom */
input, textarea, select {
    font-size: 16px;
}

.controls-header {
    position: relative;
}

.burger-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-dark);
    z-index: 100;
    min-width: 200px;
    display: none;
}

.burger-menu.active {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.menu-item:hover {
    background: var(--button-dark-bg);
}

.menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.menu-item:last-child {
    border-radius: 0 0 6px 6px;
}

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

.menu-text {
    font-size: 0.9rem;
    font-weight: bold;
}

.play-control-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.metronome-btn {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--button-dark-bg);
    border: 2px solid var(--border-hover);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    z-index: 2;
}

.metronome-btn:hover {
    background: var(--button-dark-hover);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.metronome-btn.active {
    background: var(--green-active);
    border-color: var(--green-active);
    color: white;
    box-shadow: 0 0 10px var(--shadow-green);
}

.metronome-icon {
    font-size: 0.7rem;
}

/* Remove the separate step-navigation styles since they're now part of pattern-length-section */
.step-navigation {
    display: none;
}

/* New styles for page indicators */
.page-indicators {
    display: flex;
    gap: 5px;
    margin-top: 10px; /* Space from the step navigation buttons */
    justify-content: center; /* Center the dots */
}

.page-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--page-dot-inactive);
    border: 1px solid var(--border-hover);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-dot:hover {
    background-color: var(--button-dark-hover);
}

.page-dot.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--shadow-accent);
}

/* Style for step indicator inside step-position-controls */
.step-position-controls .step-indicator {
    display: none; 
}