/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.loading-container {
    text-align: center;
    max-width: 300px;
    padding: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.loading-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    font-family: sans-serif;
}

.loading-progress {
    width: 100%;
}

.loading-bar {
    width: 250px;
    height: 6px;
    background-color: #333;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 10px auto;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.loading-status {
    color: #ccc;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    margin: 0;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: #ededed;
    position: relative;
    overflow-x: hidden;
}

/* Main sections */
.top-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 15px 0;
}

.header-right {
    margin-right: 20px;
}

.links {
    font-weight: bold;
    font-size: 14px;
    font-family: sans-serif;
    color: #000;
    text-decoration: none;
}

.links:hover {
    color: #333;
}

/* Fold line is conceptual, not a visible element */

/* Transposer toggle (hamburger menu) */
.hamburger-button {
    width: 50px;
    height: 50px;
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 20px auto;
    z-index: 10;
}

/* Transposer section (initially hidden on desktop) */
#transposer-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.hidden-on-desktop {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.visible-section {
    max-height: 2000px; /* Large enough to show all content */
}

/* Loop controls */
.loop-controls {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}

.loop-container {
    flex: 1;
    background-color: #ededed;
    color: #000;
    border: none;
    padding: 15px 0;
    text-align: center;
    margin: 0 5px;
    position: relative; /* Enable positioning for adjustment lines */
}

.loop-button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px;
    margin: 10px auto;
    width: 80%;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-weight: bold;
    display: block;
}

.loop-button.active {
    background-color: #4caf50;
}

.loop-button.marking {
    background-color: #ffc107;
    color: #000;
    animation: pulse 0.8s ease-in-out infinite;
}

.loop-progress-bar {
    width: 80%;
    height: 5px;
    background-color: #ddd;
    margin: 0 auto 10px auto;
    border-radius: 2px;
    overflow: hidden;
}

.loop-progress {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    border-radius: 3px;
    transition: width 0.1s ease;
}

/* Loop duration slider controls */
.loop-duration-slider-container {
    width: 90%;
    margin: 10px auto;
    padding: 10px 0;
}

.loop-duration-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

.loop-duration-slider::-webkit-slider-track {
    height: 4px;
    background: #ddd;
}

.loop-duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.loop-duration-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.loop-duration-slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

/* Add reference lines for loop adjustment sliders */
.loop-duration-slider {
    background: linear-gradient(to right, 
        #ddd 0%, 
        #ddd calc(16.67% - 1px), 
        rgba(255, 107, 107, 0.8) calc(16.67% - 1px), 
        rgba(255, 107, 107, 0.8) calc(16.67% + 1px), 
        #ddd calc(16.67% + 1px),
        #ddd calc(50% - 1px), 
        rgba(255, 255, 255, 0.9) calc(50% - 1px), 
        rgba(255, 255, 255, 0.9) calc(50% + 1px), 
        #ddd calc(50% + 1px),
        #ddd calc(83.33% - 1px), 
        rgba(76, 175, 80, 0.8) calc(83.33% - 1px), 
        rgba(76, 175, 80, 0.8) calc(83.33% + 1px), 
        #ddd calc(83.33% + 1px),
        #ddd 100%);
}

/* Position slider has different range, so different percentages */
#loop1-position, #loop2-position {
    background: linear-gradient(to right, 
        #ddd 0%, 
        #ddd calc(25% - 1px), 
        rgba(255, 107, 107, 0.8) calc(25% - 1px), 
        rgba(255, 107, 107, 0.8) calc(25% + 1px), 
        #ddd calc(25% + 1px),
        #ddd calc(50% - 1px), 
        rgba(255, 255, 255, 0.9) calc(50% - 1px), 
        rgba(255, 255, 255, 0.9) calc(50% + 1px), 
        #ddd calc(50% + 1px),
        #ddd calc(75% - 1px), 
        rgba(76, 175, 80, 0.8) calc(75% - 1px), 
        rgba(76, 175, 80, 0.8) calc(75% + 1px), 
        #ddd calc(75% + 1px),
        #ddd 100%);
}

.slider-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-top: 2px;
    color: #666;
    padding: 0 8px;
    width: 100%;
    box-sizing: border-box;
}

.slider-numbers span {
    text-align: center;
    flex: 1;
}

