/* Using Google Font for a clean look */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Inter:wght@400;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #383838; /* Dark workshop background */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
}

/* --- VINTAGE OSCILLOSCOPE THEME --- */
.device-background {
    background: 
        linear-gradient(145deg, #e4e2d8, #d1d0c9),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.02) 2px,
            rgba(0,0,0,0.02) 4px
        );
    border-radius: 15px;
    border-top: 3px solid #f5f5f1;
    border-left: 3px solid #f5f5f1;
    border-right: 3px solid #bab8b1;
    border-bottom: 3px solid #bab8b1;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6), 
        inset 0 2px 2px #fff,
        inset 0 -2px 2px rgba(0,0,0,0.1);
    padding: 20px;
    position: relative;
}

.device-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    border-radius: 15px;
    pointer-events: none;
}

.top-bar {
    background: 
        linear-gradient(145deg, #d1d0c9, #c5c4bd),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(0,0,0,0.02) 1px,
            rgba(0,0,0,0.02) 2px
        );
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #b0b0a8;
    border-top-color: #ddd;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
}

.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    border-radius: 10px;
    pointer-events: none;
}

.display-screen, .waveform-canvas {
    background: #1a2a1a radial-gradient(ellipse at center, rgba(50, 255, 126, 0.15) 0%, rgba(50, 255, 126, 0) 70%);
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 1px 0 #fff;
    color: #32ff7e; /* Phosphor green */
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 0 5px #32ff7e, 0 0 10px #32ff7e, 0 0 15px rgba(50, 255, 126, 0.5);
}

