/* Light Theme for DNA Music Generator */

:root {
    --light-bg: #ffffff;
    --light-bg-secondary: #f7f7f7;
    --light-border: #e0e0e0;
    --light-text-primary: #333333;
    --light-text-secondary: #666666;
    --light-accent: #4CAF50; /* Green */
    --light-accent-hover: #45a049;
    --light-button: #4CAF50;
    --light-button-hover: #45a049;
    --light-button-disabled: #cccccc;
    --light-slider-track: #e0e0e0;
    --light-slider-thumb: #4CAF50;
    --light-code-bg: #f5f5f5;
    --light-code-border: #e0e0e0;
    --light-melody-color: #2e7d32; /* Dark Green */
    --light-rhythm-color: #6a1b9a; /* Purple */
    --light-vu-meter-bg: #1a1a1a;
    --light-input-bg: #ffffff;
    --light-hover: rgba(0, 0, 0, 0.05);
    --secondary-bg-color: rgba(0, 0, 0, 0.05);
    --warning-color: #ff9800; /* Yellow/orange color */
    --warning-color-dark: #ffb74d; /* Lighter yellow/orange for dark theme */
}

/* Dark theme CSS variables */
body.dark-theme {
    --secondary-bg-color: rgba(255, 255, 255, 0.1);
}

/* Reset body styles */
body {
    font-family: Arial, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--light-bg);
    color: var(--light-text-primary);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Add a wrapper for the entire content */
.content-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
}

/* Main container */
.container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Remove any conflicting container styles */
.container .container {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Update all panels to use consistent width and centering */
.playback-panel,
.sampler-controls-panel,
.genetic-code-tables-section,
.synthesizer-controls-panel,
.music-generator-controls-panel,
.effects-section,
.noise-section,
.sampler-section {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Ensure sampler iframe container respects max-width */
.sampler-iframe-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px; /* Increased from 12px */
    padding: 10px 0; /* Added vertical padding */
    border-bottom: 1px solid var(--light-border);
    background-color: var(--light-bg-secondary);
}

.site-title {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased from 10px */
}

.site-logo {
    height: 76px; /* Doubled from 38px */
    width: auto;
    vertical-align: middle;
    margin-left: 10px; /* Add space before the logo */
    margin-right: 5px; /* Balance spacing */
}

.title-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.chromatone-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: #9370DB; /* Medium Purple */
    line-height: 1.1;
}

h1 {
    margin: 0;
    color: var(--light-accent);
    font-size: 1.6rem; /* Smaller than Chromatone title */
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--light-text-secondary);
}

section {
    margin-bottom: 2px;
}

.file-upload {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.file-upload div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

input[type="file"] {
    padding: 8px;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    background-color: var(--light-input-bg);
}

/* File name display styles */
.file-name-display {
    font-size: 0.9em;
    color: var(--light-text-secondary);
    margin-top: 4px;
    padding: 4px 8px;
    background-color: var(--light-bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 3px;
    min-height: 1.2em;
    word-break: break-all;
    font-weight: bold;
}

.melody-column .file-name-display {
    border-left: 3px solid var(--light-melody-color);
    color: var(--light-melody-color);
}

.rhythm-column .file-name-display {
    border-left: 3px solid var(--light-rhythm-color);
    color: var(--light-rhythm-color);
}

body.dark-theme .file-name-display {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
    font-weight: bold;
}

body.dark-theme .melody-column .file-name-display {
    color: var(--dark-melody-color);
}

body.dark-theme .rhythm-column .file-name-display {
    color: var(--dark-rhythm-color);
}

.sequence-display-section {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    position: relative;
    margin-top: 20px;
    margin-bottom: 0;
}

.sequence-display-section::before {
    content: attr(data-title);
    position: absolute;
    top: -20px;
    left: 0;
    font-weight: bold;
    font-size: 0.95em;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 3px 3px 0 0;
    z-index: 1;
    margin-bottom: 0;
}

.melody-column .sequence-display-section::before {
    color: var(--light-melody-color);
    border-bottom: 2px solid var(--light-melody-color);
    top: -20px;
}

.rhythm-column .sequence-display-section::before {
    color: var(--light-rhythm-color);
    border-bottom: 2px solid var(--light-rhythm-color);
    top: -20px;
}

/* Base sequence display container */
.sequence-display {
    font-family: monospace;
    white-space: pre-wrap;
    overflow: hidden;
    padding: 4px 8px;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    background-color: var(--light-code-bg);
    font-size: 0.9em;
    margin-top: 0;
    margin-bottom: 8px;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 120px !important;
    box-sizing: border-box;
}

/* Melody and Rhythm sequence displays - ensure consistent styling */
.melody-column .sequence-display,
.rhythm-column .sequence-display {
    font-size: 0.9em !important;
    line-height: 1.2 !important;
    padding: 4px 8px !important;
}

/* Super Evolution sequence display */
#superEvolutionPanel .sequence-display {
    height: 160px !important;
}

/* Sequence text content */
.sequence-display .sequence-text {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: block;
    min-height: 1.2em;
    font-size: 0.9em !important;
}

.sequence-display::-webkit-scrollbar {
    width: 8px;
}

.sequence-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.sequence-display::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 8px;
}

.sequence-display::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.melody-column .sequence-display::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.4);
}

.rhythm-column .sequence-display::-webkit-scrollbar-thumb {
    background: rgba(106, 27, 154, 0.4);
}

.genetic-code-tables {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.genetic-code-table, .rhythm-code-table {
    margin-top: 20px;
    padding: 15px !important;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    background-color: var(--light-input-bg) !important;
}

.genetic-code-table h2, .rhythm-code-table h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1em;
}

.genetic-code-table {
    background-color: var(--light-bg-secondary);
    border: 1px solid var(--light-border);
}

.rhythm-code-table {
    margin-top: 20px;
    padding: 20px !important;
    border: 1px solid var(--light-accent);
    border-radius: 4px;
    background-color: rgba(103, 58, 183, 0.1) !important;
}

.genetic-code-table h2 {
    color: var(--light-melody-color);
}

.rhythm-code-table h2 {
    color: var(--light-rhythm-color);
}

.codon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 12px;
}

.codon-cell {
    padding: 5px;
    background-color: var(--light-input-bg);
    border: 1px solid var(--light-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.85em;
}

.codon-cell:hover {
    background-color: rgba(0, 0, 0, 0.03);
    transition: background-color 0.2s;
}

.codon-label {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 1px;
}

.note-select {
    font-size: 0.9em;
    padding: 2px;
    width: 100%;
    border: 1px solid var(--light-border);
    border-radius: 3px;
}

.synth-controls-section h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2962ff;
    font-size: 1.1em;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
    font-weight: bold;
    text-align: left; /* Change from center to left */
}

.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

button {
    background-color: var(--light-button);
    color: white;
    border: none;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:not(.small-toggle):hover {
    background-color: var(--light-button-hover);
}

button:disabled {
    background-color: var(--light-button-disabled);
    cursor: not-allowed;
}

/* All randomize buttons use our traditional purple with reduced size */
.randomize-button {
    background-color: #6a1b9a !important; /* Using the purple from rhythm-color with important */
    min-width: 108px; /* Increased from 90px */
    text-align: center; /* Center text within the button */
    white-space: nowrap; /* Prevent text wrapping */
    transform: scale(0.9); /* Increase to 90% of original size (20% larger than 75%) */
    transform-origin: center; /* Scale from center */
    margin: 0 -3px; /* Adjust margins for the larger size */
    padding: 6px 12px; /* Adjusted padding for the scaled buttons */
}

/* Important override for all randomize button hovers */
.randomize-button:hover {
    background-color: #9c4dcc !important; /* Lighter purple on hover with important flag */
}

/* Extra specificity for special buttons hover */
button.randomize-button.degenerate:hover, 
button.randomize-button.mutant:hover {
    background-color: #9c4dcc !important; /* Force light purple hover with maximum specificity */
}

/* Consistent styling for randomize button container with adjusted spacing */
.randomize-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px; /* Slightly increased gap for larger buttons */
}

.randomize-row {
    display: flex;
    justify-content: center;
    gap: 6px; /* Slightly increased gap for larger buttons */
}

.record-button {
    background-color: #d32f2f;
}

.record-button:hover {
    background-color: #b71c1c;
}

.record-button.recording {
    background-color: #b71c1c;
    border-width: 3px;
}

.preset-select {
    width: 100%;
    max-width: 400px;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #c5d9f1;
    background-color: #ffffff;
    font-size: 14px;
}

.synth-controls-section {
    margin-top: 0;
    margin-bottom: 2px;
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    border-radius: 8px;
    padding: 12px 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.synth-controls-section h2 {
    color: #2962ff;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
    font-size: 1.2em;
    font-weight: bold;
}

.preset-controls-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 10px;
}

.preset-controls-row .effect-group {
    display: flex;
    align-items: center;
    min-width: 350px;
    margin-bottom: 0;
    flex-grow: 1;
}

.preset-controls-row .effect-group label {
    display: inline-block;
    width: 70px;
    margin-right: 10px;
    text-align: right;
    font-weight: bold;
    color: #333;
}

.preset-controls-row .randomize-button {
    background-color: #673ab7;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: auto;
}

.preset-controls-row .randomize-button:hover {
    background-color: #5e35b1;
}