.slider-numbers span {
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.slider-numbers span:nth-child(6) {
    color: #fff;
    font-weight: bold;
    background-color: #000;
    border-radius: 2px;
    padding: 1px 3px;
}

.slider-label {
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    font-weight: bold;
}

/* Main loop button progress bar */
.main-loop-progress-bar {
    width: 100%;
    height: 5px;
    background-color: #ddd;
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
}

.main-loop-progress {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    transition: width 0.1s linear;
}

.loop-header {
    font-weight: bold;
}

/* Mixer controls */
.mixer-controls-container {
    display: flex;
    width: 100%;
    max-width: 400px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mixer-column {
    width: 48%;
    background-color: #ededed;
    border: none;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #000;
}

.mixer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
}

.mixer-number {
    font-size: 24px;
    font-weight: bold;
}

.track-select-btn {
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.track-select-btn:hover {
    background-color: #000;
    color: #fff;
}

.remove-track-btn {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    margin-left: 5px;
}

.remove-track-btn:hover {
    background-color: #333;
    border-color: #333;
}

.track-info {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.track-title {
    font-size: 12px;
    font-weight: bold;
    color: #000;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-time {
    font-size: 11px;
    color: #666;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.track-position-bar {
    width: 100%;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.track-position-progress {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    transition: width 0.1s linear;
    border-radius: 2px;
}

.mixer-control {
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mixer-label {
    margin-bottom: 5px;
    font-weight: bold;
}

.mixer-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    background: #ddd;
    outline: none;
    margin: 10px 0;
}

.mixer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mixer-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.mixer-slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

/* Dual-handle EQ frequency range slider */
.eq-freq-range-container {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 10px 0;
}

.eq-freq-track {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    z-index: 1;
}

.eq-freq-range {
    position: absolute;
    width: 100%;
    height: 4px;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 0;
    z-index: 2;
}

.eq-freq-low {
    top: 17px;
}

.eq-freq-high {
    top: 23px;
}

.eq-freq-range::-webkit-slider-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}

.eq-freq-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-top: -5px;
    z-index: 3;
}

.eq-freq-range:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.eq-freq-range:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

.eq-freq-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
}

.eq-freq-value {
    font-size: 10px;
    color: #666;
    font-family: monospace;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.eq-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.eq-toggle-label {
    font-size: 11px;
    color: #666;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.eq-toggle-container .toggle-switch {
    width: 34px;
    height: 18px;
}

.eq-toggle-container .toggle-slider {
    border-radius: 18px;
}

.eq-toggle-container .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
}

.eq-toggle-container input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Footer text */
.footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.footer-text a {
    color: #000;
    text-decoration: none;
    font-weight: bold;
}

/* Support button */
.support-section {
    width: 100%;
    max-width: 400px;
    margin: 10px 0 30px 0;
    text-align: center;
}

#support-button {
    background: #ededed;
    color: #000;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    border-radius: 0;
    font-family: sans-serif;
    outline: none;
    transition: all 0.1s ease;
}

#support-button:focus {
    outline: none;
    box-shadow: none;
}

#support-button:active {
    background: #000;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
}

/* Custom Stripe button wrapper with brand styling */
.support-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-stripe-wrapper {
    position: relative;
    display: inline-block;
    background: #ededed;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 10px 20px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
    min-width: 160px;
    text-align: center;
    user-select: none;
}

.custom-stripe-wrapper:hover {
    background: #dadada;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.custom-stripe-wrapper:active {
    background: #d0d0d0;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(2px);
}

/* Hide the actual Stripe button but keep it functional */
stripe-buy-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* Ensure Stripe button covers the entire wrapper */
stripe-buy-button button {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

/* Keep The Music button styling */
.keep-music-btn {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 10px 20px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
    min-width: 160px;
    text-align: center;
    margin-left: 15px;
    user-select: none;
}

.keep-music-btn:hover {
    background: #333;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.keep-music-btn:active {
    background: #555;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(2px);
}

/* Player controls section */
.player-controls {
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
}

.album-container {
    position: relative;
    width: 60%; /* Adjusted for better fit on objkt */
    max-width: 400px; /* Original max-width */
    aspect-ratio: 1 / 1; /* Assuming square album art */
    overflow: hidden;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
    margin: 20px 0;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    transition: transform 0.5s ease-in-out;
}

.page img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.controls {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px; /* Match album container max-width */
    justify-content: space-between;
    position: static; /* Make position static */
    padding: 10px;
    box-sizing: border-box;
}

.controls button {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    margin: 0 2px;
    position: static; /* Make position static */
    border-radius: 0;
    font-family: sans-serif;
    border: none;
    background: #ededed;
    outline: none;
    transition: all 0.1s ease;
    
    /* iOS Safari button overrides */
    -webkit-appearance: none;
    appearance: none;
    color: #000;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.controls button:focus {
    outline: none;
    box-shadow: none;
}

.controls button.active {
    background: #000;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#play-pause-btn.playing {
    background: #000;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.controls button:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
}

#play-pause-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    position: static; /* Ensure static positioning */
    width: 80px; /* Fixed width to prevent shifting */
}

.button-group {
    margin-top: 20px; /* Add space below the album container */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the buttons horizontally */
}