.waveform-canvas { 
    height: 120px; /* Made much taller */
    width: 100%;
    position: relative;
    background: 
        linear-gradient(45deg, #1a2a1a 25%, transparent 25%), 
        linear-gradient(-45deg, #1a2a1a 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #1a2a1a 75%), 
        linear-gradient(-45deg, transparent 75%, #1a2a1a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #0f1a0f;
    border: 6px solid #333;
    border-radius: 12px;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.9), 
        inset 0 0 10px rgba(50, 255, 126, 0.1),
        0 0 20px rgba(50, 255, 126, 0.2),
        0 8px 16px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}

.waveform-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(50, 255, 126, 0.03) 2px,
            rgba(50, 255, 126, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(50, 255, 126, 0.03) 2px,
            rgba(50, 255, 126, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

.waveform-canvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(
            ellipse at center,
            rgba(50, 255, 126, 0.1) 0%,
            transparent 70%
        );
    pointer-events: none;
    z-index: 2;
}

/* Track Container 3D Enhancement */
.track-container {
    background: 
        linear-gradient(145deg, #d1d0c9, #c5c4bd),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.02) 2px,
            rgba(0,0,0,0.02) 4px
        );
    border-radius: 12px;
    border-top: 3px solid #f5f5f1;
    border-left: 3px solid #f5f5f1;
    border-right: 3px solid #bab8b1;
    border-bottom: 3px solid #bab8b1;
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s ease;
}

.track-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    border-radius: 12px;
    pointer-events: none;
}

/* Shiny Metallic Elements */
.metallic-surface {
    background: 
        linear-gradient(145deg, #e8e8e8, #d0d0d0),
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    border: 2px solid #b0b0b0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.5),
        inset 0 -1px 0 rgba(0,0,0,0.1);
}

/* Fake LED Indicators */
.led-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #666, #333);
    border: 1px solid #222;
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.2),
        0 1px 2px rgba(0,0,0,0.5);
    position: relative;
    margin: 2px;
}

.led-indicator.active {
    background: radial-gradient(circle at 30% 30%, #32ff7e, #00cc66);
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.4),
        0 0 8px #32ff7e,
        0 0 16px rgba(50, 255, 126, 0.5);
    animation: led-pulse 2s infinite;
}

.led-indicator.recording {
    background: radial-gradient(circle at 30% 30%, #ff4757, #cc3333);
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.4),
        0 0 8px #ff4757,
        0 0 16px rgba(255, 71, 87, 0.5);
    animation: led-pulse 1.5s infinite;
}

.led-indicator.muted {
    background: radial-gradient(circle at 30% 30%, #ff6b35, #e55a2b);
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.4),
        0 0 8px #ff6b35,
        0 0 16px rgba(255, 107, 53, 0.5);
    animation: led-pulse 1s infinite;
}

.led-indicator.metronome {
    background: radial-gradient(circle at 30% 30%, #ffd700, #ffb700);
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.4),
        0 0 8px #ffd700,
        0 0 16px rgba(255, 215, 0, 0.5);
    animation: led-pulse 0.5s infinite;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.knob-container {
    position: relative; 
    cursor: grab; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    user-select: none;
    width: 80px; 
    height: 80px; /* Increased size for labels */
}

.knob-base {
    width: 50px; 
    height: 50px;
    background: 
        radial-gradient(circle at 30% 30%, #e8e8e8, #d0d0d0),
        linear-gradient(145deg, #f0f0f0, #c8c8c8);
    border: 2px solid #b0b0b0;
    border-top-color: #f8f8f8;
    border-left-color: #f8f8f8;
    border-radius: 50%;
    box-shadow: 
        0 6px 12px rgba(0,0,0,0.4), 
        inset 0 3px 2px rgba(255,255,255,0.8),
        inset 0 -2px 2px rgba(0,0,0,0.2);
    position: relative; /* For z-index */
    z-index: 10;
}

.knob-base::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.knob-indicator {
    width: 4px; 
    height: 14px; 
    background: linear-gradient(to bottom, #333, #222);
    position: absolute;
    left: 50%; 
    top: 4px; 
    transform-origin: center 21px;
    transform: translateX(-50%) rotate(0deg); 
    border-radius: 2px;
    box-shadow: 
        0 0 2px rgba(0,0,0,0.5),
        0 1px 1px rgba(0,0,0,0.3);
}

.dial-markings {
    position: absolute;
    width: 100%; 
    height: 100%;
    top: 0; 
    left: 0;
    z-index: 5;
    pointer-events: none; /* Make sure it doesn't interfere with clicks */
}

.fader-track {
    width: 12px; 
    height: 100px; 
    background: 
        linear-gradient(to bottom, #e8e8e8, #d0d0d0),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.1) 2px,
            rgba(0,0,0,0.1) 4px
        );
    border-radius: 6px;
    position: relative; 
    cursor: ns-resize; 
    border: 2px solid #b0b0b0;
    border-top-color: #f8f8f8;
    border-left-color: #f8f8f8;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.3);
}

.fader-handle {
    width: 32px; 
    height: 20px; 
    background: 
        linear-gradient(145deg, #f0f0f0, #d8d8d8),
        linear-gradient(to bottom, #e8e8e8, #d0d0d0);
    border: 1px solid #b0b0b0; 
    border-top-color: #f8f8f8;
    border-left-color: #f8f8f8;
    border-radius: 4px; 
    position: absolute;
    left: 50%; 
    transform: translateX(-50%); 
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.fader-handle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    border-radius: 2px;
    pointer-events: none;
}

.loop-button-container {
    position: relative; 
    width: 85px; 
    height: 85px; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    user-select: none;
    transition: transform 0.1s ease;
}

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

.loop-button-outer-ring, .loop-button-center { 
    position: absolute; 
    border-radius: 50%; 
    transition: all 0.2s ease-out; 
}

.loop-button-outer-ring {
    width: 85px; 
    height: 85px; 
    border: 3px solid #b0b0b0;
    background: 
        radial-gradient(circle at 30% 30%, #e8e8e8, #d0d0d0),
        linear-gradient(145deg, #f0f0f0, #c8c8c8);
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0,0,0,0.3);
}

.loop-button-outer-ring::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.loop-button-center {
    width: 65px; 
    height: 65px; 
    background: 
        radial-gradient(circle at 30% 30%, #d8d8d8, #c0c0c0),
        linear-gradient(145deg, #c8c8c8, #b0b0b0);
    border: 2px solid #b0b0b0;
    color: #666; 
    font-size: 1.8rem; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.3);
}

.loop-button-center::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.loop-button-container.recording .loop-button-outer-ring {
    border-color: #ff4757; 
    box-shadow: 0 0 20px #ff4757, inset 0 0 10px #ff4757;
    animation: pulse-red 1.5s infinite;
}

.loop-button-container.playing .loop-button-outer-ring {
    border-color: #32ff7e; 
    box-shadow: 0 0 20px #32ff7e, inset 0 0 10px #32ff7e;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-red { 
    0% { box-shadow: 0 0 8px #ff4757, inset 0 0 5px #ff4757; } 
    50% { box-shadow: 0 0 25px #ff4757, inset 0 0 12px #ff4757; } 
    100% { box-shadow: 0 0 8px #ff4757, inset 0 0 5px #ff4757; } 
}

@keyframes pulse-green { 
    0% { box-shadow: 0 0 8px #32ff7e, inset 0 0 5px #32ff7e; } 
    50% { box-shadow: 0 0 25px #32ff7e, inset 0 0 12px #32ff7e; } 
    100% { box-shadow: 0 0 8px #32ff7e, inset 0 0 5px #32ff7e; } 
}

.control-button {
    background: 
        linear-gradient(to bottom, #e8e8e8, #d0d0d0),
        linear-gradient(145deg, #f0f0f0, #c8c8c8); 
    color: #333;
    border: 2px solid #b0b0b0; 
    border-top-color: #f8f8f8; 
    border-left-color: #f8f8f8;
    border-radius: 6px;
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.1s ease;
    position: relative;
    font-weight: 600;
    font-size: 1.5rem;
    padding: 18px 32px;
}

.control-button::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    border-radius: 4px;
    pointer-events: none;
}

.control-button:active, .control-button.active {
    background: 
        linear-gradient(to bottom, #00d136, #00a32a),
        linear-gradient(145deg, #00cc33, #009926);
    color: white;
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(1px);
}

.control-button.red-button:active { 
    background: linear-gradient(145deg, #d63031, #c0392b);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.control-button.upload-button {
    background: linear-gradient(145deg, #0984e3, #74b9ff);
    color: white;
    border: 2px solid #0984e3;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.control-button.upload-button:hover {
    background: linear-gradient(145deg, #74b9ff, #0984e3);
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.control-button.upload-button:active {
    background: linear-gradient(145deg, #0984e3, #74b9ff);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.label {
    font-family: 'Roboto Mono', monospace; 
    color: #333; 
    font-weight: bold;
    text-transform: uppercase; 
    font-size: 0.7rem;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* Retro Green Screen Dropdown */
.effect-select {
    background: #101b10 !important;
    color: #32ff7e;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    border: 3px solid #222;
    border-radius: 10px;
    padding: 10px 16px;
    width: 100%;
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2332ff7e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat; 
    background-position: right 12px top 50%; 
    background-size: .7em auto;
    box-shadow: 0 0 0 2px #222, 0 2px 8px #000a, 0 0 12px #32ff7e22;
    text-shadow: 0 0 4px #32ff7e, 0 0 8px #32ff7e44;
    position: relative;
    overflow: hidden;
}

.effect-select:focus {
    outline: none;
    border-color: #32ff7e;
    box-shadow: 0 0 0 2px #32ff7e, 0 2px 8px #000a, 0 0 16px #32ff7e44;
}

.effect-select option {
    background: #101b10 !important;
    color: #32ff7e;
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 0 3px #32ff7e;
}

/* Enhanced 3D elements for better depth */
#bpmInput {
    background: 
        linear-gradient(to bottom, #e8e8e8, #d0d0d0),
        linear-gradient(145deg, #f0f0f0, #c8c8c8);
    color: #333;
    border: 2px solid #b0b0b0;
    border-top-color: #f8f8f8;
    border-left-color: #f8f8f8;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(255,255,255,0.8);
    position: relative;
}

#bpmInput::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    border-radius: 4px;
    pointer-events: none;
}

#bpmInput:focus {
    outline: none;
    border-color: #32ff7e;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(255,255,255,0.8),
        0 0 8px rgba(50, 255, 126, 0.3);
}

/* Enhanced button with LED */
.button-with-led {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.button-with-led .led-indicator {
    width: 6px;
    height: 6px;
    margin: 0;
}

/* Status LED Container */
.status-leds {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.status-leds .led-indicator {
    width: 6px;
    height: 6px;
    margin: 0;
}

/* --- Bigger LEDs --- */
.led-indicator {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #666, #333);
    border: 2px solid #222;
    box-shadow: 
        inset 0 2px 2px rgba(255,255,255,0.2),
        0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    margin: 4px;
    transition: box-shadow 0.2s, background 0.2s;
}
.led-indicator.active {
    background: radial-gradient(circle at 30% 30%, #32ff7e, #00cc66);
    box-shadow: 
        0 0 16px #32ff7e,
        0 0 32px rgba(50, 255, 126, 0.5),
        0 2px 4px rgba(0,0,0,0.5);
}
.led-indicator.recording {
    background: radial-gradient(circle at 30% 30%, #ff4757, #cc3333);
    box-shadow: 
        0 0 16px #ff4757,
        0 0 32px rgba(255, 71, 87, 0.5),
        0 2px 4px rgba(0,0,0,0.5);
}
.led-indicator.muted {
    background: radial-gradient(circle at 30% 30%, #ff6b35, #e55a2b);
    box-shadow: 
        0 0 16px #ff6b35,
        0 0 32px rgba(255, 107, 53, 0.5),
        0 2px 4px rgba(0,0,0,0.5);
}
.led-indicator.metronome {
    background: radial-gradient(circle at 30% 30%, #ffd700, #ffb700);
    box-shadow: 
        0 0 16px #ffd700,
        0 0 32px rgba(255, 215, 0, 0.5),
        0 2px 4px rgba(0,0,0,0.5);
}

/* --- Make metallic/white elements darker grey --- */
.metallic-surface,
.device-background,
.top-bar,
.track-container,
.knob-base,
.fader-track,
.fader-handle,
.loop-button-outer-ring,
.loop-button-center,
.control-button,
#bpmInput,
.metronome-dial {
    background: linear-gradient(145deg, #bcbcbc, #888888) !important;
    border-color: #888 !important;
    color: #222 !important;
    box-shadow: 0 2px 8px #0004, inset 0 1px 0 #fff2, inset 0 -1px 0 #0002;
}

.display-screen, .waveform-canvas {
    background: #101b10 radial-gradient(ellipse at center, rgba(50, 255, 126, 0.15) 0%, rgba(50, 255, 126, 0) 70%) !important;
    color: #32ff7e !important;
}

.glow-green-icon {
    color: #1fe36a !important;
    text-shadow: 0 0 6px #1fe36a88, 0 0 12px #1fe36a33;
    filter: drop-shadow(0 0 2px #1fe36a44);
    transition: color 0.2s, text-shadow 0.2s;
}

/* --- RETRO LED STYLES --- */
.retro-led {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 40%, transparent 70%);
    border: 3px solid #333;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 10px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.3s ease;
}

.retro-led::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3) 0%, transparent 60%);
    pointer-events: none;
}

.retro-led::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.retro-led.ready {
    background-color: #32ff7e;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 10px rgba(50, 255, 126, 0.5),
        0 0 20px rgba(50, 255, 126, 0.3),
        0 2px 4px rgba(0,0,0,0.3);
}

.retro-led.recording {
    background-color: #ff4757;
    animation: led-pulse-red 0.5s ease-in-out infinite alternate;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 15px rgba(255, 71, 87, 0.7),
        0 0 30px rgba(255, 71, 87, 0.4),
        0 2px 4px rgba(0,0,0,0.3);
}

.retro-led.playing {
    background-color: #32ff7e;
    animation: led-pulse-green 0.8s ease-in-out infinite alternate;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 15px rgba(50, 255, 126, 0.7),
        0 0 30px rgba(50, 255, 126, 0.4),
        0 2px 4px rgba(0,0,0,0.3);
}

.retro-led.muted {
    background-color: #ffa502;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 10px rgba(255, 165, 2, 0.5),
        0 0 20px rgba(255, 165, 2, 0.3),
        0 2px 4px rgba(0,0,0,0.3);
}

.retro-led.metronome {
    background-color: #32ff7e;
    animation: metronome-flash 0.1s ease-in-out;
    box-shadow: 
        inset 0 0 8px rgba(0,0,0,0.8),
        0 0 15px rgba(50, 255, 126, 0.8),
        0 0 30px rgba(50, 255, 126, 0.5),
        0 2px 4px rgba(0,0,0,0.3);
}

@keyframes led-pulse-red {
    0% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 10px rgba(255, 71, 87, 0.5),
            0 0 20px rgba(255, 71, 87, 0.3),
            0 2px 4px rgba(0,0,0,0.3);
    }
    100% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 20px rgba(255, 71, 87, 0.8),
            0 0 40px rgba(255, 71, 87, 0.5),
            0 2px 4px rgba(0,0,0,0.3);
    }
}

@keyframes led-pulse-green {
    0% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 10px rgba(50, 255, 126, 0.5),
            0 0 20px rgba(50, 255, 126, 0.3),
            0 2px 4px rgba(0,0,0,0.3);
    }
    100% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 20px rgba(50, 255, 126, 0.8),
            0 0 40px rgba(50, 255, 126, 0.5),
            0 2px 4px rgba(0,0,0,0.3);
    }
}

@keyframes metronome-flash {
    0% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 10px rgba(50, 255, 126, 0.5),
            0 0 20px rgba(50, 255, 126, 0.3),
            0 2px 4px rgba(0,0,0,0.3);
    }
    50% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 25px rgba(50, 255, 126, 1),
            0 0 50px rgba(50, 255, 126, 0.7),
            0 2px 4px rgba(0,0,0,0.3);
    }
    100% { 
        box-shadow: 
            inset 0 0 8px rgba(0,0,0,0.8),
            0 0 10px rgba(50, 255, 126, 0.5),
            0 0 20px rgba(50, 255, 126, 0.3),
            0 2px 4px rgba(0,0,0,0.3);
    }
}

.led-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metronome-led-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

/* Speed Slider Styling */
.speed-slider-track {
    position: relative;
    width: 100%;
    height: 20px;
    background: 
        linear-gradient(145deg, #d1d0c9, #c5c4bd),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.02) 2px,
            rgba(0,0,0,0.02) 4px
        );
    border-radius: 4px;
    border: 2px solid #333;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-slider-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    border-radius: 4px;
    pointer-events: none;
}

.speed-slider-handle {
    position: absolute;
    width: 32px;
    height: 20px;
    background: 
        linear-gradient(145deg, #f0f0f0, #d8d8d8),
        linear-gradient(to bottom, #e8e8e8, #d0d0d0);
    border: 1px solid #b0b0b0; 
    border-top-color: #f8f8f8;
    border-left-color: #f8f8f8;
    border-radius: 4px; 
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.1s ease;
    top: 50%;
    transform: translateY(-50%);
    left: 50%;
}

.speed-slider-handle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    border-radius: 2px;
    pointer-events: none;
}

.speed-slider-markings {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.speed-slider-markings .marking {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: #333;
    font-weight: bold;
    text-align: center;
    width: 20px;
}

.speed-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: #32ff7e;
    text-shadow: 0 0 3px #32ff7e;
    font-weight: bold;
    text-align: center;
}

/* Control Button Icons */
.control-button i {
    font-size: 2rem;
    color: inherit;
}

.control-button[data-action="mute"] i {
    color: #ff4757;
}

.control-button[data-action="upload"] i {
    color: #32ff7e;
}

.control-button[data-action="clear"] i {
    color: #ff4757;
}

.control-button:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Hand-drawn font styling */
.font-handwriting {
    font-family: 'Architects Daughter', cursive;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Enhanced AIED.uk link animations */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-2px) rotate(-1deg);
    }
}

/* Apply animations to the click me text */
.font-handwriting {
    animation: bounce-subtle 3s ease-in-out infinite;
}

/* Enhanced gradient animation for AIED.uk link */
a[href*="aied.uk"] {
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 
        0 0 2px #ff4444,
        0 0 4px #ff4444,
        0 0 8px rgba(255, 0, 0, 0.4),
        0 0 12px rgba(255, 0, 0, 0.2);
    filter: drop-shadow(0 0 2px rgba(255, 0, 0, 0.2));
}

a[href*="aied.uk"]:hover {
    text-shadow: 
        0 0 4px #ff6666,
        0 0 8px #ff6666,
        0 0 12px rgba(255, 0, 0, 0.3),
        0 0 16px rgba(255, 0, 0, 0.15);
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.3));
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 8px !important;
  }
  .top-bar .label {
    font-size: 1.25rem !important;
  }
  .display-screen {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 1rem !important;
  }
  #allStop {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
  }
  .metronome-led-container {
    flex-shrink: 0;
  }
}

/* In/Out Point Editor Styles - Oscilloscope Theme */
.inout-editor-bar {
  background: linear-gradient(90deg, #101b10 0%, #1a2a1a 100%);
  border-radius: 8px;
  height: 100%;
  opacity: 1;
  box-shadow: 0 0 12px #32ff7e33, 0 2px 8px #000a;
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 0;
  border: 1px solid rgba(50, 255, 126, 0.3);
}
.inout-editor-bar-range {
  background: linear-gradient(90deg, #32ff7e 0%, #00ff88 100%);
  opacity: 0.22;
  height: 100%;
  position: absolute;
  z-index: 1;
  border-radius: 8px;
  box-shadow: 0 0 8px #32ff7e88, 0 0 16px #32ff7e44;
  cursor: move;
  transition: opacity 0.2s;
}
.inout-editor-bar-range:hover {
  opacity: 0.35;
}
.inout-handle {
  width: 18px;
  height: 100%;
  background: radial-gradient(circle at 60% 40%, #32ff7e 60%, #101b10 100%);
  border: 2px solid #32ff7e;
  border-radius: 8px;
  box-shadow: 0 0 8px #32ff7e88, 0 0 16px #32ff7e44;
  cursor: ew-resize;
  position: absolute;
  top: 0;
  z-index: 2;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.inout-handle:active {
  box-shadow: 0 0 16px #32ff7e, 0 0 32px #32ff7e88;
}
.inout-handle.out {
  background: radial-gradient(circle at 60% 40%, #ff4757 60%, #101b10 100%);
  border-color: #ff4757;
  box-shadow: 0 0 8px #ff475788, 0 0 16px #ff475744;
}
.inout-handle.out:active {
  box-shadow: 0 0 16px #ff4757, 0 0 32px #ff475788;
}
.inout-editor-grid {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
}
.inout-editor-grid-line {
  width: 1px;
  height: 100%;
  background: rgba(50,255,126,0.08);
  position: absolute;
  top: 0;
}
.inout-waveform-canvas {
  border-radius: 8px;
  opacity: 0.8;
}

/* Styling for the container when no audio is loaded */
.inout-editor-container {
  background: linear-gradient(135deg, #1a2a1a 0%, #0f1a0f 100%);
  border: 2px solid rgba(50, 255, 126, 0.2);
  box-shadow: 
    0 0 8px rgba(50, 255, 126, 0.1),
    inset 0 1px 0 rgba(50, 255, 126, 0.1);
  position: relative;
  overflow: hidden;
}

.inout-editor-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 0%, rgba(50, 255, 126, 0.05) 50%, transparent 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(50, 255, 126, 0.02) 2px,
      rgba(50, 255, 126, 0.02) 4px
    );
  pointer-events: none;
  z-index: 0;
}

.inout-editor-container.no-audio::after {
  content: 'NO AUDIO';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(50, 255, 126, 0.4);
  font-size: 10px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 4px rgba(50, 255, 126, 0.5);
  pointer-events: none;
  z-index: 1;
} 