.synth-controls {
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    padding: 12px 15px;
    margin-top: 5px;
    margin-bottom: 10px;
    border-radius: 8px;
    width: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.synth-title {
    font-size: 1.2em;
    color: #2962ff;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
    font-weight: bold;
}

.effects-section {
    margin-top: -45px; /* Adding a negative margin to move it up */
    margin-bottom: 2px;
    position: relative; /* Position relative to make the negative margin work properly */
    z-index: 1; /* Add z-index to ensure it doesn't get hidden */
}

/* More specific selector for light mode to ensure it gets applied */
body:not(.dark-theme) .effects-section {
    margin-top: -45px !important; /* Force the same negative margin in light mode */
    position: relative !important;
    z-index: 1 !important;
}

.effects-control, .noise-controls {
    display: grid;
    gap: 15px;
    padding: 0 12px 12px 12px; /* Removed top padding, kept padding on other sides */
    margin-top: 0; /* Removed top margin */
    background-color: #f5f5f5;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

/* Specific column settings for each panel */
.effects-section .effects-control {
    grid-template-columns: repeat(6, 1fr);
}

.noise-section .noise-controls {
    grid-template-columns: repeat(6, 1fr);
}

/* Make column width smaller to ensure 6 columns fit */
.effects-control .control-column {
    min-width: 0;
    padding: 5px;
}

.effects-title, .noise-title {
    grid-column: 1 / -1;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 8px;
    padding: 0 0 3px 0; /* Only bottom padding */
    border-bottom: 1px solid #c5d9f1;
    background-color: transparent; /* Remove background color */
    border-radius: 0; /* Remove border radius */
    font-weight: bold;
    text-align: left;
    color: #2962ff;
}

/* We don't need different colors for the titles anymore */
.effects-title {
    color: #2962ff;
}

.noise-title {
    color: #2962ff;
}

.control-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
}

/* Ensure consistency in the effects panel */
.effects-control .control-column {
    padding: 8px;
    margin: 0;
}

.effects-control .effect-group {
    width: 100%;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.effects-control .effect-group label {
    font-size: 0.7rem;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
}

.effects-control .effect-group input[type="range"] {
    width: 100%;
    height: 4px;
    margin: 2px 0;
    display: block;
}

.effects-control .effect-group span {
    font-size: 0.7rem;
    min-width: 40px;
    display: block;
    text-align: left;
    margin-top: 1px;
}

/* High specificity responsive media queries */
@media (max-width: 1100px) and (min-width: 801px) {
    .effects-control, .noise-controls {
        grid-template-columns: repeat(3, 1fr); /* Three columns on medium screens */
    }
}

@media (max-width: 800px) {
    .effects-control, .noise-controls {
        grid-template-columns: repeat(2, 1fr); /* Two columns on smaller screens */
    }
}

/* For very small screens, stack everything */
@media (max-width: 500px) {
    .effects-control, .noise-controls {
        grid-template-columns: 1fr; /* One column on very small screens */
    }
}

.current-note {
    font-family: monospace;
    font-size: 1.0em;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #c8e6c9;
    margin-top: 6px;
}

.note-info {
    display: flex;
    gap: 8px; /* Reduced from 20px to bring the codon display closer to the label */
    align-items: center;
    font-size: 1em;
}

.note-label {
    font-weight: bold;
    color: var(--light-text-secondary);
    min-width: 110px; /* Reduced from a likely larger value to compress the layout */
}

/* Style for melody codons (green) */
.codon-display {
    font-size: 1.4em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--light-melody-color); /* Green for melody */
}

/* Style for rhythm codons (purple) */
.rhythm-column .codon-display,
.note-info:nth-child(3) .codon-display, 
.note-info:nth-child(4) .codon-display {
    color: var(--light-rhythm-color); /* Purple for rhythm */
}

/* Make notes bold but keep color */
.note-display {
    font-size: 1.3em;
    color: var(--light-melody-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Make duration values bold but keep color */
.duration-display {
    font-size: 1.3em;
    color: var(--light-rhythm-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.vu-meter {
    width: 240px;
    height: 28px; /* Reduced to 70% of 40px */
    background: var(--light-vu-meter-bg);
    border-radius: 3px; /* Reduced from 4px to 3px */
    padding: 5px; /* Reduced from 8px to 5px */
    margin-top: 5px; /* Reduced from 10px to 5px */
    position: relative;
}

/* 5-Band VU Meter Styles */
.band-vu-widget {
    background: var(--light-widget-bg);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    padding: 10px;
    margin: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.band-vu-meter {
    width: 100%;
    max-width: 300px;
}



.band-vu-channels {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    height: 98px;
    margin-top: 20px;
}

.band-vu-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 40px;
}

.band-vu-channel canvas {
    width: 20px;
    height: 84px;
    border-radius: 2px;
    background: #333;
}

.band-level {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: var(--light-text-secondary);
    text-align: center;
    width: 100%;
    font-weight: 500;
}

/* Dark theme adjustments */
.dark-theme .band-vu-widget {
    background: var(--dark-widget-bg);
    border-color: var(--dark-border);
}



.dark-theme .band-level {
    color: var(--dark-text-secondary);
}

.vu-meter canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.vu-meter-label {
    position: absolute;
    color: var(--light-text-secondary);
    font-size: 10px;
    bottom: 2px;
    left: 8px;
}

.vu-meter-peak {
    position: absolute;
    color: var(--light-text-secondary);
    font-size: 10px;
    top: 2px;
    right: 8px;
}

.waveform-visualizer {
    width: 100%;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.volume-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    padding: 10px;
    background-color: var(--light-code-bg);
    border-radius: 4px;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.volume-slider {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.volume-slider label {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--light-text-secondary);
    width: 60px;
}

.volume-slider input[type="range"] {
    width: 80px;
}

@media (max-width: 768px) {
    .file-upload, .sequence-display-section, .genetic-code-tables {
        flex-direction: column;
    }
    
    .synth-controls, .effects-control, .noise-controls {
        grid-template-columns: 1fr;
    }
    
    .note-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dynamics Controls Section */
.dynamics-section {
    margin-top: 0;
    margin-bottom: 2px;
    background-color: #e6f3ff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dynamics-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 12px;
    margin-top: 0;
    margin-bottom: 2px;
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.dynamics-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2962ff;
    width: 100%;
    text-align: left;
    padding: 5px 10px;
    margin-top: 0;
    background-color: #e6f0ff;
    border-radius: 4px;
}

.dynamics-column {
    flex: 1;
    min-width: 280px;
    margin-bottom: 5px;
    padding: 8px;
}

.dynamics-column h3 {
    font-size: 1em;
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

/* ADSR Visualizer */
#adsrVisualizer {
    width: 250px;
    height: 120px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 8px;
    background-color: #f5f5f5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    cursor: crosshair;
}

#adsrVisualizer:hover {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-button {
    padding: 2.1px 4.2px;
    border-radius: 2.1px;
    background-color: #2962ff;
    color: white !important;
    border: none;
    font-size: 0.525em;
    cursor: pointer;
    margin-left: 4.2px;
    transition: background-color 0.2s ease;
}

.toggle-button.off {
    background-color: #848484;
    color: white !important;
}

.toggle-button:not(.small-toggle):hover {
    background-color: var(--light-accent-hover);
    color: white !important;
}

.two-column-layout {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.melody-column section {
    background-color: var(--light-bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 4px;
    padding: 20px;
}

.rhythm-column section {
    background-color: #faf5ff;
    border: 1px solid #e1bee7;
    border-radius: 4px;
    padding: 20px;
}

.file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-upload label {
    font-weight: bold;
    font-size: 1.1em;
}

.melody-column .file-upload label {
    color: var(--light-melody-color);
}

.rhythm-column .file-upload label {
    color: var(--light-rhythm-color);
}

.genetic-code-table, .rhythm-code-table {
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

.genetic-code-table h2, .rhythm-code-table h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.genetic-code-table h2 {
    color: var(--light-melody-color);
}

.rhythm-code-table h2 {
    color: var(--light-rhythm-color);
}

@media (max-width: 768px) {
    .two-column-layout {
        flex-direction: column;
    }
    
    .column {
        width: 100%;
    }
    
    .synth-controls, .effects-control, .noise-controls {
        grid-template-columns: 1fr;
    }
    
    .note-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Adjust the spacing for the sequence content */
#sequenceDisplay, #rhythmDisplay {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: block;
    min-height: 1.2em;
    height: auto !important;
    overflow: visible;
}

/* Remove the blank line before sequence content */
#sequenceDisplay::before, #rhythmDisplay::before {
    content: none;
}

/* New Playback Controls Panel Styling */
.playback-panel {
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    padding: 12px 15px;
    margin-top: 0;
    margin-bottom: 2px;
    border-radius: 8px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.playback-panel h2 {
    margin-top: 0;
    margin-bottom: 4px;
    color: #2962ff;
    font-size: 1.2em;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
}

/* Add dark theme support for playback panel */
body.dark-theme .playback-panel {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-theme .playback-panel h2 {
    color: #7b68ee; /* Dark theme accent color */
    border-bottom: 1px solid #333;
}

body.dark-theme .playback-cell {
    background-color: #1a1a1a;
    border: 1px solid #333;
}

/* Fix all playback controls for dark theme */
body.dark-theme .playback-cell.volume-controls {
    background-color: #1a1a1a;
    border: 1px solid #444;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-theme .playback-cell .eq-container {
    background-color: #1a1a1a;
    border-color: #444;
}

body.dark-theme .eq-container {
    background-color: #1a1a1a;
    border-color: #444;
}

body.dark-theme .eq-title {
    color: #a0a0a0;
}

body.dark-theme .eq-slider {
    background-color: #333;
}

body.dark-theme .eq-slider::-webkit-slider-thumb {
    background-color: #7b68ee;
}

body.dark-theme .eq-slider::-moz-range-thumb {
    background-color: #7b68ee;
}

body.dark-theme .eq-display,
body.dark-theme .eq-freq {
    color: #a0a0a0;
}

body.dark-theme .eq-sliders::before {
    background-color: #444;
}

.playback-controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: start;
}

.playback-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
}

/* Adjust button group in playback panel */
.playback-cell .button-group {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.playback-cell .button-group button {
    min-width: 90px;
}

/* Enhance volume controls in playback panel */
.playback-cell.volume-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    background-color: var(--light-code-bg);
}

.playback-cell .volume-slider {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0;
}

.playback-cell .volume-slider label {
    min-width: 70px;
    text-align: right;
}

/* Adjust VU meter in playback panel */
.playback-cell .vu-meter {
    width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
    margin: 2px auto !important;
    padding: 8px !important;
    background-color: var(--bg-color) !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    transform: none !important;
}

.playback-cell .vu-meter canvas {
    width: 100% !important;
    height: 40px !important;
    display: block !important;
    margin: 0 auto !important;
    background-color: var(--bg-color) !important;
}

/* Center the meter in its container */
.centered .vu-meter {
    margin: 0 auto !important;
    transform: none !important;
}

/* Adjust the label color for better visibility on medium gray */
.playback-cell .vu-meter-label {
    display: block !important;
    text-align: center !important;
    font-size: 9px !important; /* Reduced from 10px to 9px */
    font-weight: bold !important;
    margin-bottom: 0 !important; /* Reduced from 1px to 0 */
    color: #222 !important;
}

.playback-cell .vu-meter-peak {
    display: block !important;
    text-align: center !important;
    font-size: 9px !important; /* Reduced from 10px to 9px */
    font-weight: bold !important;
    margin-top: 0 !important; /* Reduced from 1px to 0 */
    color: #222 !important;
}

.playback-cell.full-width {
    grid-column: 1 / -1;
    margin-top: 2px;
}

/* Style current note display in playback panel */
.playback-cell .current-note {
    background-color: rgba(41, 98, 255, 0.05);
    border-radius: 6px;
    padding: 10px; /* Reduced padding */
    gap: 10px; /* Reduced gap between rows */
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(197, 217, 241, 0.8);
}

/* Adjust EQ container in playback panel */
.playback-cell .eq-container {
    margin: 0 auto 20px auto;
    padding: 6px 25px;
    max-width: 395px;
}

.playback-cell .eq-sliders {
    height: 100px;
}

/* Media query for responsive layout */
@media (max-width: 1200px) {
    .playback-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .playback-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .two-column-layout {
        flex-direction: column;
    }
    
    .column {
        width: 100%;
    }
    
    .synth-controls, .effects-control, .noise-controls {
        grid-template-columns: 1fr;
    }
    
    .note-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Codon counter styles */
.codon-counter {
    margin-top: 8px;
    background-color: rgba(41, 98, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 10px;
}

.codon-counter .note-label {
    min-width: 120px;
    color: #2962ff;
}

.counter-display {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #2962ff;
    padding: 2px 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    min-width: 30px;
    text-align: center;
}

.counter-separator {
    font-weight: bold;
    margin: 0 5px;
    color: #2962ff;
}

/* Make restart button match play button in light theme with simpler hover */
.restart-button {
    background-color: #e0e0e0;
    border: 1px solid #bbbbbb;
    color: #333333;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    height: 36px;
    line-height: 18px;
    min-width: 80px;
    outline: none;
    font-weight: normal;
    margin: 0 4px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.restart-button:hover {
    background-color: #d0d0d0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.restart-button:disabled {
    background-color: #f5f5f5;
    border-color: #dddddd;
    color: #aaaaaa;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* EQ Styles */
.eq-container {
    background-color: var(--light-bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 5px;
    padding: 12px;
    margin: 8px auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 280px; /* 80% of 350px */
    text-align: center;
}

.eq-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--light-border);
    padding-bottom: 6px;
    font-weight: bold;
    font-size: 0.85em;
}

/* Container for all sliders with fixed height */
.eq-sliders {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    height: 96px; /* 80% of 120px */
    margin-bottom: 24px;
    max-width: 260px; /* 80% of 320px */
    margin: 0 auto;
}

/* Individual band container */
.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px; /* 80% of 50px */
    position: relative;
    height: 100%;
}

/* Vertical slider styling */
.eq-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 64px !important; /* 80% of 80px */
    height: 5px; /* Slightly reduced from 6px */
    background: var(--light-slider-track);
    outline: none;
    border-radius: 3px;
    transform: rotate(270deg);
    transform-origin: center;
    position: absolute;
    top: 32px; /* 80% of 40px */
    left: -12px; /* 80% of -15px */
    margin: 0;
}

/* Slider track styling with clear zero marker */
.eq-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right,
        var(--light-slider-track) 0%, var(--light-slider-track) calc(50% - 1px),
        var(--light-accent) calc(50% - 1px), var(--light-accent) calc(50% + 1px),
        var(--light-slider-track) calc(50% + 1px), var(--light-slider-track) 100%);
    height: 5px;
    border-radius: 2px;
}

.eq-slider::-moz-range-track {
    background: linear-gradient(to right,
        var(--light-slider-track) 0%, var(--light-slider-track) calc(50% - 1px),
        var(--light-accent) calc(50% - 1px), var(--light-accent) calc(50% + 1px),
        var(--light-slider-track) calc(50% + 1px), var(--light-slider-track) 100%);
    height: 5px;
    border-radius: 2px;
}

/* Ensure consistent thumb appearance and position */
.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--light-slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    /* Fix alignment with track */
    margin-top: -3.5px; /* Half of track height (5px) minus half a pixel for precise centering */
}

.eq-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--light-slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    /* Fix alignment with track */
    margin-top: -3.5px; /* Half of track height (5px) minus half a pixel for precise centering */
}

/* Value display (dB) */
.eq-display {
    position: absolute;
    bottom: 0;
    width: 100%;
    font-size: 9px; /* Slightly smaller */
    color: var(--light-text-primary);
    text-align: center;
    margin-bottom: 0;
}

/* Frequency label */
.eq-freq {
    position: absolute;
    bottom: 14px; /* 80% of 16px, rounded up */
    width: 100%;
    font-size: 9px;
    font-weight: 600;
    color: var(--light-text-secondary);
    text-align: center;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .eq-sliders {
        height: 80px; /* 80% of 100px */
        max-width: 224px; /* 80% of 280px */
    }
    
    .eq-band {
        width: 36px; /* 80% of 45px */
    }
    
    .eq-slider {
        width: 56px !important; /* 80% of 70px */
        top: 28px; /* 80% of 35px */
    }
    
    /* Maintain thumb alignment on mobile */
    .eq-slider::-webkit-slider-thumb {
        margin-top: -3.5px;
    }
    
    .eq-slider::-moz-range-thumb {
        margin-top: -3.5px;
    }
}

/* Adjust playback cell for the EQ */
    .playback-cell .eq-container {
    max-width: 100%;
    margin: 0;
    padding: 8px;
}

/* Make sure EQ bands are evenly spaced */
.playback-cell .eq-sliders {
    height: 88px; /* 80% of 110px */
    max-width: 100%;
    margin: 4px auto 16px;
}

.playback-cell .eq-band {
    width: 36px; /* 80% of 45px */
}

.playback-cell .eq-slider {
    width: 60px !important; /* 80% of 75px */
    top: 30px; /* 80% of 38px */
    left: -12px; /* 80% of -15px */
}

/* Ensure consistent thumb alignment in playback panel */
.playback-cell .eq-slider::-webkit-slider-thumb {
    margin-top: -3.5px; /* Same as main EQ thumbs */
}

.playback-cell .eq-slider::-moz-range-thumb {
    margin-top: -3.5px; /* Same as main EQ thumbs */
}

/* Slightly adjust display sizes for compact layout */
.playback-cell .eq-display {
    font-size: 8px;
}

.playback-cell .eq-freq {
    font-size: 8px;
    bottom: 12px; /* 80% of 15px */
}

@media (max-width: 768px) {
    .playback-cell .eq-sliders {
        height: 72px; /* 80% of 90px */
    }
    
    .playback-cell .eq-band {
        width: 32px; /* 80% of 40px */
    }
    
    .playback-cell .eq-slider {
        width: 52px !important; /* 80% of 65px */
        top: 24px; /* 80% of 30px */
    }
}

/* Synthesizer Controls Panel */
.synthesizer-controls-panel {
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    padding: 0 10px 8px 10px; /* Removed top padding, kept padding on other sides */
    margin-top: -47px; /* Increased negative margin by 2px more (from -45px to -47px) */
    margin-bottom: 10px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Added position relative for the negative margin */
    z-index: 1; /* Added z-index to prevent overlap issues */
}

.synthesizer-controls-panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2962ff;
    font-size: 1.1em;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
    font-weight: bold;
}

.synthesizer-controls-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
}

.synthesizer-controls-grid #adsrVisualizer {
    width: 100%;
    height: 85px;
    border-radius: 3px;
    margin-top: 3px;
}

.synthesizer-controls-grid .control-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Make sliders in the synthesizer controls panel narrower */
.synthesizer-controls-grid .effect-group input[type="range"] {
    width: calc(100% - 10px);
    max-width: 150px;
    margin: 3px 0;
}

.synthesizer-controls-grid .effect-group {
    padding: 2px;
    margin-bottom: 2px;
}

.synthesizer-controls-grid .effect-group label {
    font-size: 0.85em;
    margin-bottom: 1px;
    display: block;
}

.synthesizer-controls-grid .effect-group span {
    font-size: 0.8em;
    min-width: 40px;
    display: inline-block;
}

.synthesizer-controls-grid select {
    max-width: 150px;
    width: 100%;
}

/* Music Generator Controls panel */
.music-generator-controls-panel {
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    padding: 12px 15px;
    margin-top: -5px; /* Added negative margin to align with other containers */
    margin-bottom: 2px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-left: 0;
    margin-right: 0;
    position: relative; /* Added for negative margin to work properly */
    z-index: 1; /* Added to prevent overlap issues */
    
    /* Performance optimizations for superevolution playback */
    will-change: auto; /* Only change when needed */
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Optimize transitions to reduce performance impact */
.music-generator-controls-panel * {
    /* Reduce transition complexity during superevolution playback */
    transition: none !important;
}

/* Only apply transitions to specific interactive elements when not in superevolution mode */
.music-generator-controls-panel:not(.superevolution-active) input[type="range"] {
    transition: background-color 0.2s ease;
}

.music-generator-controls-panel:not(.superevolution-active) button {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.music-generator-controls-panel:not(.superevolution-active) select {
    transition: border-color 0.2s ease;
}

.music-generator-controls-panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2962ff;
    font-size: 1.1em;
    border-bottom: 1px solid #c5d9f1;
    padding-bottom: 3px;
    font-weight: bold;
}

/* New grid layout for music controls panel */
.music-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* Control group styling (columns) */
.music-generator-controls-panel .control-group {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid #e0e9f5;
    border-radius: 6px;
    padding: 8px;
}

/* Control group headers */
.music-generator-controls-panel .control-group h3 {
    font-size: 0.9em;
    color: #0d47a1;
    margin: 0 0 8px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #e0e9f5;
    text-align: center;
}

/* Effect group headers (for nested h3s) */
.music-generator-controls-panel .effect-group h3 {
    font-size: 0.85em;
    color: #0d47a1;
    margin: 8px 0 4px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #e0e9f5;
    text-align: left;
}

/* Responsive behavior for smaller screens */
@media (max-width: 767px) {
    .music-controls-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .music-generator-controls-panel .control-group {
        max-width: 100%;
    }
}

/* Keep existing effect-group styling but refine for the grid layout */
.music-generator-controls-panel .effect-group {
    margin-bottom: 8px;
}

/* Make range inputs consistent width */
.music-generator-controls-panel .effect-group input[type="range"] {
    width: 100%;
    max-width: none;
}

/* General toggle button styles */
.toggle-button {
    padding: 2px 4px;
    border-radius: 3px;
    background-color: #2962ff;
    color: white;
    border: none;
    font-size: 0.7em;
    cursor: pointer;
    margin-left: 4px;
    transition: background-color 0.2s ease;
}

/* Global effect group styles */
.effect-group {
    width: 100%;
    margin-bottom: 4px;
}

.effect-group label {
    font-size: 0.7rem;
    display: block;
    margin-bottom: 1px;
    line-height: 1.1;
}

.effect-group input[type="range"] {
    width: calc(100% - 4px);
    max-width: none;
    margin: 1px 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    position: relative;
}

.effect-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.effect-group input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.effect-group span {
    display: inline-block;
    font-size: 0.7rem;
    color: #555;
    text-align: right;
    margin-top: 0;
    line-height: 1.1;
    min-width: 40px;
}

/* Controls Row (Presets and Music Generator Controls) */
.controls-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.controls-row .synth-controls-section,
.controls-row .music-generator-controls-panel {
    width: 100%;
    max-width: 100%;
}

/* Style for preset controls in a column layout */
.preset-controls-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preset-controls-column .effect-group,
.preset-controls-column .preset-select {
    width: 100%;
}

/* Display randomize buttons side by side */
.preset-controls-column .randomize-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.randomize-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.randomize-row .randomize-button {
    flex: 1;
}

.preset-controls-column .randomize-button {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 8px 10px;
}

/* Synthesizer/Presets Panel */
.synth-controls-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px; /* Match other panels */
    padding: 12px 15px; /* Match other panels */
    margin-top: -5px; /* Added negative margin to align with other containers */
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Match other panels */
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Added for negative margin to work properly */
    z-index: 1; /* Added to prevent overlap issues */
}

.synth-controls-section h2 {
    font-size: 0.95rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #005f73;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}

/* Responsive handling for the controls row */
@media (max-width: 767px) {
    /* No longer needed as panels are now full width by default */
    /* .controls-row {
        flex-direction: column;
    }
    
    .controls-row .synth-controls-section,
    .controls-row .music-generator-controls-panel {
        max-width: 100%;
    } */
}

/* Noise controls specific grid layout */
.noise-controls {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important; /* Enforcing 6 columns */
    gap: 15px;
    margin-top: 10px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
}

/* Make the noise control columns more compact to fit 6 columns */
.noise-controls .control-column {
    min-width: 0;
    width: 100%;
    padding: 3px;
    gap: 0 !important; /* Remove any gap */
    display: flex;
    flex-direction: column;
}

.noise-controls .effect-group {
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
}

.noise-controls .effect-group label {
    font-size: 0.68rem;
    margin: 0 0 1px 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.0;
    height: auto !important;
}

.noise-controls .effect-group input[type="range"] {
    max-width: 100%;
    height: 3px !important;
    margin: 1px 0 !important;
    padding: 0 !important;
}

.noise-controls .effect-group span {
    font-size: 0.68rem;
    min-width: 35px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.0;
    height: auto !important;
}

/* Noise color selector styling */
.noise-color-select {
    width: 100%;
    font-size: 0.68rem;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    margin: 1px 0 !important;
    height: 20px;
    line-height: 1.0;
    position: relative;
}

.noise-color-select:hover {
    border-color: #999;
}

/* Noise color container and LED styling */
.noise-color-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.noise-color-led {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #333;
    background-color: #ffffff;
    box-shadow: 
        inset 0 0 4px rgba(0, 0, 0, 0.3),
        0 0 6px rgba(255, 255, 255, 0.8),
        0 0 2px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.noise-color-led::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 70%);
    pointer-events: none;
}

/* LED colors for different noise types */
.noise-color-led[data-color="white"] { background-color: #ffffff; }
.noise-color-led[data-color="pink"] { background-color: #ffc0cb; }
.noise-color-led[data-color="brown"] { background-color: #8b4513; }
.noise-color-led[data-color="blue"] { background-color: #0000ff; }
.noise-color-led[data-color="violet"] { background-color: #8a2be2; }
.noise-color-led[data-color="gray"] { background-color: #808080; }
.noise-color-led[data-color="red"] { background-color: #ff0000; }
.noise-color-led[data-color="orange"] { background-color: #ffa500; }
.noise-color-led[data-color="green"] { background-color: #00ff00; }
.noise-color-led[data-color="cyan"] { background-color: #00ffff; }
.noise-color-led[data-color="magenta"] { background-color: #ff00ff; }
.noise-color-led[data-color="yellow"] { background-color: #ffff00; }
.noise-color-led[data-color="purple"] { background-color: #800080; }
.noise-color-led[data-color="teal"] { background-color: #008080; }
.noise-color-led[data-color="lime"] { background-color: #32cd32; }

/* LED effect when noise is active */
.noise-color-led.active {
    border: 2px solid currentColor;
    background-color: currentColor;
    opacity: 0.8;
}

/* Add a small color indicator to the noise color selector */
.noise-color-select::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--noise-color-indicator, #ffffff);
    border: 1px solid #ccc;
    pointer-events: none;
}

.noise-color-select option {
    padding-left: 15px;
}

/* Dark theme support for noise color selector */
body.dark-theme .noise-color-select {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-theme .noise-color-select:hover {
    border-color: #777;
}

body.dark-theme .noise-color-select:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.25);
}

/* Small toggle for loop controls */
.small-toggle {
    font-size: 1rem;
    padding: 2px 6px;
    margin-left: 5px;
    min-width: auto;
    height: auto;
}

.small-toggle:hover {
    background-color: #b299fc; /* Light purple color for hover */
}

/* Stereo VU Meter Styles */
.vu-meter.stereo-vu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 250px !important;
    max-width: 250px !important;
    position: relative !important;
    padding-bottom: 10px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 4px !important;
    padding: 8px !important;
    margin-bottom: 10px !important;
    background-color: #f5f5f5 !important;
    min-height: 45px !important;
}

.vu-meter .oscilloscope-title {
    width: 100% !important;
    padding: 1px 0 !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    margin-bottom: 2px !important;
    color: var(--text-color) !important;
}

.vu-channels {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
}

.vu-channel-container {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    margin: 4px 0 !important;
    height: 20px !important;
    background-color: rgba(0,0,0,0.03) !important;
    border-radius: 3px !important;
    padding: 2px 4px !important; /* Added horizontal padding */
    gap: 4px !important; /* Added gap between elements */
}

.channel-label {
    font-size: 0.8rem !important;
    margin-right: 4px !important;
    width: 15px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: #333 !important;
    display: inline-block !important;
}

.vu-peak {
    font-size: 0.8rem !important;
    margin-left: 4px !important;
    width: 50px !important; /* Reduced from 90px to match dark mode */
    text-align: right !important;
    font-family: monospace !important;
    display: inline-block !important;
    color: #333 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

#vuMeterLeft, #vuMeterRight {
    flex: 1 !important;
    height: 14px !important;
    background-color: #e0e0e0 !important;
    border-radius: 2px !important;
    border: 1px solid rgba(0,0,0,0.2) !important;
    display: block !important;
    min-width: 100px !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force visibility on both VU meters */
#vuMeterLeft {
    background-color: #333 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

#vuMeterRight {
    background-color: #333 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.vu-meter-label {
    position: absolute !important;
    bottom: -5px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.8rem !important; /* Increased size */
    color: #333 !important; /* Dark text for light mode */
    font-weight: bold !important;
    padding: 2px 6px !important;
    background-color: rgba(255,255,255,0.8) !important;
    border-radius: 3px !important;
}

.waveform-select-container {
    display: flex;
    align-items: center;
    position: relative;
}

.waveform-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    margin-left: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.waveform-icon.sine {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12 C 7 6, 17 18, 22 12'/%3E%3C/svg%3E");
}

.waveform-icon.square {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12h5v-8h10v16h5'/%3E%3C/svg%3E");
}

.waveform-icon.sawtooth {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 20L10 4l10 0l0 16'/%3E%3C/svg%3E");
}

.waveform-icon.triangle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12 7 5 17 19 22 12'/%3E%3C/svg%3E");
}

/* ===== MIXED OSCILLOSCOPE STYLES ===== */
/* Mixed oscilloscope styles */
.mixed-oscilloscope {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
}

/* Force oscilloscope height override */
.main-oscilloscope {
    min-height: 48px !important;
}

.main-oscilloscope .oscilloscope-title {
    height: 48px !important;
}

.main-oscilloscope .oscilloscope-channel-container {
    height: 22px !important;
}

.main-oscilloscope #oscilloscopeLeft,
.main-oscilloscope #oscilloscopeRight {
    height: 22px !important;
}

/* Force VU meter height override */
.vu-meter.stereo-vu {
    min-height: 45px !important;
}

.oscilloscope-title {
    width: 100px !important;
    flex-shrink: 0 !important;
    text-align: left !important;
    font-weight: bold !important;
}

#mixedOscilloscope {
    width: 300px !important;
    height: 105px !important;
    background-color: #000000 !important;
    border-radius: 4px !important;
    border: 1px solid var(--border-color) !important;
}



body.dark-theme #mixedOscilloscope {
    background-color: #111 !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.7) !important;
    border-color: #444 !important;
}

/* Mixed oscilloscope styles for playback panel */
.playback-cell .mixed-oscilloscope {
    margin: 2px auto !important;
    padding: 2px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
}

body.dark-theme .oscilloscope-title {
    color: #ddd !important;
}



/* Dark theme styles for VU meter */
body.dark-theme .vu-meter.stereo-vu {
    height: calc(100% - 15px) !important; /* Reduce frame height by 15px */
    padding: 3px !important; /* Reduced padding to account for smaller frame */
    margin-bottom: 5px !important; /* Reduced margin */
    background-color: #181818 !important; /* Darker background */
}

body.dark-theme .vu-channel-container {
    height: 18px !important; /* 70% of 26px */
    margin: 2px 0 !important; /* Reduced margin */
}

body.dark-theme #vuMeterLeft, 
body.dark-theme #vuMeterRight {
    height: 18px !important; /* 70% of 26px */
    background-color: #111 !important; /* Darker meter background */
}

/* Dark theme header styles */
body.dark-theme header {
    border-bottom: 1px solid #444;
    background-color: #1a1a1a;
    padding: 10px 0;
}

body.dark-theme h1 {
    color: #4CAF50; /* Match the dark theme accent color */
}

body.dark-theme .chromatone-title {
    color: #b19dff; /* Lighter Medium Purple for dark mode */
}

body.dark-theme .site-logo {
    filter: brightness(0.9);
}

/* If your logo has a light background, you might want to add a subtle dark mode adjustment */
body.dark-theme .site-logo {
    filter: brightness(0.9); /* Slightly reduce brightness in dark mode if needed */
}

@media (max-width: 600px) {
    .site-logo {
        height: 60px; /* Doubled from 30px */
        margin-left: 8px; /* Slightly reduced margin for mobile */
    }
    
    h1 {
        font-size: 1.3rem; /* Smaller title text on mobile */
    }
    
    .chromatone-title {
        font-size: 1.8rem; /* Smaller Chromatone text on mobile */
    }
    
    .site-title {
        gap: 10px;
    }
}

/* Dual slider for octave range */
.range-slider-container {
    position: relative;
    width: 100%;
    height: 45px; /* Reduced from 65px to make it more compact */
    margin: 5px 0 10px; /* Reduced top and bottom margins */
    background: #e0e0e0; /* Light gray background for the slider track */
    border-radius: 4px;
    padding-top: 0; /* Remove top padding and position elements absolutely */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    /* Add custom properties for JavaScript to update */
    --min-percent: 0%;
    --max-percent: 100%;
    --range-gradient: linear-gradient(to right, transparent 0%, transparent 0%, #4CAF50 0%, #9C27B0 100%, transparent 100%, transparent 100%);
}

/* Slider wrapper to help positioning */
.slider-wrapper {
    position: absolute;
    top: 7px; /* Keep the 7px adjustment for proper handle alignment */
    left: 0;
    width: 100%;
    height: 30px; /* Reduced from 40px */
    z-index: 20; /* Higher than the gradient bar */
}

/* Active range indicator - we've moved this to the gradient-bar element */
.range-slider-container::before {
    content: '';
    position: absolute;
    top: 14px; /* Adjusted from original position */
    left: 0;
    width: 100%;
    height: 6px; /* Slightly thinner */
    background: transparent; /* Remove the gradient, now handled by gradient-bar */
    border-radius: 3px; /* To match the height */
    pointer-events: none; /* Allow clicks to pass through */
}

/* Background track */
.range-slider-container::after {
    content: '';
    position: absolute;
    top: 14px; /* Adjusted from original position */
    left: 0;
    width: 100%;
    height: 6px; /* Slightly thinner */
    background: #ccc; /* Light gray for the inactive area */
    border-radius: 3px; /* To match the height */
    z-index: 5; /* Bottom layer */
    pointer-events: none; /* Allow clicks to pass through */
}

body.dark-theme .range-slider-container {
    background: #333; /* Darker background for dark theme */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Base dual slider styles */
.dual-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 40px !important;
    pointer-events: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    margin: 0 !important;
    z-index: 30 !important; /* Ensure sliders are above everything */
    opacity: 1 !important;
}

/* Force exact same position for both sliders */
.min-slider, .max-slider {
    top: 0 !important;
    transform: none !important;
}

/* Clear all existing thumb styles and apply new ones */
.dual-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 15px !important; /* 50% of previous 30px width */
    height: 9px !important; /* 50% of previous 18px height */
    border-radius: 3px !important;
    cursor: pointer !important;
    border: 1px solid white !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.3) !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
    position: relative !important;
    top: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 9999 !important; /* Very high z-index */
}

.dual-slider::-moz-range-thumb {
    width: 15px !important; /* 50% of previous 30px width */
    height: 9px !important; /* 50% of previous 18px height */
    border-radius: 3px !important;
    cursor: pointer !important;
    border: 1px solid white !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.3) !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
    position: relative !important;
    top: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 9999 !important; /* Very high z-index */
}

.min-slider::-webkit-slider-thumb {
    background: #4CAF50 !important; /* Green for min octave */
}

.max-slider::-webkit-slider-thumb {
    background: #9C27B0 !important; /* Purple for max octave */
}

.min-slider::-moz-range-thumb {
    background: #4CAF50 !important; /* Green for min octave */
}

.max-slider::-moz-range-thumb {
    background: #9C27B0 !important; /* Purple for max octave */
}

/* Force transparent tracks */
.dual-slider::-webkit-slider-runnable-track,
.dual-slider::-moz-range-track {
    width: 100% !important;
    height: 0 !important; /* Make track invisible */
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

/* Dark theme adjustments */
body.dark-theme .min-slider::-webkit-slider-thumb {
    background: #69f0ae !important; /* Brighter green for dark theme */
    border: 1px solid #222 !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

body.dark-theme .max-slider::-webkit-slider-thumb {
    background: #ea80fc !important; /* Brighter purple for dark theme */
    border: 1px solid #222 !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

body.dark-theme .min-slider::-moz-range-thumb {
    background: #69f0ae !important; /* Brighter green for dark theme */
    border: 1px solid #222 !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

body.dark-theme .max-slider::-moz-range-thumb {
    background: #ea80fc !important; /* Brighter purple for dark theme */
    border: 1px solid #222 !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

/* Octave ruler styling */
.octave-ruler {
    position: absolute;
    display: flex;
    justify-content: space-between;
    width: 100%;
    bottom: 0px; /* Moved directly to the bottom */
    left: 0;
    height: 12px; /* Reduced from 15px */
    padding: 0;
    margin-bottom: 0; /* Removed bottom margin */
    box-sizing: border-box;
}

.octave-mark {
    position: relative;
    width: 1px; /* Reduced from 2px */
    height: 6px; /* Reduced from 8px */
    background: #777;
    flex-grow: 0;
    flex-shrink: 0;
}

.octave-mark:first-child {
    margin-left: 0;
}

.octave-mark:last-child {
    margin-right: 0;
}

.octave-mark span {
    position: absolute;
    font-size: 9px; /* Reduced from 10px */
    top: 8px; /* Reduced from 10px */
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    white-space: nowrap;
}

body.dark-theme .octave-mark {
    background: #999;
}

body.dark-theme .octave-mark span {
    color: #bbb;
}

/* Styling for transposed note indicator */
.transposed-note {
    color: #f44336; /* Red color to indicate transposition */
    font-size: 0.9em;
    font-style: italic;
    margin-left: 4px;
}

body.dark-theme .transposed-note {
    color: #ff7961; /* Lighter red for dark theme */
}

.transposed {
    color: #f44336;
    font-size: 0.9em;
    font-style: italic;
}

body.dark-theme .transposed {
    color: #ff7961; /* Lighter red for dark theme */
}

/* Style for minimum range indicator */
.min-range {
    color: #ff9800; /* Orange to indicate minimum range */
    font-weight: bold;
}

body.dark-theme .min-range {
    color: #ffb74d; /* Lighter orange for dark theme */
}

/* Set vivid colors for each thumb with extra brightness */
.min-slider::-webkit-slider-thumb {
    background: #00e676 !important; /* Bright green for min octave */
    outline: 1px solid rgba(0, 230, 118, 0.5) !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

.max-slider::-webkit-slider-thumb {
    background: #ff00ff !important; /* Pure magenta for max octave */
    outline: 1px solid rgba(255, 0, 255, 0.5) !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

.min-slider::-moz-range-thumb {
    background: #00e676 !important; /* Bright green for min octave */
    outline: 1px solid rgba(0, 230, 118, 0.5) !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

.max-slider::-moz-range-thumb {
    background: #ff00ff !important; /* Pure magenta for max octave */
    outline: 1px solid rgba(255, 0, 255, 0.5) !important;
    width: 15px !important; /* 50% of previous width */
    height: 9px !important; /* 50% of previous height */
    transform: translateY(-8px) !important; /* Adjusted to align with the new track position */
}

body.dark-theme .range-slider-container::after {
    background: #444; /* Darker gray for the inactive area in dark theme */
}

body.dark-theme .range-slider-container::after {
    background: rgba(68, 68, 68, 0.1); /* Nearly transparent track */
    height: 1px; /* Ultra thin track */
}

/* Gradient bar to show the active range between min and max octaves */
.gradient-bar {
    position: absolute;
    top: 15px; /* Match the JavaScript positioning */
    left: 0;
    width: 100%;
    height: 4px; /* Match the JavaScript height */
    background: var(--range-gradient); /* This uses the value set by JavaScript */
    border-radius: 1.5px;
    z-index: 10; /* Above the track but below the sliders */
    pointer-events: none; /* Allow clicks to pass through */
}

body.dark-theme .gradient-bar {
    height: 4px; /* Match the JavaScript height */
    top: 15px; /* Match the JavaScript positioning */
    opacity: 0.4; /* Slightly more visible than the track but still subtle */
    border-radius: 1.5px;
}

/* Now we can remove the background from ::before since gradient-bar handles it */
.range-slider-container::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    width: 100%;
    height: 6px;
    background: transparent; /* No background needed */
    border-radius: 3px;
    z-index: 1; /* Below everything */
    pointer-events: none;
}

/* We need to have min-handle and max-handle for JS, but they can be invisible */
.min-handle, .max-handle {
    display: none; /* Hide them but keep them in the DOM for JavaScript */
}

/* Utility class to visually hide elements but keep them in the DOM for JavaScript */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Add styling for the checkbox option */
.checkbox-option {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 0.9em;
}

.checkbox-option .toggle-input {
    margin-right: 5px;
}

.checkbox-option .tip {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ccc;
    color: #fff;
    font-size: 11px;
    margin-left: 5px;
    cursor: help;
}

body.dark-theme .checkbox-option .tip {
    background-color: #555;
}

/* Ensure the visually-hidden class is defined */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Tooltip styling */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 250px;
    z-index: 9999;
    pointer-events: none;
    white-space: normal;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-theme .tooltip {
    background-color: rgba(50, 50, 50, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Evolution Mode Controls */
.evolution-controls {
    margin-top: 0;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    height: 100%;
}

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

.evolution-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.evolution-settings {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 4px;
    border-top: 1px solid #eee;
}

.evolution-mode-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
}

.evolution-speed-control, .evolution-interval-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.evolution-speed-control label, .evolution-interval-control label {
    min-width: 85px;
    white-space: nowrap;
}

.evolution-slider {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 4px;
}

.evolution-controls-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evolution-models {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.evolution-model-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.evolution-models span {
    white-space: nowrap;
    min-width: 85px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #725AC1;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Dark mode overrides */
body.dark-theme .evolution-controls {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-theme .evolution-settings {
    border-top-color: #444;
}

body.dark-theme .evolution-slider {
    background: #444;
}

body.dark-theme .toggle-slider {
    background-color: #555;
}

body.dark-theme input:checked + .toggle-slider {
    background-color: #8A6FE8;
}

/* Custom Randomization Panel Styles */
.section-panel {
    background-color: #f8f8f8;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* When custom randomization panel appears after presets panel */
.synth-controls-section + #customRandomizationPanel {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: -15px;
    border-top: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f0f0f0;
    border-radius: 6px 6px 0 0;
}

.section-header h2 {
    margin: 0;
    color: #2962ff;
    font-size: 1.2em;
    font-weight: bold;
}

.panel-controls {
    display: flex;
    gap: 10px;
}

.panel-content {
    padding: 5px;
}

/* Custom Randomization Panel Specific Styles */
.custom-randomization-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.parameter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.parameter-group {
    flex: 1;
    min-width: 250px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
    background-color: #f9f9f9;
}

.parameter-group h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
    color: #2962ff;
    border-bottom: 1px dashed #c5d9f1;
    padding-bottom: 5px;
}

.param-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #e0e0e0;
}

.param-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.param-toggle input[type="checkbox"] {
    margin: 0;
}

.param-range {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
}

.param-range input[type="number"] {
    width: 60px;
    padding: 2px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
}

.param-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.param-options label {
    margin-bottom: 5px;
    font-size: 0.85em;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
}

.debug-controls {
    border-top: 1px solid #c5d9f1;
    padding-top: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.action-button {
    padding: 5px 10px;
    background-color: #2962ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.action-button:hover {
    background-color: #1e50cf;
}

/* Dark theme adjustments */
body.dark-theme .section-panel {
    background-color: #1a1a1a;
    border-color: #333;
}

body.dark-theme .section-header {
    background-color: #222;
    border-bottom-color: #333;
}

body.dark-theme .section-header h2 {
    color: #81b4ff;
}

body.dark-theme .parameter-group {
    background-color: #202940;
    border-color: #2d3748;
}

body.dark-theme .parameter-group h3 {
    color: #81b4ff;
    border-color: #2d3748;
}

body.dark-theme .param-row {
    border-color: #2d3748;
}

body.dark-theme .param-range input[type="number"] {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .debug-controls {
    border-color: #2d3748;
}

body.dark-theme .action-button {
    background-color: #3182ce;
}

body.dark-theme .action-button:hover {
    background-color: #2c5282;
}

/* Custom randomize button styling */
button.randomize-button.custom {
    background-color: #8e44ad;
    color: white;
}

button.randomize-button.custom:hover {
    background-color: #9b59b6;
}

.evolution-model-checkboxes label {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    font-size: 0.85rem;
}

.evolution-model-checkboxes input[type="checkbox"] {
    margin-right: 3px;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .evolution-controls-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .evolution-models {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .evolution-models span {
        margin-bottom: 5px;
    }
}

/* Two-column layout for presets panel */
.preset-controls-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
}

.preset-left-column {
    flex: 1.2;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preset-left-column .effect-group {
    width: 100%;
    margin-bottom: 5px;
}

.preset-left-column .effect-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.preset-left-column .preset-select {
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
}

.preset-left-column .randomize-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.preset-right-column {
    flex: 0.8;
    min-width: 220px;
}

/* Update evolution controls to fit the new layout */
.evolution-controls {
    margin-top: 0;
    height: 100%;
}

/* Responsive behavior for smaller screens */
@media (max-width: 768px) {
    .preset-controls-wrapper {
        flex-direction: column;
    }
    
    .preset-left-column,
    .preset-right-column {
        width: 100%;
    }
    
    .evolution-controls {
        margin-top: 10px;
    }
}

/* Dark mode overrides for preset panel */
body.dark-theme .preset-left-column .preset-select {
    background-color: #333;
    border-color: #555;
    color: #eee;
}

body.dark-theme .preset-left-column .effect-group label {
    color: #ccc;
}

body.dark-theme .evolution-controls {
    background-color: #2a2a2a;
    border-color: #444;
}

/* Ensure proper spacing of randomize buttons */
.randomize-row {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
}

.randomize-row .randomize-button {
    flex: 1;
    min-width: 0;
    padding: 6px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* Refinements for the evolution controls in the new layout */
.preset-right-column .evolution-controls {
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.preset-right-column .evolution-settings {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Adjust media query for better responsiveness */
@media (max-width: 1024px) and (min-width: 901px) {
    .preset-left-column {
        flex: 1;
    }
    
    .preset-right-column {
        flex: 1;
    }
    
    .randomize-row .randomize-button {
        padding: 8px 4px;
        font-size: 0.9rem;
    }
}

@media (max-width: 900px) {
    .preset-controls-wrapper {
        flex-direction: column;
    }
    
    .preset-left-column,
    .preset-right-column {
        width: 100%;
    }
    
    .evolution-controls {
        margin-top: 10px;
    }
    
    .randomize-row .randomize-button {
        padding: 8px 4px;
        font-size: 0.9rem;
    }
}

@media (max-width: 500px) {
    .randomize-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .randomize-row .randomize-button {
        width: 100%;
        padding: 8px;
    }
}

/* Make the slider display values more compact */
.evolution-speed-control span, 
.evolution-interval-control span {
    min-width: 18px;
    display: inline-block;
    text-align: right;
}

/* Three-column equilibrated layout */
.preset-controls-wrapper {
    display: flex;
    gap: 15px;
    width: 100%;
}

.preset-left-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preset-right-column {
    flex: 2;
    min-width: 350px;
}

/* Custom randomize button for standalone row */
.randomize-row:last-child {
    justify-content: center;
}

.randomize-row:last-child .randomize-button {
    flex: 0 1 auto;
    min-width: 120px;
    max-width: 60%;
}

/* Two-column layout inside evolution panel */
.evolution-two-columns {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.evolution-left-column {
    flex: 1;
    min-width: 160px;
}

.evolution-right-column {
    flex: 1;
    min-width: 160px;
}

/* Adjust model checkboxes for column layout */
.evolution-models {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.85rem;
}

.evolution-models span {
    white-space: nowrap;
    margin-bottom: 2px;
    font-weight: bold;
}

.evolution-model-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-left: 0;
}

.evolution-model-checkboxes label {
    display: inline-flex;
    align-items: center;
    margin-right: 0;
    font-size: 0.85rem;
}

/* Refinements for the evolution controls in the new layout */
.preset-right-column .evolution-controls {
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Adjust media queries for the new layout */
@media (max-width: 900px) {
    .evolution-two-columns {
        flex-direction: column;
        gap: 8px;
    }
    
    .evolution-left-column,
    .evolution-right-column {
        width: 100%;
    }
    
    .evolution-model-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }
}

/* Override existing evolution-models styles that conflict with our new layout */
.evolution-models {
    font-size: 0.85rem;
}

.evolution-controls-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Make components even more compact */
.evolution-mode-selector {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.evolution-speed-control, .evolution-interval-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.evolution-speed-control label, .evolution-interval-control label {
    min-width: 80px;
    white-space: nowrap;
}

/* Ensure proper height for the evolution panel */
.evolution-controls {
    height: auto;
}

/* Fixed position for the custom button */
.randomize-button.custom {
    max-width: 150px;
}

/* Adjust media queries */
@media (max-width: 1024px) and (min-width: 901px) {
    .preset-left-column {
        flex: 1;
        min-width: 180px;
    }
    
    .preset-right-column {
        flex: 1.5;
    }
    
    .evolution-two-columns {
        gap: 5px;
    }
    
    .evolution-left-column,
    .evolution-right-column {
        min-width: 120px;
    }
}

/* Adjustments for very small screens */
@media (max-width: 500px) {
    .preset-right-column {
        min-width: 100%;
    }
    
    .evolution-two-columns {
        flex-direction: column;
    }
    
    .evolution-model-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .randomize-row:last-child .randomize-button {
        max-width: 80%;
    }
}

/* Update column ratios after swapping positions */
.preset-right-column {
    flex: 2;
    min-width: 350px;
}

.preset-left-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Three-column layout for evolution panel */
.evolution-three-columns {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.evolution-column {
    flex: 1;
    min-width: 100px;
}

/* Two-column layout for model checkboxes */
.evolution-model-columns {
    display: flex;
    gap: 10px;
}

.model-column {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Adjust the Allow Models label */
.evolution-models span {
    white-space: nowrap;
    margin-bottom: 4px;
    font-weight: bold;
    display: block;
}

/* Make the evolution columns more compact */
.evolution-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.evolution-model-columns label {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}

.evolution-model-columns input[type="checkbox"] {
    margin-right: 3px;
}

/* Adjust media queries for the new layout */
@media (max-width: 1024px) {
    .evolution-three-columns {
        flex-wrap: wrap;
    }
    
    .evolution-column {
        flex: 1 1 40%;
        min-width: 120px;
    }
    
    .evolution-column:last-child {
        flex-basis: 100%;
    }
}

@media (max-width: 900px) {
    .preset-controls-wrapper {
        flex-direction: column;
    }
    
    .preset-right-column,
    .preset-left-column {
        width: 100%;
        min-width: 100%;
    }
    
    .evolution-column {
        flex: 1 1 auto;
    }
    
    .evolution-three-columns {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 500px) {
    .evolution-model-columns {
        flex-direction: column;
        gap: 3px;
    }
}

/* Fine-tune evolution controls in three-column layout */
.evolution-controls {
    padding: 6px;
    border-radius: 5px;
    background-color: #f9f9f9;
    height: auto;
    box-sizing: border-box;
}

.evolution-settings {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid #eee;
}

/* Make controls more compact */
.evolution-speed-control, 
.evolution-interval-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.evolution-speed-control label, 
.evolution-interval-control label {
    min-width: 80px;
    display: inline-block;
    white-space: nowrap;
}

.evolution-controls-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Adjust the column gap in the preset wrapper */
.preset-controls-wrapper {
    display: flex;
    gap: 15px;
    width: 100%;
}

/* Remove conflicting styles */
.evolution-models {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.85rem;
}

/* Fix for radio buttons in the evolution mode selector */
.evolution-mode-selector label {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* More responsive adjustments */
@media (max-width: 768px) {
    .preset-left-column {
        order: -1; /* Make buttons appear first on small screens */
    }
}

/* Fine-tune the widths for better balance */
.preset-right-column {
    flex: 1.6;
    min-width: 350px;
}

.preset-left-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Make slider labels more compact */
.evolution-speed-control label, 
.evolution-interval-control label {
    min-width: 75px;
    font-size: 0.8rem;
    display: inline-block;
    white-space: nowrap;
}

/* Make slider values more compact */
.evolution-speed-control span, 
.evolution-interval-control span {
    min-width: 16px;
    display: inline-block;
    text-align: right;
    font-size: 0.8rem;
}

/* Reduce space between columns */
.evolution-three-columns {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* Add a subtle background to columns for better visual separation */
.evolution-column {
    flex: 1;
    min-width: 100px;
    padding: 4px;
    box-sizing: border-box;
}

/* Update to two-column layout for evolution panel */
.evolution-two-columns {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.evolution-left-column {
    flex: 1;
    min-width: 160px;
}

.evolution-right-column {
    flex: 1;
    min-width: 160px;
}

/* Put Manual/Auto on the same line */
.evolution-mode-selector {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* Make controls even more compact */
.evolution-speed-control, 
.evolution-interval-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.evolution-speed-control label, 
.evolution-interval-control label {
    min-width: 55px;
    font-size: 0.8rem;
    display: inline-block;
    white-space: nowrap;
}

/* Adjust right column layout */
.evolution-models {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.evolution-models span {
    white-space: nowrap;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Update media queries for the new two-column layout */
@media (max-width: 900px) {
    .evolution-two-columns {
        flex-direction: column;
        gap: 10px;
    }
    
    .evolution-left-column,
    .evolution-right-column {
        width: 100%;
    }
}

/* Fix for small screens */
@media (max-width: 500px) {
    .evolution-mode-selector {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* Balance the two columns better */
.evolution-left-column {
    flex: 0.9;
    min-width: 150px;
    padding-right: 5px;
}

.evolution-right-column {
    flex: 1.1;
    min-width: 170px;
}

/* Improve model checkboxes layout */
.evolution-model-columns {
    display: flex;
    gap: 15px;
    margin-top: 2px;
}

/* Improve overall panel spacing */
.evolution-settings {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid #eee;
}

/* Adjust the evolution controls wrapper */
.preset-right-column .evolution-controls {
    padding: 6px 8px;
}

/* Improve small screen behavior */
@media (max-width: 768px) {
    .evolution-mode-selector {
        justify-content: flex-start;
    }
    
    .evolution-model-columns {
        gap: 20px;
    }
}

@media (max-width: 500px) {
    .evolution-model-columns {
        flex-direction: row;
        gap: 10px;
    }
}

/* Custom randomizer button in the evolution panel */
.evolution-custom-button {
    width: 100%;
    margin-top: 5px;
    text-align: center;
    padding: 6px;
    font-size: 0.9rem;
    background-color: #8e44ad;
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.evolution-custom-button:hover {
    background-color: #9b59b6;
}

/* Update styles for the randomize buttons now that custom is removed */
.randomize-row {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
}

/* No need for special styling for the last row anymore */
.randomize-row:last-child {
    justify-content: space-between;
}

.randomize-row:last-child .randomize-button {
    flex: 1;
    min-width: 0;
    max-width: none;
}

/* Allow more space for the controls in the evolution panel */
.evolution-left-column {
    flex: 1;
    min-width: 160px;
    padding-right: 5px;
}

/* Add more spacing between controls */
.evolution-controls-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

/* Make the slider controls more compact to fit the button */
.evolution-speed-control, 
.evolution-interval-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

/* Reduce vertical space used by mode selector */
.evolution-mode-selector {
    margin-bottom: 6px;
}

/* Add divider before custom button */
.evolution-custom-button {
    width: 100%;
    margin-top: 7px;
    padding-top: 6px;
    padding-bottom: 6px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive fixes */
@media (max-width: 900px) {
    .evolution-left-column {
        margin-bottom: 5px;
    }
    
    .evolution-custom-button {
        margin-top: 5px;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .evolution-custom-button {
        max-width: none;
    }
}

/* Dark theme support for the custom button in evolution panel */
body.dark-theme .evolution-custom-button {
    background-color: #9c27b0;
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .evolution-custom-button:hover {
    background-color: #ba68c8;
}

/* Navigation Panel - Compact version */
.navigation-panel {
    background-color: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px 6px 0 0; /* Rounded corners only on top */
    padding: 6px 10px;
    margin: 5px 0 0 0; /* Remove bottom margin */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

/* Adjust margins for panels that follow the navigation panel */
.navigation-panel + section,
.navigation-panel + div {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Adjust specific panels to match presets panel spacing */
.music-generator-controls-panel,
.synthesizer-controls-panel,
.effects-section,
.noise-section {
    margin-top: 0;
    margin-bottom: 5px;
}

.compact-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.compact-nav-buttons .section-nav-button {
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
}

.compact-nav-buttons .section-nav-button:hover {
    background-color: #5c9aff;
}

body.dark-theme .navigation-panel {
    background-color: #1a1a1a;
    border-color: #333;
}

body.dark-theme .compact-nav-buttons .section-nav-button {
    background-color: #3367d6;
}

body.dark-theme .compact-nav-buttons .section-nav-button:hover {
    background-color: #4285f4;
}

@media (max-width: 768px) {
    .compact-nav-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .compact-nav-buttons .section-nav-button {
        font-size: 0.8rem;
        padding: 6px 8px;
        min-width: 100px;
    }
}

/* Active button style */
.compact-nav-buttons .section-nav-button.active {
    background-color: #2a56c6;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    font-weight: bold;
}

/* Active button hover state */
.compact-nav-buttons .section-nav-button.active:hover {
    background-color: #3367d6;
}

body.dark-theme .compact-nav-buttons .section-nav-button.active {
    background-color: #1a237e;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

body.dark-theme .synth-controls-section + #customRandomizationPanel {
    border-top-color: #333;
}

/* Dark theme for Synthesizer/Presets Panel */
body.dark-theme .synth-controls-section {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    width: 100%;
    box-sizing: border-box;
}

/* Dark theme for preset controls wrapper */
body.dark-theme .preset-controls-wrapper {
    display: flex;
    gap: 15px;
    width: 100%;
}

body.dark-theme .preset-right-column {
    flex: 1.6;
    min-width: 350px;
}

body.dark-theme .preset-left-column {
    flex: 1;
    min-width: 200px;
}

/* Ensure proper spacing of randomize buttons */
.randomize-row {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
}

/* New styles for the two-column randomize button layout */
.randomize-columns {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
}

.randomize-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.randomize-column .randomize-button {
    width: 100%;
    padding: 8px 5px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.randomize-row .randomize-button {
    flex: 1;
    min-width: 0;
    padding: 6px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive styles for randomize buttons */
@media (max-width: 500px) {
    .randomize-columns {
        flex-direction: column;
        gap: 5px;
    }
    
    .randomize-column {
        width: 100%;
    }
    
    .randomize-column .randomize-button {
        margin-bottom: 3px;
        padding: 6px 4px;
    }
}

/* Playback Cell */
.playback-cell {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 5px 0; /* Reduced margin */
    padding: 12px; /* Reduced padding */
    border-radius: 6px;
}

/* Make playback panel current note display more compact */
.playback-cell .current-note {
    padding: 8px;
    gap: 8px;
}

.playback-cell .note-info {
    gap: 6px;
}

.playback-cell .note-label {
    min-width: 100px;
    font-size: 0.95em;
}

/* Further compress the playback version */
.playback-cell .codon-display,
.playback-cell .note-display,
.playback-cell .duration-display {
    font-size: 1.2em;
    font-weight: bold;
}

/* Additional selectors for rhythm codons in different contexts */
#currentRhythm,
.rhythm-related .codon-display {
    color: var(--light-rhythm-color);
}

/* Additional selectors for melody codons in different contexts */
#currentMelody,
.melody-related .codon-display {
    color: var(--light-melody-color);
}

/* Ensure the playback panel also follows the color scheme */
.playback-cell #currentMelody {
    color: var(--light-melody-color);
    font-weight: bold;
}

.playback-cell #currentRhythm {
    color: var(--light-rhythm-color);
    font-weight: bold;
}

/* More specific selectors to ensure proper coloring in all contexts */
.current-note .note-info:nth-child(1) .codon-display,
.current-note .note-info:nth-child(2) .codon-display {
    color: var(--light-melody-color); /* Green for melody codons */
}

.current-note .note-info:nth-child(3) .codon-display,
.current-note .note-info:nth-child(4) .codon-display {
    color: var(--light-rhythm-color); /* Purple for rhythm codons */
}

body.dark-theme .gradient-bar {
    height: 1px; /* Match the ultra-thin track */
    top: 16.5px; /* Match position with the track */
    opacity: 0.4; /* Slightly more visible than the track but still subtle */
    border-radius: 0;
}

body.dark-theme h1 {
    color: #4CAF50; /* Match the dark theme accent color */
    font-size: 1.8rem; /* Reduced size from default */
    transition: font-size 0.3s ease;
}

body.dark-theme .chromatone-title {
    color: #b19dff; /* Lighter Medium Purple for dark mode */
}

body.dark-theme .site-logo {
    filter: brightness(0.9);
}

body.dark-theme .site-logo {
    filter: brightness(0.9); /* Slightly reduce brightness in dark mode if needed */
    max-height: 40px; /* Reduced logo size */
    transition: max-height 0.3s ease;
}

/* Make file upload background black in dark mode */
body.dark-theme .file-upload {
    background-color: #000000 !important; /* Pure black background */
    border-radius: 5px !important;
    padding: 8px !important;
    margin-bottom: 8px !important;
}

/* Add specific styling for the noise section to reduce space */
.noise-section {
    margin: 0;
    padding: 0;
    margin-top: -45px; /* Increased negative margin by 20px more (from -25px to -45px) */
    position: relative; /* Position relative to make the negative margin work properly */
    z-index: 1; /* Add z-index to ensure it doesn't get hidden */
}

/* More specific selector for light mode to ensure it gets applied */
body:not(.dark-theme) .noise-section {
    margin-top: -45px !important; /* Force the same negative margin in light mode */
    position: relative !important;
    z-index: 1 !important;
}

.effects-section {
    margin-top: 0;
    margin-bottom: 2px;
}

.effects-control, .noise-controls {
    display: grid;
    gap: 15px;
    padding: 0 12px 12px 12px; /* Removed top padding, kept padding on other sides */
    margin-top: 0; /* Removed top margin */
    background-color: #f5f5f5;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

/* Specific styling for noise-controls to reduce space */
.noise-section .noise-controls {
    grid-template-columns: repeat(6, 1fr);
    padding-top: 0; /* No top padding */
    gap: 10px; /* Smaller gap between elements */
}

/* More specific selector for light mode to ensure it gets applied */
body:not(.dark-theme) .synthesizer-controls-panel {
    margin-top: -47px !important; /* Increased negative margin by 2px more (from -45px to -47px) */
    position: relative !important;
    z-index: 1 !important;
}

/* More specific selector for light mode to ensure it gets applied */
body:not(.dark-theme) .music-generator-controls-panel {
    margin-top: -5px !important; /* Force the same negative margin in light mode */
    position: relative !important;
    z-index: 1 !important;
}

/* More specific selector for light mode to ensure it gets applied */
body:not(.dark-theme) .synth-controls-section {
    margin-top: -5px !important; /* Force the same negative margin in light mode */
    position: relative !important;
    z-index: 1 !important;
}

/* Codon highlighting styles */
.codon-span {
    display: inline-block;
    padding: 0 1px;
    border-radius: 2px;
    transition: background-color 0.2s, color 0.2s;
}

.highlight-codon {
    background-color: rgba(76, 175, 80, 0.5); /* Green for light theme */
    color: #000;
    font-weight: bold;
}

/* For rhythm codons */
#rhythmDisplay .highlight-codon {
    background-color: rgba(106, 27, 154, 0.5); /* Purple for rhythm */
}

/* Dark theme styles */
body.dark-theme .highlight-codon {
    background-color: rgba(76, 175, 80, 0.6); /* Brighter green for dark theme */
    color: #fff;
}

body.dark-theme #rhythmDisplay .highlight-codon {
    background-color: rgba(156, 39, 176, 0.6); /* Brighter purple for dark theme */
}

/* Rhythmic Plasmids Styles */
.plasmids-section {
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.plasmids-section .section-header {
    margin-bottom: 10px;
}

.plasmids-section h4 {
    margin: 0 0 5px 0;
    color: var(--rhythm-color);
    font-size: 14px;
}

.plasmids-section small {
    color: #666;
    font-size: 12px;
}

.plasmid-controls {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.plasmid-controls label {
    margin-right: 8px;
    font-size: 12px;
    min-width: 60px;
}

.plasmid-controls select {
    flex: 1;
    padding: 4px;
    font-size: 12px;
}

.plasmid-controls .small-button {
    padding: 4px 8px;
    margin-left: 8px;
    background-color: var(--rhythm-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.plasmid-controls .small-button:hover {
    background-color: var(--button-hover-purple);
}

.plasmid-description {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding: 5px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    min-height: 30px;
}

/* Dark theme adjustments for plasmids section */
body.dark-theme .plasmids-section {
    background-color: #333333;
    border-color: #444444;
}

body.dark-theme .plasmids-section small {
    color: #aaa;
}

body.dark-theme .plasmid-description {
    background-color: #222222;
    border-color: #444444;
    color: #ddd;
}

/* Notification styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 10px 15px;
    border-radius: 4px;
    color: white;
    max-width: 300px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    animation: slide-in 0.3s ease-out forwards;
    opacity: 1;
}

.notification-hide {
    opacity: 0;
}

.notification-info {
    background-color: #2196F3;
}

.notification-success {
    background-color: #4CAF50;
}

.notification-warning {
    background-color: #FF9800;
}

.notification-error {
    background-color: #F44336;
}

@keyframes slide-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dark theme adjustments for notifications */
body.dark-theme .notification-info {
    background-color: #1976D2;
}

body.dark-theme .notification-success {
    background-color: #388E3C;
}

body.dark-theme .notification-warning {
    background-color: #F57C00;
}

body.dark-theme .notification-error {
    background-color: #D32F2F;
}

/* Floating Panel Styles */
.floating-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none; /* Hidden by default */
    max-height: 90vh;
    overflow: hidden;
    flex-direction: column;
}

.floating-panel.visible {
    display: flex !important; /* Override any inline styles */
}

/* Apply a specific panel header color for Synth Presets */
#synthPresetsPanel .panel-header {
    background-color: #2962ff; /* Blue color to match the UI theme */
}

#synthPresetsPanel .action-button {
    background-color: #2962ff; /* Same color as the header */
}

#synthPresetsPanel .action-button:hover {
    background-color: #1e55f3; /* Slightly darker on hover */
}

/* Make sure the transform toggle button for synth presets is styled correctly */
#synthPresetsToggle {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 0.75em;
}

/* Styles for Synth Presets Panel */
#synthPresetsPanel .panel-header {
    background-color: #2962ff; /* Blue color to match the UI theme */
}

#synthPresetsPanel .action-button {
    background-color: #2962ff; /* Same color as the header */
}

#synthPresetsPanel .action-button:hover {
    background-color: #1e55f3; /* Slightly darker on hover */
}

/* Synth presets toggle button */
#synthPresetsToggle {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 0.75em;
    background-color: #a3c7fe; /* Light blue color */
    color: #000000;
    border: 1px solid #5f8fe8;
}

#synthPresetsToggle:hover {
    background-color: #6bb5fc; /* Darker blue on hover */
}

body.dark-theme #synthPresetsPanel .panel-header {
    background-color: #1e55f3; /* Darker blue for dark theme */
}

body.dark-theme #synthPresetsPanel .action-button {
    background-color: #1e55f3;
}

body.dark-theme #synthPresetsPanel .action-button:hover {
    background-color: #1845d3;
}

body.dark-theme #synthPresetsToggle {
    background-color: #2d5c7c; /* Dark blue for dark theme */
    color: #ffffff;
    border: 1px solid #5f8fe8;
}

body.dark-theme #synthPresetsToggle:hover {
    background-color: #3e7ba6; /* Lighter blue on hover for dark theme */
}

/* Checkbox container styling */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 5px;
}

.checkbox-container span {
    font-size: 0.8rem;
    color: #555;
}

.randomizer-method-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 10px 0;
}

.randomizer-method-buttons .action-button {
    flex: 1;
    min-width: 0;
    font-size: 0.85em;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments for randomizer method buttons */
@media (max-width: 1200px) {
    .randomizer-method-buttons {
        flex-wrap: wrap;
    }
    
    .randomizer-method-buttons .action-button {
        flex: 1 1 calc(33.33% - 8px);
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .randomizer-method-buttons .action-button {
        flex: 1 1 calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .randomizer-method-buttons .action-button {
        flex: 1 1 100%;
    }
}

/* Parameter selection buttons styling */
.control-group:has(h4:contains("Parameter Selection")) {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group:has(h4:contains("Parameter Selection")) .action-button {
    flex: 1;
    min-width: 0;
    font-size: 0.85em;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.control-group:has(h4:contains("Parameter Selection")) .action-button:not(:last-child) {
    margin-right: 8px;
}

/* Responsive adjustments for parameter selection buttons */
@media (max-width: 768px) {
    .control-group:has(h4:contains("Parameter Selection")) {
        flex-direction: column;
    }
    
    .control-group:has(h4:contains("Parameter Selection")) .action-button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* Fixed Panel Styles */
.fixed-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    display: none; /* Hidden by default */
}

.fixed-panel.visible {
    display: block;
}

.fixed-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.fixed-panel .panel-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1em;
}

.fixed-panel .panel-content {
    margin-top: 10px;
}

.fixed-panel .panel-description {
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.9em;
}

.fixed-panel .panel-description p {
    margin: 0;
    color: var(--text-color);
}

/* Super Evolution Toggle Button */
#superEvolutionToggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    padding: 0;
    border: none;
    cursor: pointer;
}

#superEvolutionToggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

#superEvolutionToggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

#superEvolutionToggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

#superEvolutionToggle input:checked + .toggle-slider {
    background-color: #725AC1;
}

#superEvolutionToggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

body.dark-theme #superEvolutionToggle .toggle-slider {
    background-color: #555;
}

body.dark-theme #superEvolutionToggle input:checked + .toggle-slider {
    background-color: #8A6FE8;
}

/* Super Evolution Cursor Highlight */
.cursor-highlight {
    background-color: #ffeb3b;
    padding: 2px 0;
    border-radius: 2px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

body.dark-theme .cursor-highlight {
    background-color: #ffd700;
    color: #000;
}

/* Hide page navigation buttons */
#superEvolutionPrevPage,
#superEvolutionNextPage {
    display: none !important;
}

/* Super Evolution Toggle in Header */
.panel-header #superEvolutionToggle {
    margin-left: 10px;
    margin-right: 10px;
    vertical-align: middle;
}

.panel-header h4 {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
}

/* Hide cursor speed dialog and MIDI file selection in super evolution panel */
#superEvolutionPanel .cursor-speed-container,
#superEvolutionPanel .file-input-label,
#superEvolutionPanel #superEvolutionMidiFile {
    display: none !important;
}

/* Super Evolution display should be taller */
#superEvolutionDisplay {
    height: 160px !important;
}

/* Footer Styles */
.footer {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer .license-link {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-color);
    transition: opacity 0.2s ease;
}

.footer .license-link:hover {
    opacity: 1;
}

/* Sampler Controls Panel */
.sampler-controls-panel {
    background-color: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.sampler-controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.sampler-iframe-container {
    background: transparent;
    border: 1px solid #828283;
    border-radius: 8px;
    padding: 10px;
    margin-top: -25px;
    width: 100%;
    box-sizing: border-box;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

#sampler-iframe {
    width: 100%;
    height: 800px;
    border: none;
    box-sizing: border-box;
    max-width: 800px;
}

/* Drum Machine Panel Styles */
.drum-machine-panel {
    background: #f0f7ff;
    border: 1px solid #c5d9f1;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: -40px;
    margin-bottom: 2px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Tape Deck Panel Styles */
.tape-deck-panel {
    background: #f0f7ff;
    border: 1px solid #c5d9f1;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: -40px;
    margin-bottom: 2px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.tape-deck-panel .tape-deck-iframe-container {
    background: transparent;
    border-radius: 8px;
    padding: 0;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.tape-deck-panel #tape-deck-iframe {
    width: 100%;
    height: 1500px;
    border: none;
    box-sizing: border-box;
    max-width: 100%;
    display: block;
    visibility: visible;
}

.drum-machine-panel .drum-machine-iframe-container {
    background: transparent;
    border-radius: 8px;
    padding: 0;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.drum-machine-panel #drum-machine-iframe {
    width: 100%;
    height: 800px;
    border: none;
    box-sizing: border-box;
    max-width: 100%;
    display: block;
    visibility: visible;
}

/* Drum Machine Section Styles (legacy) */
.drum-machine-section {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    margin-top: -25px;
    width: 100%;
    box-sizing: border-box;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.drum-machine-iframe-container {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    margin-top: -25px;
    width: 100%;
    box-sizing: border-box;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

#drum-machine-iframe {
    width: 100%;
    height: 600px;
    border: none;
    box-sizing: border-box;
    max-width: 800px;
}

/* Dark theme support for drum machine */
body.dark-theme .drum-machine-panel {
    background: #1a1a1a;
    border: 1px solid #333;
}

body.dark-theme .drum-machine-panel .drum-machine-iframe-container {
    background: transparent;
    border: none;
}

/* Dark theme support for tape deck */
body.dark-theme .tape-deck-panel {
    background: #1a1a1a;
    border: 1px solid #333;
}

body.dark-theme .drum-machine-section {
    background: #1a1a1a;
    border: 1px solid #333;
}

body.dark-theme .drum-machine-iframe-container {
    background: #1a1a1a;
    border: 1px solid #333;
}

/* Update container to ensure proper centering */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Update playback panel width to match container */
.playback-panel {
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    padding: 12px 15px;
    margin-top: 0;
    margin-bottom: 2px;
    border-radius: 8px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Update genetic code tables section width */
.genetic-code-tables-section {
    margin-top: 0;
    margin-bottom: 2px;
    padding: 10px;
    background-color: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #c5d9f1;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Style the sampler section header */
.sampler-section {
    margin-top: -25px;
    position: relative;
    z-index: 1;
}

.sampler-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: var(--light-text-primary);
    text-align: center;
}

/* Style the sampler controls title in the iframe */
#sampler-iframe {
    width: 100%;
    height: 800px;
    border: none;
    box-sizing: border-box;
    max-width: 800px;
}

/* Target the h2 inside the sampler iframe */
#sampler-iframe h2 {
    color: #2962ff !important;
    font-size: 1.1em !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    border-bottom: 1px solid #c5d9f1 !important;
    padding-bottom: 3px !important;
    font-weight: bold !important;
}

/* Dark theme support for sampler section */
body.dark-theme .sampler-section h2 {
    color: var(--dark-text-primary);
}

/* Main oscilloscope container */
.main-oscilloscope {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 48px !important;
}

.main-oscilloscope .oscilloscope-title {
    width: 50px !important;
    flex-shrink: 0 !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;
    color:#000000 !important;
}

.main-oscilloscope .oscilloscope-channels {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 250px !important;
    max-width: 250px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-oscilloscope .oscilloscope-channel-container {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    height: 22px !important;
}

.main-oscilloscope .channel-label {
    width: 10px !important;
    text-align: center !important;
    font-size: 0.8em !important;
    color: var(--text-color) !important;
}

.main-oscilloscope #oscilloscopeLeft,
.main-oscilloscope #oscilloscopeRight {
    width: 250px !important;
    height: 22px !important;
    background-color: var(--bg-color) !important;
    border-radius: 4px !important;
}

.vu-widget {
    width: 320px !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px !important;
}

.vu-meter-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.vu-meter-title {
    font-size: 0.9rem !important;
    font-weight: bold !important;
    color: #333 !important;
    white-space: nowrap !important;
    margin-left: 3px !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    text-align: center !important;
}

.vu-meter.stereo-vu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 250px !important;
    max-width: 250px !important;
    position: relative !important;
    padding: 8px !important;
    margin: 0 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 4px !important;
    background-color: #f5f5f5 !important;
    height: auto !important;
    min-height: 45px !important;
    flex-shrink: 0 !important;
}

/* Metronome LED styles */
#metronomeLed {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    margin-left: 8px;
    transition: background-color 0.1s ease;
}

#metronomeLed.active {
    background-color: #2962ff;
}

body.dark-theme #metronomeLed {
    background-color: #444;
}

body.dark-theme #metronomeLed.active {
    background-color: #7b68ee;
}

body.dark-theme #metronomeLed.active {
    background-color: #4CAF50 !important;
    box-shadow: 0 0 10px #4CAF50 !important;
}

/* Chronometer Styles */
.chronometers-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    background-color: var(--light-bg-secondary);
    border: 1px solid var(--light-border);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.chronometer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chronometer-display {
    background-color: var(--light-code-bg);
    border: 1px solid var(--light-border);
    border-radius: 3px;
    padding: 3px 6px;
    min-width: 65px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    color: var(--light-text-primary);
}

/* Color coding for chronometers */
.playback-timer {
    color: #4CAF50 !important; /* Light green for playback */
}

.record-timer {
    color: #F44336 !important; /* Light red for record */
}

/* Dark theme chronometer styles */
body.dark-theme .chronometers-container {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

body.dark-theme .chronometer-display {
    background-color: var(--dark-code-bg);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

/* Dark theme color coding */
body.dark-theme .playback-timer {
    color: #66BB6A !important; /* Lighter green for dark theme */
}

body.dark-theme .record-timer {
    color: #EF5350 !important; /* Lighter red for dark theme */
}

/* Responsive design for chronometers */
@media (max-width: 500px) {
    .chronometers-container {
        max-width: 160px;
        padding: 4px 8px;
    }
    
    .chronometer-display {
        min-width: 55px;
        font-size: 10px;
        padding: 2px 4px;
    }
}

body.dark-theme .rhythm-column .file-name-display {
    color: var(--dark-rhythm-color);
}

/* Superevolution file name display styling */
#superEvolutionFileNameDisplay {
    font-weight: bold;
    color: #2196F3; /* Blue color for superevolution */
}

body.dark-theme #superEvolutionFileNameDisplay {
    color: #64B5F6; /* Lighter blue for dark theme */
}

/* Distortion Toggle Button - Unique Styles */
#distortionToggle {
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #ff6b35; /* Orange-red for distortion */
    color: white !important;
    border: 1px solid #e55a2b;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#distortionToggle.off {
    background-color: #6c757d;
    border-color: #5a6268;
    color: white !important;
}

#distortionToggle:hover {
    background-color: #ff5722;
    border-color: #d84315;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

#distortionToggle.off:hover {
    background-color: #5a6268;
    border-color: #495057;
}

/* Dark theme support for distortion toggle */
body.dark-theme #distortionToggle {
    background-color: #ff7043; /* Lighter orange for dark theme */
    border-color: #ff5722;
    color: #1a1a1a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

body.dark-theme #distortionToggle.off {
    background-color: #495057;
    border-color: #343a40;
    color: #e0e0e0 !important;
}

body.dark-theme #distortionToggle:hover {
    background-color: #ff5722;
    border-color: #e64a19;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

body.dark-theme #distortionToggle.off:hover {
    background-color: #343a40;
    border-color: #212529;
}

/* Sampler octave range display styling - now uses .octave-range-display class */

/* Ensure proper spacing for the flex container */
.effect-group > div:first-child {
    margin-bottom: 8px;
}

/* Responsive adjustments for sampler octave range display */
@media (max-width: 480px) {
    #samplerOctaveRangeDisplay {
        font-size: 0.8rem;
        min-width: 3.5rem;
    }
}

/* Make synth octave range display always yellow to match sampler */
.octave-range-display {
    color: var(--warning-color, #ff9800) !important; /* Always yellow/orange */
}

body.dark-theme .octave-range-display {
    color: var(--warning-color-dark, #ffb74d) !important; /* Always yellow/orange in dark theme */
}

.small-toggle#drumMachineSyncToggle {
    font-size: 1.1em !important;
    padding: 2px 6px !important;
    height: 1.6em !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1.1em !important;
    background: #848484 !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.small-toggle#drumMachineSyncToggle.active {
    background: #2962ff !important;
    color: #fff !important;
}

.small-toggle#tapeDeckSyncToggle {
    font-size: 1.1em !important;
    padding: 2px 6px !important;
    height: 1.6em !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1.1em !important;
    background: #848484 !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.small-toggle#tapeDeckSyncToggle.active {
    background: #2962ff !important;
    color: #fff !important;
}