stripe-buy-button {
    margin: 20px auto 0 auto; /* Add margin top and auto left/right for centering */
    max-width: 400px; /* Match album container max-width */
    --buy-button-background-color: #000000;
    --buy-button-text-color: #ffffff;
    --buy-button-border-radius: 4px;
    --buy-button-font-family: sans-serif;
}

/* Style all buttons consistently */
button {
    border-radius: 4px;
    font-family: sans-serif;
    border: 1px solid #000;
    background: #ededed;
}

/* Ensure controls are properly spaced */
.controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    position: static; /* Ensure static positioning */
}

/* Bold text for track names */
.bold {
    font-weight: 700;
}

/* Time display styling */
.time-display {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin: 8px 0;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.8);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 4px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    position: relative;
    color: white;
}

.close-btn {
    color: #ddd;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

/* Tracklist styles */
#tracklist {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#tracklist li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
}

#tracklist li:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#tracklist li.active {
    background-color: rgba(0, 0, 0, 0.9);
    font-weight: bold;
}

/* Now playing container */
#now-playing-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 0 auto 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#now-playing {
    margin: 10px 0 5px 0;
    font-size: 14px;
    text-align: center;
    width: 100%;
}

#now-playing-info {
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 0 auto 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Progress wrapper to contain the dot and progress bar */
.progress-wrapper {
    position: relative;
    width: 300px; /* Fixed width for consistent sizing */
    height: 36px;
    margin: 10px auto; /* Center the progress bar */
}

/* Progress dot that sits centered on the bar */
.progress-dot {
    position: absolute;
    top: 0;
    left: 0px; /* Starting position, will be updated by JS */
    width: 36px;
    height: 36px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: left 0.1s ease;
}

/* Only apply hover effect to the dot, not the entire wrapper */
.progress-dot:hover {
    transform: scale(1.1);
}

.progress-dot:active {
    transform: scale(1.2);
}

#progress-container {
    width: 300px; /* Fixed width matching wrapper */
    height: 9px; /* 25% of original 36px height */
    background-color: #ddd;
    border-radius: 4.5px; /* Half of height for fully rounded edges */
    overflow: hidden;
    margin: 0; /* Remove margin since dot is now aligned */
    position: relative;
    transition: all 0.2s ease;
    top: 13.5px; /* Center the bar vertically with the dot (36px dot - 9px bar = 27px / 2 = 13.5px) */
}

/* Remove hover effect from progress container */

#progress-container.progress-hover::after {
    content: "";
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.03);
    pointer-events: none;
}

#progress-bar {
    height: 100%;
    width: 0;
    background-color: #000;
    border-radius: 4.5px; /* Half of height for fully rounded edges */
    transition: none;
    position: relative;
}

/* Remove the pseudo-element dot since we now have an actual element */

#progress-container:hover #progress-bar::after {
    transform: translateY(-50%) scale(1.1);
}

/* Playback mode toggle - modern style */
.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    gap: 20px;
    flex-direction: row; /* Ensure controls are side-by-side */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.playback-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

/* Make toggle switch respond to hover like sliders */
.toggle-switch:hover .toggle-slider:before {
    transform: scale(1.1);
}

.toggle-switch:active .toggle-slider:before {
    transform: scale(1.2);
}

input[type="checkbox"]:checked + .toggle-slider:hover:before {
    transform: translateX(26px) scale(1.1);
}

input[type="checkbox"]:checked + .toggle-slider:active:before {
    transform: translateX(26px) scale(1.2);
}

.playback-mode label {
    cursor: pointer;
    user-select: none;
    font-weight: 700; /* Make Mix Mode label bold */
}

/* Hide the default checkbox */
.playback-mode input[type="checkbox"] {
    height: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
}

/* Create custom toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* The slider/track */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

/* The toggle button/circle */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

/* Ensure the progress bar is fully black when filled */
#progress-bar {
    background-color: #000 !important;
}

/* Checked state */
input[type="checkbox"]:checked + .toggle-slider {
    background-color: #000;
}

input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Mixer section styles */
.mixer-section {
    margin-top: 20px;
    padding: 10px;
    border-radius: 8px;
    max-width: 400px;
    display: none; /* Hidden by default, shown when in layered mode */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(-10px);
}

.mixer-section.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mixer-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    text-align: center;
    color: #333;
}

.track-control {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.track-control:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.layered-simple-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Hamburger menu button */
#select-track-btn {
    padding: 10px 0;
    background-color: transparent;
    color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 24px;
    width: 50px;
    height: 50px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#select-track-btn:hover {
    transform: translateY(-1px);
}

#select-track-btn:active {
    transform: translateY(0);
}

/* Hamburger icon */
.hamburger-icon {
    width: 24px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: #000;
    border-radius: 3px;
}

#active-tracks-list {
    margin-top: 10px;
}

.active-track-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.active-track-item:hover {
    background-color: #e8e8e8;
}

.track-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.remove-btn {
    background-color: transparent;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    text-decoration: underline;
    transform: translateY(-1px);
}

.remove-btn:active {
    transform: translateY(0);
}

.slider-container {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 10px;
}

.slider-container label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
}

.slider-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    margin-bottom: 15px;
}

/* Modern slider styling */
.slider-row input[type="range"] {
    flex-grow: 1;
    height: 36px; /* Increased by 450% (8px * 4.5) */
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 18px; /* Fully rounded edges (half of height) */
    transition: background 0.3s;
}

/* Add center marker for delay slider */
#global-delay {
    background: linear-gradient(to right, 
        #ddd 0%, 
        #ddd calc(50% - 2px), 
        #000 calc(50% - 2px), 
        #000 calc(50% + 2px), 
        #ddd calc(50% + 2px), 
        #ddd 100%);
}

/* Frequency range container */
.freq-range-container {
    position: relative;
    width: 100%;
    height: 50px;
    margin-bottom: 10px;
}

/* Frequency range sliders */
.freq-range {
    position: absolute;
    width: 100%;
    margin: 0;
    background: transparent;
    pointer-events: all;
    z-index: 10;
}

#freq-filter-low {
    top: 0;
}

#freq-filter-high {
    top: 10px;
}

/* Customize the track appearance for range sliders */
.freq-range::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
}

/* Different colors for high and low filters */
#freq-filter-low::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #ddd, #000);
}

#freq-filter-high::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #000, #ddd);
}

/* Customize the thumb appearance for range sliders */
.freq-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 30px;
    width: 30px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    margin-top: -10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Ensure the slider value text has enough width for the real-time position display */
.slider-value {
    min-width: 140px;
    max-width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    display: block;
    margin: 10px auto 5px auto;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 16px;
}

/* Slider track for browsers that support it */
.slider-row input[type="range"]::-webkit-slider-runnable-track {
    height: 36px; /* Increased by 450% (8px * 4.5) */
    border-radius: 18px; /* Fully rounded edges (half of height) */
    background: linear-gradient(to right, #000 var(--value, 0%), #ddd var(--value, 0%));
}

/* Ensure the filled part is fully black */
.slider-row input[type="range"]::-moz-range-progress {
    background-color: #000;
}

/* Slider thumb styling */
.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: 2px solid #fff;
    margin-top: 0; /* Center the thumb on the track */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

/* Hover and active states */
.slider-row input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.slider-row input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

.slider-value {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Special styles for the wait/play position modes */
.slider-value.wait-mode {
    background-color: rgba(255, 236, 179, 0.4);
    border-left: 3px solid #ffc107;
}

.slider-value.play-mode {
    background-color: rgba(200, 230, 201, 0.4);
    border-left: 3px solid #4caf50;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .controls {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 5px;
        padding: 5px;
    }
    
    .controls button {
        margin: 0;
        flex: 1;
        padding: 6px 8px;
        font-size: 12px;
        min-width: 0; /* Allow buttons to shrink below their content width */
    }
    
    .player-controls-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-wrapper {
        height: 50px; /* Make touch targets larger on mobile */
        width: 300px; /* Keep fixed width like desktop for consistent calculations */
        max-width: 90%; /* But don't exceed 90% of screen */
    }
    
    .progress-dot {
        width: 42px;
        height: 42px;
    }
    
    #progress-container {
        width: 300px; /* Match wrapper fixed width */
        max-width: 100%; /* But don't exceed wrapper width */
        height: 10px; /* Slightly larger bar for mobile */
        top: 16px; /* Adjust vertical centering for larger dot (42px dot - 10px bar = 32px / 2 = 16px) */
    }
    
    .slider-row input[type="range"] {
        height: 42px; /* Larger sliders for touch */
    }
    
    .slider-row input[type="range"]::-webkit-slider-thumb {
        width: 42px;
        height: 42px;
    }
    
    /* Keep transposer section hidden by default on mobile too, but allow visible override */
    .hidden-on-desktop {
        max-height: 0;
    }
    
    .hidden-on-desktop.visible-section {
        max-height: 2000px; /* Allow mix mode to show when toggled */
    }
}

/* Keyframes for animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Hide only EQ controls, preserve delay */
.eq-freq-range-container,
.eq-toggle-container {
    display: none !important;
}

/* Coming Soon EQ text styling */
.coming-soon-eq {
    font-size: 12px;
    color: #999;
    font-style: italic;
    text-align: center;
    margin: 5px 0;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

/* Hide EQ controls */
.mixer-control:has(.mixer-label:contains("EQ")) {
    display: none !important;
}

/* Alternative approach for browsers that don't support :has() */
.eq-freq-range-container,
.eq-toggle-container {
    display: none !important;
}

.mixer-label:contains("EQ") {
    display: none !important;
}

/* Hide the entire mixer-control div that contains EQ */
