* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #2e0c0c 0%, #240808 50%, #190303 100%);
    min-height: 100vh;
    padding: 10px 20px 20px 20px;
    overflow-x: hidden;
    overflow-y: scroll;
}

body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 20px rgba(255, 100, 100, 0.6), 0 0 50px rgba(255, 50, 50, 0.4), 0 0 80px rgba(255, 30, 30, 0.3), 0 0 120px rgba(255, 20, 20, 0.2);
}

h2 {
    color: #6a3830;
    text-shadow: 1px 1px 3px rgba(220, 180, 170, 0.6), 0 0 2px rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.panel {
    background: linear-gradient(135deg, rgba(255, 250, 250, 0.95) 0%, rgba(240, 200, 195, 0.95) 100%);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 8px;
    box-shadow: 
        0 10px 20px rgba(80, 20, 20, 0.35),
        0 6px 12px rgba(80, 20, 20, 0.25),
        0 3px 6px rgba(255, 100, 100, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(200, 100, 100, 0.2);
    position: relative;
    transform: translateZ(0);
}

/* Glow effect on visualization panel only */
.panel-visualization {
    overflow: visible; /* Allow glow to extend beyond panel */
    /* Glow is applied via JavaScript (box-shadow controlled dynamically) */
    z-index: 0; /* Lowest z-index - glow appears behind everything */
    position: relative; /* Ensure z-index works */
}


/* Panel: Simulate panel */
.panel-simulate {
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 10; /* Above visualization panel glow */
}

/* Panel: Cache panel */
.panel-cache {
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 10; /* Above visualization panel glow */
}

/* Panel: Volcano/Station selection panel - Medium-light grey (#9a9a9a) */
.panel-selection {
    padding-top: 8px;
    padding-bottom: 8px;
    background: 
        repeating-linear-gradient(0deg, 
            transparent, 
            transparent 2px, 
            rgba(154, 154, 154, 0.15) 2px, 
            rgba(154, 154, 154, 0.15) 4px
        ),
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 15px, 
            rgba(150, 150, 150, 0.18) 15px, 
            rgba(150, 150, 150, 0.18) 18px
        ),
        radial-gradient(ellipse at top, rgba(200, 200, 200, 0.4) 0%, rgba(180, 180, 180, 0.2) 15%, rgba(160, 160, 160, 0.1) 30%, transparent 60%),
        linear-gradient(180deg, 
            rgba(170, 170, 170, 0.98) 0%,
            rgba(160, 160, 160, 0.95) 15%,
            rgba(154, 154, 154, 0.95) 35%,
            rgba(150, 150, 150, 0.95) 50%,
            rgba(145, 145, 145, 0.95) 70%,
            rgba(140, 140, 140, 0.95) 85%,
            rgba(135, 135, 135, 0.95) 100%
        ) !important;
    box-shadow: 
        0 10px 20px rgba(60, 60, 60, 0.3),
        0 6px 12px rgba(70, 70, 70, 0.25),
        0 3px 6px rgba(80, 80, 80, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.15),
        inset 0 3px 6px rgba(255, 255, 255, 0.6),
        inset 0 -4px 8px rgba(40, 40, 40, 0.35),
        inset 0 0 35px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(90, 90, 90, 0.3) !important;
    border: 1px solid rgba(170, 170, 170, 0.6) !important;
    border-top: 1px solid rgba(220, 220, 220, 0.6) !important;
    border-bottom: 1px solid rgba(130, 130, 130, 0.5) !important;
    position: relative;
    z-index: 10; /* Above visualization panel glow */
}

.panel-selection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(200, 200, 200, 0.4) 0%,
        rgba(180, 180, 180, 0.3) 10%,
        rgba(170, 170, 170, 0.2) 20%,
        rgba(160, 160, 160, 0.12) 35%,
        rgba(150, 150, 150, 0.06) 48%,
        transparent 52%,
        transparent 58%,
        rgba(120, 120, 120, 0.1) 75%,
        rgba(100, 100, 100, 0.2) 90%,
        rgba(80, 80, 80, 0.3) 100%
    );
    pointer-events: none;
    border-radius: 5px;
}

.panel-selection label {
    font-size: 18px;
}

.panel-selection select,
.panel-selection input {
    font-size: 16px;
}

/* Panel: Playback controls panel - Lighter grey (#a8a8a8) with healthy gradient */
.panel-playback {
    background: 
        repeating-linear-gradient(0deg, 
            transparent, 
            transparent 2px, 
            rgba(168, 168, 168, 0.15) 2px, 
            rgba(168, 168, 168, 0.15) 4px
        ),
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 3px, 
            rgba(165, 165, 165, 0.18) 3px, 
            rgba(165, 165, 165, 0.18) 6px
        ),
        radial-gradient(ellipse at top, rgba(210, 210, 210, 0.4) 0%, rgba(190, 190, 190, 0.25) 15%, rgba(175, 175, 175, 0.12) 30%, transparent 60%),
        linear-gradient(135deg, 
            rgba(200, 200, 200, 0.95) 0%, 
            rgba(190, 190, 190, 0.95) 15%,
            rgba(180, 180, 180, 0.95) 30%,
            rgba(175, 175, 175, 0.95) 45%,
            rgba(170, 170, 170, 0.95) 60%,
            rgba(165, 165, 165, 0.95) 75%,
            rgba(160, 160, 160, 0.95) 90%,
            rgba(155, 155, 155, 0.95) 100%
        ) !important;
    box-shadow: 
        0 10px 20px rgba(50, 50, 50, 0.35),
        0 6px 12px rgba(60, 60, 60, 0.3),
        0 3px 6px rgba(70, 70, 70, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 3px 6px rgba(240, 240, 240, 0.5),
        inset 0 -4px 8px rgba(30, 30, 30, 0.4),
        inset 0 0 30px rgba(230, 230, 230, 0.15),
        inset 0 1px 0 rgba(245, 245, 245, 0.6),
        inset 0 -1px 0 rgba(100, 100, 100, 0.3) !important;
    border: 1px solid rgba(180, 180, 180, 0.6) !important;
    border-top: 1px solid rgba(230, 230, 230, 0.6) !important;
    border-bottom: 1px solid rgba(140, 140, 140, 0.5) !important;
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 10; /* Above visualization panel glow */
}

.panel-playback::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(220, 220, 220, 0.4) 0%,
        rgba(210, 210, 210, 0.3) 12%,
        rgba(200, 200, 200, 0.2) 25%,
        rgba(190, 190, 190, 0.12) 40%,
        rgba(180, 180, 180, 0.06) 48%,
        transparent 52%,
        transparent 58%,
        rgba(150, 150, 150, 0.1) 75%,
        rgba(130, 130, 130, 0.2) 90%,
        rgba(110, 110, 110, 0.3) 100%
    );
    pointer-events: none;
    border-radius: 5px;
}

.panel-playback label {
    font-size: 15px;
}

.panel-playback select,
.panel-playback input {
    font-size: 15px;
}

.panel-playback h2 {
    font-size: calc(1.5em + 1px);
}

/* Panel: Waveform/Spectrogram visualization panel */
.panel-visualization {
    background: linear-gradient(135deg, rgba(10, 2, 2, 0.95) 0%, rgba(50, 15, 15, 0.95) 100%);
    border: 1px solid rgba(200, 100, 100, 0.3);
    padding-top: 12px;
    padding-right: 40px;
    padding-bottom: 15px;
}

/* Panel: Metrics panel */
.panel-metrics {
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
    z-index: 10; /* Above visualization panel glow */
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}

select, input {
    padding: 6px 10px;
    border: 2px solid rgba(200, 100, 100, 0.3);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0.9;
}

select:focus, input:focus {
    outline: none;
    border-color: #cc5533;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(204, 85, 51, 0.1);
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to bottom, transparent 5px, rgba(140, 80, 70, 0.5) 5px, rgba(140, 80, 70, 0.5) 8px, transparent 8px);
    height: 16px;
    cursor: pointer;
    padding: 0;
    border: none;
    outline: none;
    border-radius: 4px;
}

/* Fixed width for slider value displays to prevent layout shifts */
#speedValue {
    display: inline-block;
    width: 2.8em;
    text-align: left;
}

#volumeValue {
    display: inline-block;
    width: 2.2em;
    text-align: left;
}

/* Webkit (Chrome, Safari, Edge) - Track */
input[type="range"]::-webkit-slider-track {
    background: rgba(140, 80, 70, 0.5);
    height: 3px;
    border-radius: 2px;
    border: none;
}

/* Webkit - Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(135deg, #dd4444 0%, #bb2222 100%);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    cursor: pointer;
    margin-top: -7.5px;
    position: relative;
    top: 2px;
    box-shadow: 0 2px 6px rgba(180, 40, 40, 0.45);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg, #ee5555 0%, #cc3333 100%);
    box-shadow: 0 3px 8px rgba(180, 40, 40, 0.55);
}

/* Speed slider glow effect for tutorial - animate FILTER on parent */
#playbackSpeed.speed-slider-glow {
    animation: speedSliderKnobPulse 1s ease-in-out infinite !important;
}

/* Make the knob brighter so the glow is more visible */
#playbackSpeed.speed-slider-glow::-webkit-slider-thumb {
    background: #ff6666 !important;
}

#playbackSpeed.speed-slider-glow::-moz-range-thumb {
    background: #ff6666 !important;
}

/* Volume slider glow effect */
#volumeSlider.volume-slider-glow {
    animation: volumeSliderKnobPulse 1.2s ease-in-out infinite !important;
    transition: opacity 1.5s ease-out, filter 1.5s ease-out;
}

#volumeSlider.volume-slider-glow.fading-in {
    opacity: 0;
    animation: none;
}

#volumeSlider.volume-slider-glow.fading-out {
    animation: none;
    opacity: 0;
    transition: opacity 1.5s ease-out, filter 1.5s ease-out;
}

/* Add glow to the track (bar) */
#volumeSlider.volume-slider-glow::-webkit-slider-track {
    background: rgba(140, 80, 70, 0.5) !important;
    box-shadow: 0 0 5px rgba(255, 80, 80, 1), 0 0 10px rgba(255, 60, 60, 0.85) !important;
}

#volumeSlider.volume-slider-glow::-moz-range-track {
    background: rgba(140, 80, 70, 0.5) !important;
    box-shadow: 0 0 5px rgba(255, 80, 80, 1), 0 0 10px rgba(255, 60, 60, 0.85) !important;
}

/* Make the knob brighter so the glow is more visible */
#volumeSlider.volume-slider-glow::-webkit-slider-thumb {
    background: #ff2222 !important;
    box-shadow: 0 0 6px rgba(255, 80, 80, 1), 0 0 12px rgba(255, 60, 60, 0.9) !important;
}

#volumeSlider.volume-slider-glow::-moz-range-thumb {
    background: #ff2222 !important;
    box-shadow: 0 0 6px rgba(255, 80, 80, 1), 0 0 12px rgba(255, 60, 60, 0.9) !important;
}

#volumeLabel.volume-label-glow {
    text-shadow: 0 0 15px rgba(255, 120, 120, 1), 0 0 30px rgba(255, 100, 100, 0.9), 0 0 45px rgba(255, 80, 80, 0.7);
    animation: volumeLabelPulse 0.7s ease-in-out infinite !important;
    transition: text-shadow 0.5s ease-out, opacity 0.5s ease-out;
}

#volumeLabel.volume-label-glow.fading-in {
    opacity: 0;
    text-shadow: 0 0 0px rgba(255, 100, 100, 0);
    animation: none;
}

#volumeLabel.volume-label-glow.fading-out {
    animation: none;
    text-shadow: 0 0 0px rgba(255, 100, 100, 0);
}

@keyframes speedSliderKnobPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(255, 100, 100, 1))
                drop-shadow(0 0 24px rgba(255, 80, 80, 0.9))
                drop-shadow(0 0 36px rgba(255, 60, 60, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 120, 120, 1))
                drop-shadow(0 0 40px rgba(255, 100, 100, 1))
                drop-shadow(0 0 60px rgba(255, 80, 80, 0.9));
    }
}

@keyframes volumeSliderKnobPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 100, 100, 0.9))
                drop-shadow(0 0 8px rgba(255, 80, 80, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(255, 120, 120, 1))
                drop-shadow(0 0 12px rgba(255, 100, 100, 0.95))
                drop-shadow(0 0 18px rgba(255, 80, 80, 0.85));
    }
}

@keyframes volumeLabelPulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 140, 140, 1), 
                     0 0 40px rgba(255, 120, 120, 1), 
                     0 0 60px rgba(255, 100, 100, 0.9),
                     0 0 80px rgba(255, 80, 80, 0.7);
    }
    50% {
        text-shadow: 0 0 35px rgba(255, 180, 180, 1), 
                     0 0 70px rgba(255, 160, 160, 1), 
                     0 0 105px rgba(255, 140, 140, 1),
                     0 0 140px rgba(255, 120, 120, 0.9),
                     0 0 175px rgba(255, 100, 100, 0.7);
    }
}

/* Speed value glow effect for tutorial */
#speedValue.speed-value-glow,
#speedLabel.speed-value-glow {
    animation: speedValuePulse 1s ease-in-out infinite !important;
    color: #dd3333 !important;
    font-weight: 600 !important;
}

@keyframes speedValuePulse {
    0%, 100% {
        text-shadow: 0 0 12px rgba(255, 100, 100, 1.0),
                      0 0 24px rgba(255, 80, 80, 0.8),
                      0 0 36px rgba(255, 60, 60, 0.6);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 120, 120, 1),
                      0 0 40px rgba(255, 100, 100, 1),
                      0 0 60px rgba(255, 80, 80, 0.8);
    }
}

/* Pause button glow effect for tutorial - more intense but tighter */
#playPauseBtn.pause-button-glow {
    animation: pauseButtonPulse 1.5s ease-in-out infinite !important;
    filter: drop-shadow(0 0 5px rgba(255, 120, 120, 0.8))
            drop-shadow(0 0 10px rgba(255, 100, 100, 0.6));
}

@keyframes pauseButtonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(255, 120, 120, 0.8))
                drop-shadow(0 0 10px rgba(255, 100, 100, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 150, 150, 1))
                drop-shadow(0 0 24px rgba(255, 130, 130, 0.9));
    }
}

/* Firefox - Track */
input[type="range"]::-moz-range-track {
    background: rgba(140, 80, 70, 0.5);
    height: 3px;
    border-radius: 2px;
    border: none;
}

/* Firefox - Thumb */
input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #dd4444 0%, #bb2222 100%);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb:hover {
    background: linear-gradient(135deg, #ee5555 0%, #cc3333 100%);
}



button {
    padding: 9px 18px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, #b85050 0%, #963030 100%);
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    height: 38px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(120, 50, 50, 0.3);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(160, 70, 70, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #c86060 0%, #a64040 100%);
}

#startBtn:not(:disabled):not(.streaming) {
    animation: pulseBright 1.8s ease-in-out infinite;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.2);
}

#startBtn.streaming {
    background: linear-gradient(135deg, #ff5555 0%, #ff0000 100%) !important;
    animation: pulseVibrant 1.2s ease-in-out infinite;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 1), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.02);
}

@keyframes pulseVibrant {
    0%, 100% {
        filter: brightness(1);
        box-shadow: 0 5px 15px rgba(255, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        filter: brightness(1.2);
        box-shadow: 0 8px 20px rgba(255, 50, 50, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

@keyframes pulseBrightness {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(0.85);
    }
}

@keyframes pulsePlayButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(200, 50, 50, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(200, 50, 50, 0);
    }
}

@keyframes pulseResumeDarken {
    0%, 100% {
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 0 rgba(100, 0, 0, 0);
    }
    50% {
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 0 100px 50px rgba(100, 0, 0, 0.4);
    }
}

@keyframes pulseBright {
    0%, 100% {
        filter: brightness(1);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 10px rgba(255, 100, 100, 0.3);
    }
    50% {
        filter: brightness(1.35);
        box-shadow: 0 5px 12px rgba(160, 70, 70, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 20px rgba(255, 150, 150, 0.6);
    }
}

button.pulse-play {
    animation: pulsePlayButton 2s ease-in-out infinite;
}

button.pulse-resume {
    animation: pulseResumeDarken 1.8s ease-in-out infinite;
    color: #ffffff !important;
}

button:disabled {
    background: linear-gradient(135deg, #666 0%, #555 100%) !important;
    cursor: not-allowed !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.7 !important;
    color: #bbb !important;
    text-shadow: none !important;
    animation: none !important;
    transform: none !important;
    filter: grayscale(100%) !important;
    border-color: rgba(100, 100, 100, 0.3) !important;
}

#startBtn:disabled {
    background: linear-gradient(135deg, #666 0%, #555 100%) !important;
    cursor: not-allowed !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.7 !important;
    color: #bbb !important;
    text-shadow: none !important;
    animation: none !important;
    transform: none !important;
    filter: grayscale(100%) !important;
}

button.secondary {
    background: linear-gradient(135deg, #aa6655 0%, #884433 100%);
}

button.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #bb7766 0%, #995544 100%);
}

button.pause-active {
    background: linear-gradient(135deg, #dd3333 0%, #aa0000 100%);
}

button.pause-active:hover:not(:disabled) {
    background: linear-gradient(135deg, #ee4444 0%, #bb1111 100%);
}

button.play-active {
    background: linear-gradient(135deg, #ff8844 0%, #dd5522 100%);
}

button.play-active:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff9955 0%, #ee6633 100%);
}

button.loop-active {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
}

button.loop-active:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff5555 0%, #dd1111 100%);
}

.status {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-weight: 500;
    min-height: 36px;
    max-height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(80, 80, 80, 0.9);
    position: relative;
    white-space: nowrap;
    min-width: 0; /* Allow flex item to shrink below content size */
    background: rgba(40, 40, 40, 0.85); /* Dark background like .status.info */
    color: #e0e0e0; /* Light text color */
    font-size: 16px; /* Default size, will auto-shrink via JS if overflows */
}

.status.info { background: rgba(40, 40, 40, 0.85); color: #e0e0e0; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; border: 1px solid rgba(80, 80, 80, 0.9); }
.status.success { color: #4caf50; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }
.status.error { color: #ffcc99; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }

.status.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 180, 120, 0.4) 0%,
        rgba(255, 240, 200, 0.8) 50%,
        rgba(255, 180, 120, 0.4) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite, pulseBackground 1s ease-in-out infinite;
    border-color: rgba(80, 80, 80, 0.9) !important;
    color: #331100 !important;
    font-weight: 700 !important;
    position: relative;
    text-shadow: none;
    isolation: isolate; /* Creates new stacking context */
}

/* Ensure text content is above pseudo-elements */
.status.loading > * {
    position: relative;
    z-index: 10;
}

.status.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.15) 70%,
        transparent
    );
    animation: shimmerSweep 1.5s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.status.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 140, 90, 0.3) 10px,
        rgba(255, 140, 90, 0.3) 20px
    );
    background-size: 28px 28px;
    animation: stripeMove 1.2s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulseBackground {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmerSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes stripeMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 28px 0;
    }
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 0;
}

.metric {
    background: linear-gradient(135deg, rgba(255, 220, 220, 0.6) 0%, rgba(255, 200, 190, 0.6) 100%);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(180, 120, 120, 0.4);
    box-shadow: 0 2px 4px rgba(80, 20, 20, 0.15);
}

.metric-label {
    font-size: 12px;
    color: #885555;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #662222;
}

canvas {
    width: 100%;
    display: block;
    border-radius: 6px;
    background: #000;
    box-shadow: inset 0 0 20px rgba(200, 50, 50, 0.3), 0 0 15px rgba(200, 50, 50, 0.2);
}

#waveform {
    position: relative;
    height: 135px;
    margin-bottom: 10px;
    border: 2px solid rgba(80, 40, 40, 0.6);
    box-shadow: none;
}

#spectrogram {
    height: 450px;
    background: transparent;
    margin-top: 40px;
    border: 2px solid rgba(80, 40, 40, 0.6);
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}

#spectrogram.spectrogram-glow {
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.4), 0 0 30px rgba(255, 100, 100, 0.3);
    animation: spectrogramPulse 1.2s ease-in-out infinite;
    transition: box-shadow 0.5s ease-out, opacity 0.5s ease-out;
}

#spectrogram.spectrogram-glow.fading-in {
    opacity: 0;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0);
    animation: none;
}

#spectrogram.spectrogram-glow.fading-out {
    animation: none;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0);
    opacity: 0.8;
}

/* Regions panel glow effect */
#trackedRegionsPanel.regions-panel-glow {
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.4), 0 0 30px rgba(255, 100, 100, 0.3);
    animation: spectrogramPulse 1.2s ease-in-out infinite;
    transition: box-shadow 0.5s ease-out, opacity 0.5s ease-out;
}

#trackedRegionsPanel.regions-panel-glow.fading-in {
    opacity: 0;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0);
    animation: none;
}

#trackedRegionsPanel.regions-panel-glow.fading-out {
    animation: none;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0);
}

/* Notes field glow effect - target ONLY the textarea */
textarea.notes-field.notes-field-glow {
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.6), 0 0 30px rgba(255, 100, 100, 0.5) !important;
    animation: spectrogramPulse 1.2s ease-in-out infinite !important;
    transition: box-shadow 0.5s ease-out, opacity 0.5s ease-out !important;
    border: 2px solid rgba(255, 100, 100, 0.8) !important;
}

textarea.notes-field.notes-field-glow.fading-in {
    opacity: 0;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0) !important;
    animation: none !important;
}

textarea.notes-field.notes-field-glow.fading-out {
    animation: none !important;
    box-shadow: 0 0 0px rgba(255, 100, 100, 0) !important;
}

/* Loop button glow effect - gentle pulsing glow */
#loopBtn.loop-button-glow {
    animation: loopButtonPulse 1.5s ease-in-out infinite !important;
    filter: drop-shadow(0 0 5px rgba(255, 120, 120, 0.8))
            drop-shadow(0 0 10px rgba(255, 100, 100, 0.6));
    transition: filter 0.5s ease-out, opacity 0.5s ease-out;
}

@keyframes loopButtonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(255, 120, 120, 0.8))
                drop-shadow(0 0 10px rgba(255, 100, 100, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 150, 150, 1))
                drop-shadow(0 0 24px rgba(255, 130, 130, 0.9));
    }
}

#loopBtn.loop-button-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
    animation: none;
}

#loopBtn.loop-button-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
}

/* Frequency scale dropdown glow effect - bigger and brighter pulse */
#frequencyScale.frequency-scale-glow {
    animation: frequencyScalePulse 1.2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
            drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    transition: filter 0.5s ease-out, opacity 0.5s ease-out;
}

@keyframes frequencyScalePulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
                drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(255, 170, 170, 1))
                drop-shadow(0 0 35px rgba(255, 150, 150, 0.95));
    }
}

#frequencyScale.frequency-scale-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
    animation: none;
}

#frequencyScale.frequency-scale-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
}

/* Repetition dropdown glow effect */
select.repetition-dropdown-glow,
.feature-row select.repetition-dropdown-glow {
    animation: dropdownPulse 1.2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
            drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    transition: filter 0.5s ease-out, opacity 0.5s ease-out;
    border-color: #ff8282 !important;
    box-shadow: 0 0 10px rgba(255, 130, 130, 0.6) !important;
}

select.repetition-dropdown-glow.fading-in,
.feature-row select.repetition-dropdown-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
    animation: none;
}

select.repetition-dropdown-glow.fading-out,
.feature-row select.repetition-dropdown-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
}

/* Type dropdown glow effect */
select.type-dropdown-glow,
.feature-row select.type-dropdown-glow {
    animation: dropdownPulse 1.2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
            drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    transition: filter 0.5s ease-out, opacity 0.5s ease-out;
    border-color: #ff8282 !important;
    box-shadow: 0 0 10px rgba(255, 130, 130, 0.6) !important;
}

select.type-dropdown-glow.fading-in,
.feature-row select.type-dropdown-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
    animation: none;
}

select.type-dropdown-glow.fading-out,
.feature-row select.type-dropdown-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
}

@keyframes dropdownPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
                drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(255, 170, 170, 1))
                drop-shadow(0 0 35px rgba(255, 150, 150, 0.95));
    }
}

/* Select feature button glow effect - works even when disabled */
.select-freq-btn.select-feature-button-glow {
    animation: buttonPulse 1.2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
            drop-shadow(0 0 16px rgba(255, 110, 110, 0.7)) !important;
    transition: filter 0.5s ease-out, opacity 0.5s ease-out !important;
    border-color: #ff8282 !important;
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.6), 
                0 0 30px rgba(255, 100, 100, 0.5) !important;
    opacity: 1 !important;
}

.select-freq-btn.select-feature-button-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
    animation: none;
}

.select-freq-btn.select-feature-button-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(255, 100, 100, 0));
}

/* Add feature button glow effect - bigger glow */
button.add-feature-btn.add-feature-button-glow,
.add-feature-btn.add-feature-button-glow,
.add-feature-label.add-feature-button-glow {
    animation: addFeatureButtonPulse 1.2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 15px rgba(100, 200, 100, 0.9))
            drop-shadow(0 0 30px rgba(100, 200, 100, 0.8))
            drop-shadow(0 0 45px rgba(100, 200, 100, 0.6)) !important;
    transition: filter 0.5s ease-out, opacity 0.5s ease-out !important;
    border-color: #64c864 !important;
    box-shadow: 0 0 20px rgba(100, 200, 100, 0.7) !important;
}

.add-feature-btn.add-feature-button-glow.fading-in,
.add-feature-label.add-feature-button-glow.fading-in {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(100, 200, 100, 0));
    animation: none;
}

.add-feature-btn.add-feature-button-glow.fading-out,
.add-feature-label.add-feature-button-glow.fading-out {
    animation: none;
    filter: drop-shadow(0 0 0px rgba(100, 200, 100, 0));
}

@keyframes buttonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 130, 130, 0.9))
                drop-shadow(0 0 16px rgba(255, 110, 110, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(255, 170, 170, 1))
                drop-shadow(0 0 35px rgba(255, 150, 150, 0.95));
    }
}

@keyframes addFeatureButtonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 15px rgba(100, 200, 100, 0.9))
                drop-shadow(0 0 30px rgba(100, 200, 100, 0.8))
                drop-shadow(0 0 45px rgba(100, 200, 100, 0.6));
        box-shadow: 0 0 20px rgba(100, 200, 100, 0.7) !important;
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(100, 220, 100, 1))
                drop-shadow(0 0 50px rgba(100, 220, 100, 0.95))
                drop-shadow(0 0 75px rgba(100, 220, 100, 0.8));
        box-shadow: 0 0 35px rgba(100, 220, 100, 0.9) !important;
    }
}

@keyframes spectrogramPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 100, 100, 0.4), 0 0 30px rgba(255, 100, 100, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 100, 100, 0.5), 0 0 40px rgba(255, 100, 100, 0.4);
    }
}

#waveform-axis,
#spectrogram-axis {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex-basis: 60px !important;
    background: transparent !important;
    position: absolute;
    pointer-events: none;
    z-index: 10;
    /* Remove all shadow/glow effects */
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
    /* Hide initially to prevent flash - will be shown after positioning */
    opacity: 0;
    visibility: hidden;
}

#waveform-x-axis {
    background: transparent !important;
    position: absolute;
    pointer-events: none;
    z-index: 10;
    /* Remove all shadow/glow effects */
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
}

#waveform-date {
    background: transparent !important;
    position: absolute;
    pointer-events: none;
    z-index: 10;
    /* Remove all shadow/glow effects */
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
}

#waveform-buttons {
    background: transparent !important;
    position: absolute;
    pointer-events: none;
    z-index: 1;
    /* Remove all shadow/glow effects */
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
    /* Hide initially to prevent flash - will be shown after positioning */
    opacity: 0;
    visibility: hidden;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    accent-color: #cc3333;
}

input[type="checkbox"] {
    accent-color: #cc3333;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}


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

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

.modal-window {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 245, 0.98) 100%);
    border-radius: 12px;
    padding: 25px;
    max-width: 800px;
    min-width: 400px;
    width: 90%;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(200, 200, 200, 0.5);
    position: relative;
}

@media (max-width: 500px) {
    .modal-content {
        min-width: calc(100vw - 40px);
        padding: 16px;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(200, 100, 100, 0.3);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #550000;
    text-shadow: 1px 1px 3px rgba(255, 200, 200, 0.5);
}

.modal-close {
    background: linear-gradient(135deg, #cc3333 0%, #991111 100%);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0;
}

.modal-close:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(200, 50, 50, 0.5);
    background: linear-gradient(135deg, #dd4444 0%, #aa2222 100%);
}

.modal-body {
    color: #333;
}

.modal-form-group {
    margin-bottom: 12px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #550000;
}

.modal-form-group input[type="text"],
.modal-form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(200, 100, 100, 0.3);
    border-radius: 6px;
    font-size: 16px;
    background: white;
    box-sizing: border-box;
}

.modal-form-group input:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.mood-scale-container {
    border-radius: 8px;
    border: 1px solid rgba(150, 150, 150, 0.3);
    overflow: hidden;
    margin-bottom: 8px;
}

.mood-scale-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    padding: 6px 6px;
    min-height: 32px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
}

.mood-scale-item:nth-child(odd) {
    background: rgba(235, 235, 235, 0.8);
}

.mood-scale-item:nth-child(even) {
    background: rgba(220, 220, 220, 0.9);
}

.mood-scale-item:last-child {
    border-bottom: none;
}

.mood-scale-label {
    font-weight: 700;
    color: #550000;
    font-size: 16px;
    text-align: right;
}

.mood-scale-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 100%;
}

.mood-scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    min-width: 0;
}

.mood-scale-option input[type="radio"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #007bff;
    margin: 0;
    margin-top: 4px;
}

.mood-scale-option label {
    font-size: 13px;
    font-weight: bold;
    color: #550000;
    text-align: center;
    cursor: pointer;
    margin: 0;
    margin-top: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.survey-scale-labels {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 6px;
}

.survey-scale-labels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    align-items: flex-end;
}

.survey-scale-labels-grid span {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #550000;
    -webkit-hyphens: manual;
    -moz-hyphens: manual;
    -ms-hyphens: manual;
    hyphens: manual;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-submit {
    width: 100%;
    padding: 9px 24px;
    font-size: 18px;
    margin-top: 4px;
    background: #0056b3 !important; /* Blue to match other modal buttons */
    border-color: #0056b3 !important;
    color: white !important;
}

.modal-submit:hover:not(:disabled) {
    background: #004085 !important; /* Darker blue on hover */
    border-color: #004085 !important;
}

.mood-survey-intro {
    font-size: 24px;
    font-weight: 700;
    color: #550000;
    margin-top: 8px;
    margin-bottom: 12px;
    text-align: center;
}

/* AWE-SF Modal - Wider for 7-point scale */
.awesf-modal .modal-content {
    max-width: 1200px;
    min-width: 900px;
    max-height: 85vh;
}

.awesf-modal .mood-scale-item {
    grid-template-columns: 250px 1fr;
    gap: 6px;
    padding: 6px 10px;
}

.awesf-modal .mood-scale-label {
    text-align: left;
}

.awesf-modal .mood-scale-options {
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
}

.awesf-modal .survey-scale-labels {
    grid-template-columns: 250px 1fr;
    gap: 6px;
}

.awesf-modal .survey-scale-labels-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
}

/* Activity Level Modal - 5-point scale */
.activity-level-modal .modal-content {
    max-width: 800px;
    min-width: 600px;
    max-height: 75vh;
}

.activity-level-modal .mood-scale-item {
    grid-template-columns: 1fr;
    gap: 0px;
    padding: 6px 10px;
}

.activity-level-modal .mood-scale-label {
    display: none;
}

.activity-level-modal .mood-scale-options {
    grid-template-columns: repeat(5, 1fr);
    gap: 0px;
    width: 100%;
}

.activity-level-modal .survey-scale-labels {
    grid-template-columns: 1fr;
    gap: 0px;
}

.activity-level-modal .survey-scale-labels-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0px;
}

.activity-level-modal .modal-header {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 10px;
    position: relative;
    justify-content: flex-end;
}

.activity-level-modal .modal-title {
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
    margin: 0;
}

.activity-level-modal .modal-close {
    display: none;
}

.awesf-modal .modal-header {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 10px;
    position: relative;
    justify-content: flex-end;
}

.awesf-modal .modal-title {
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
    margin: 0;
}

.awesf-modal .modal-close {
    display: none;
}

/* CNS Modal - Connectedness to Nature Scale (14 items, 5-point scale) */
.cns-modal .modal-content {
    max-width: 900px;
}

.cns-modal .mood-scale-item {
    grid-template-columns: 385px 1fr;
}

.cns-modal .mood-scale-label {
    text-align: left;
    font-size: 15px;
    line-height: 1.3;
}

.cns-modal .mood-scale-options {
    grid-template-columns: repeat(5, 1fr);
    gap: 0px;
}

.cns-modal .survey-scale-labels {
    grid-template-columns: 385px 1fr;
    gap: 6px;
}

.cns-modal .survey-scale-labels-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0px;
}

.cns-modal .modal-header {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 10px;
    justify-content: flex-start;
}

.cns-modal .modal-title {
    text-align: left;
    margin: 0;
}

.cns-modal .modal-close {
    display: none;
}

#preSurveyModal .modal-close {
    display: none;
}

#postSurveyModal .modal-close {
    display: none;
}

#participantModal .modal-close {
    display: none;
}

#participantModal .modal-content {
    max-width: 600px;
    min-width: 400px;
}

#beginAnalysisModal .modal-content {
    max-width: 500px;
    min-width: 350px;
}

#welcomeBackModal .modal-content {
    max-width: 500px;
    min-width: 350px;
}

@media (max-width: 1200px) {
    .awesf-modal .modal-content {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }
}

/* ===== REGION TRACKER STYLES ===== */

/* Tracked Regions Panel */
#trackedRegionsPanel {
    background: linear-gradient(135deg, rgba(10, 2, 2, 0.95) 0%, rgba(50, 15, 15, 0.95) 100%);
    border: 1px solid rgba(200, 100, 100, 0.3);
    padding-top: 15px;
    padding-bottom: 15px;
}

#trackedRegionsPanel h2 {
    color: #ffe8e8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Scrollable container for region cards */
#regionsListContainer {
    height: 320px; /* Fixed height for ~4 region cards */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px; /* Space for scrollbar */
}

/* Custom scrollbar styling for regions container */
#regionsListContainer::-webkit-scrollbar {
    width: 8px;
}

#regionsListContainer::-webkit-scrollbar-track {
    background: rgba(200, 100, 100, 0.1);
    border-radius: 4px;
}

#regionsListContainer::-webkit-scrollbar-thumb {
    background: rgba(200, 100, 100, 0.4);
    border-radius: 4px;
}

#regionsListContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 100, 100, 0.6);
}

/* Firefox scrollbar */
#regionsListContainer {
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 100, 100, 0.4) rgba(200, 100, 100, 0.1);
}

/* Region list container */
/* No margin needed anymore since it's inside the scrollable container */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1em;
}

.empty-state p {
    opacity: 0.9;
    margin-top: 10px;
}

/* Region Card - Slightly darker */
.region-card {
    position: relative;
    background: linear-gradient(135deg, rgba(240, 230, 230, 0.95) 0%, rgba(220, 180, 175, 0.95) 100%);
    border-radius: 6px;
    margin-bottom: 6px;
    box-shadow: 
        0 10px 20px rgba(80, 20, 20, 0.35),
        0 6px 12px rgba(80, 20, 20, 0.25),
        0 3px 6px rgba(255, 100, 100, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(200, 100, 100, 0.2);
    overflow: visible;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                margin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.region-card:hover {
    box-shadow: 
        0 12px 24px rgba(80, 20, 20, 0.4),
        0 8px 16px rgba(80, 20, 20, 0.3),
        0 4px 8px rgba(255, 100, 100, 0.2);
}

/* Active/Used Region Card - Highlighted */
.region-card.active {
    background: linear-gradient(135deg, rgba(255, 240, 240, 0.95) 0%, rgba(250, 210, 205, 0.95) 100%);
    border: 1px solid rgba(255, 150, 150, 0.5);
    box-shadow: 
        0 10px 20px rgba(255, 100, 100, 0.4),
        0 6px 12px rgba(255, 100, 100, 0.3),
        0 3px 6px rgba(255, 100, 100, 0.2),
        0 1px 3px rgba(255, 100, 100, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 10px rgba(255, 120, 120, 0.2);
}

.region-card.active:hover {
    box-shadow: 
        0 12px 24px rgba(255, 100, 100, 0.5),
        0 8px 16px rgba(255, 100, 100, 0.4),
        0 4px 8px rgba(255, 100, 100, 0.3),
        0 0 15px rgba(255, 120, 120, 0.3);
}

/* Region Header Bar - Metallic grey */
.region-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    background: linear-gradient(135deg, 
        rgba(200, 200, 200, 0.7) 0%,
        rgba(180, 180, 180, 0.7) 50%,
        rgba(170, 170, 170, 0.7) 100%
    );
    border-top: 1px solid rgba(240, 240, 240, 0.8);
    border-bottom: 1px solid rgba(140, 140, 140, 0.4);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.6),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1),
        0 1px 1px rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
    font-size: 1em;
}

.region-header:hover {
    background: linear-gradient(135deg, 
        rgba(210, 210, 210, 0.8) 0%,
        rgba(190, 190, 190, 0.8) 50%,
        rgba(180, 180, 180, 0.8) 100%
    );
}

.region-header.expanded {
    background: linear-gradient(135deg, 
        rgba(220, 220, 220, 0.85) 0%,
        rgba(200, 200, 200, 0.85) 50%,
        rgba(190, 190, 190, 0.85) 100%
    );
    border-bottom-color: rgba(150, 150, 150, 0.5);
}

/* Active region header - slightly brighter metallic */
.region-card.active .region-header {
    background: linear-gradient(135deg, 
        rgba(230, 230, 230, 0.8) 0%,
        rgba(210, 210, 210, 0.8) 50%,
        rgba(200, 200, 200, 0.8) 100%
    );
    border-bottom-color: rgba(160, 160, 160, 0.5);
}

.region-card.active .region-header:hover {
    background: linear-gradient(135deg, 
        rgba(240, 240, 240, 0.85) 0%,
        rgba(220, 220, 220, 0.85) 50%,
        rgba(210, 210, 210, 0.85) 100%
    );
}

.region-card.active .region-header.expanded {
    background: linear-gradient(135deg, 
        rgba(235, 235, 235, 0.9) 0%,
        rgba(215, 215, 215, 0.9) 50%,
        rgba(205, 205, 205, 0.9) 100%
    );
    border-bottom-color: rgba(170, 170, 170, 0.6);
}

.region-header:not(.expanded) {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.region-card .zoom-btn {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    border-right: 1px solid rgba(0, 0, 0, 0.25);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    margin-right: 6px;
    transition: all 0.2s;
}

.region-card .zoom-btn:hover {
    background: linear-gradient(135deg, #42A5F5 0%, #1976D2 100%);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.region-card .zoom-btn:active {
    transform: translateY(0px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.region-card .zoom-btn.return-mode {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
}

.region-card .zoom-btn.return-mode:hover {
    background: linear-gradient(135deg, #ff9d1a 0%, #ff7700 100%);
    box-shadow: 
        0 4px 8px rgba(255, 140, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.region-card .play-btn {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #d32f3f 0%, #a01d2a 100%);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    border-right: 1px solid rgba(0, 0, 0, 0.25);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    transition: all 0.2s;
    padding: 0;
    min-height: auto;
    line-height: normal;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.region-card .play-btn:hover {
    background: linear-gradient(135deg, #e6394a 0%, #b01f2e 100%);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.region-card .play-btn:active {
    transform: translateY(0px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.region-card .play-btn.playing {
    background: linear-gradient(145deg, #34ce57, #1e7e34);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.region-summary {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9em;
    color: #333;
}

.region-label {
    font-weight: 700;
    color: #222;
    margin-right: 20px;
    font-size: 1em;
}

.region-card.active .region-label {
    color: #c82333;
    font-weight: 700;
    font-size: 1.05em;
}

.features-count-text {
    font-weight: 600;
    color: #222;
    margin-right: 30px;
    font-size: 1em;
}

.region-time-display {
    display: flex;
    align-items: center;
    gap: 30px;
    color: #222;
    font-size: 1.15em;
    font-weight: 600;
}

.region-description-preview {
    color: #444;
    font-size: 1em;
    font-style: italic;
    font-weight: 500;
    margin-left: 20px;
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-label {
    font-weight: 600;
    color: #444;
    margin-right: 4px;
    font-size: 1em;
}

.time-value {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #222;
    font-size: 1em;
    font-weight: 600;
}

.collapse-icon {
    font-size: 1.2em;
    color: #c82333;
    margin-right: 20px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.collapse-icon:hover {
    color: #bd2130;
}

.region-header.expanded .collapse-icon {
    transform: rotate(180deg);
}

.delete-region-btn {
    background: linear-gradient(135deg, #c82333 0%, #a01d2a 100%);
    color: white;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    margin-left: 20px;
    flex-shrink: 0;
    height: auto;
    line-height: normal;
    min-height: auto;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.delete-region-btn:hover {
    background: linear-gradient(135deg, #d32f3f 0%, #b01f2e 100%);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.delete-region-btn:active {
    transform: translateY(0px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Delete Feature Button (inline with feature rows) */
.delete-feature-btn-inline {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) !important;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc3545 !important;
    border: none !important;
    color: white;
    font-size: 0.7em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none !important;
    padding: 0;
    line-height: 1;
    box-shadow: none !important;
}

.delete-feature-btn-inline:hover {
    background: #c82333 !important;
    transform: translateY(-50%) !important;
    box-shadow: none !important;
}

.delete-feature-btn-inline:active {
    transform: translateY(-50%) !important;
    box-shadow: none !important;
}

.delete-feature-btn-inline.disabled {
    background: #ccc !important;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
}

.delete-feature-btn-inline.disabled:hover {
    transform: translateY(-50%) !important;
    background: #ccc !important;
    box-shadow: none !important;
}

/* Add Feature Row */
.add-feature-row {
    background: transparent;
    padding: 1px 10px 1px 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 28px;
    margin-top: 2px;
}

.add-feature-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5cb85c !important;
    border: none !important;
    color: white;
    font-size: 0.85em;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    min-height: auto;
    box-shadow: none !important;
}

.add-feature-btn:hover {
    background: #4cae4c !important;
    transform: scale(1.15) !important;
    box-shadow: none !important;
}

.add-feature-btn:active {
    transform: scale(0.9) !important;
    box-shadow: none !important;
}

.add-feature-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none !important;
}

.add-feature-btn:disabled:hover {
    transform: none !important;
    background: #ccc !important;
    box-shadow: none !important;
}

.add-feature-label {
    margin-left: 8px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.add-feature-label:hover {
    color: #333;
}

.add-feature-label.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.add-feature-label.disabled:hover {
    color: #666;
}

/* Region Details */
.region-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.region-card.active .region-details {
    background: rgba(255, 250, 250, 0.98);
}

.region-details.expanded {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.details-content {
    padding: 9px 12px 3px 12px;
    font-size: 0.95em;
    color: #222;
}

/* Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 3pt;
}

.features-container {
    display: flex;
    flex-direction: column;
    gap: 3pt;
}

.feature-row {
    background: #e8e8e8;
    padding: 4px 10px 4px 120px;
    border-radius: 4px;
    border-left: 3px solid #c82333;
    display: grid;
    grid-template-columns: 105px 110px 220px 1fr;
    gap: 8px;
    align-items: stretch;
    position: relative;
    min-height: 36px;
}

.feature-number {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #222;
    font-size: 1em;
    width: 80px;
    text-align: left;
}

.feature-row:nth-child(odd) {
    background: #f5f5f5;
}

.feature-row:nth-child(even) {
    background: #d5d5d5;
}

.region-card.active .feature-row {
    border-left-color: #ff4444;
}

.region-card.active .feature-row:nth-child(odd) {
    background: #f8f8f8;
}

.region-card.active .feature-row:nth-child(even) {
    background: #e0e0e0;
}

.feature-row select,
.feature-row input[type="text"],
.feature-row textarea {
    padding: 4px 6px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-size: 0.95em !important;
    font-family: inherit !important;
    transition: border-color 0.2s !important;
    height: 28px !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    opacity: 0.9 !important;
}

.feature-row select:focus,
.feature-row input[type="text"]:focus,
.feature-row textarea:focus {
    outline: none !important;
    border-color: #c82333 !important;
    box-shadow: none !important;
    background: white !important;
}

textarea.freq-input {
    resize: none;
    overflow-x: auto;
    overflow-y: hidden;
    height: 28px;
    line-height: 1.2;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

textarea.freq-input::-webkit-scrollbar {
    display: none;
}

.freq-input {
    width: 100%;
}

.freq-input.pulse {
    animation: pulseReceipt 0.6s ease-out;
}

.freq-input.pulse-long {
    animation: pulseReceipt 1.2s ease-out;
}

@keyframes pulseReceipt {
    0% {
        background-color: #fff;
        border-color: #c82333;
    }
    50% {
        background-color: #ffe8e8;
        border-color: #c82333;
        box-shadow: 0 0 10px rgba(200, 35, 51, 0.5);
    }
    100% {
        background-color: #fff;
        border-color: #e0e0e0;
    }
}

/* Select Button */
.select-freq-btn {
    padding: 6px 12px;
    border: 1px solid #c82333;
    border-radius: 4px;
    background: white;
    color: #c82333;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: auto;
    line-height: normal;
}

.select-freq-btn:hover {
    background: #c82333;
    color: white;
}

.select-freq-btn.active {
    background: #c82333 !important;
    color: white !important;
    border-color: #c82333 !important;
    animation: subtleGlow 1.2s ease-in-out infinite !important;
}

.select-freq-btn.pulse:not(.active) {
    animation: pulseButton 1.5s ease-in-out infinite;
}

.select-freq-btn.completed {
    background: white;
    color: #333;
    border-color: #ccc;
    font-weight: 500;
    font-style: normal;
}

.select-freq-btn.completed:hover {
    background: #f5f5f5;
    color: #666;
    border-color: #999;
}

.select-freq-btn.pulse {
    animation: simplePulse 0.25s ease-out !important;
}

.select-freq-btn.expand-shadow {
    animation: expandShadow 0.3s ease-out !important;
}

.select-freq-btn.disabled {
    background: #f5f5f5 !important;
    color: #555 !important;
    border-color: #ddd !important;
    cursor: not-allowed !important;
    opacity: 1;
}

.select-freq-btn.disabled:hover {
    background: #f5f5f5 !important;
    color: #555 !important;
    border-color: #ddd !important;
}

@keyframes expandShadow {
    0% {
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(200, 35, 51, 0.8), 0 0 0 6px rgba(200, 35, 51, 0.4);
    }
    100% {
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
}

@keyframes simplePulse {
    0% {
        background-color: #c82333 !important;
        color: white !important;
        border-color: #c82333 !important;
        box-shadow: 0 0 15px rgba(200, 35, 51, 0.5);
    }
    25% {
        background-color: #ff9999 !important;
        color: white !important;
        border-color: #ff5555 !important;
        box-shadow: 0 0 18px rgba(255, 70, 70, 0.6);
    }
    60% {
        background-color: #ffcccc !important;
        color: #c82333 !important;
        border-color: #ff7777 !important;
        box-shadow: 0 0 15px rgba(255, 100, 100, 0.4);
    }
    100% {
        background-color: white !important;
        color: #333 !important;
        border-color: #ccc !important;
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }
}

@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(200, 35, 51, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(200, 35, 51, 0.8);
    }
}

@keyframes waveformPulse {
    0%, 100% {
        border-color: rgba(80, 40, 40, 0.6);
        box-shadow: 0 0 0 rgba(200, 150, 150, 0);
    }
    50% {
        border-color: rgba(200, 100, 100, 0.8);
        box-shadow: 0 0 15px rgba(200, 120, 120, 0.4), 0 0 25px rgba(180, 100, 100, 0.3);
    }
}

#waveform.pulse {
    animation: waveformPulse 1.2s ease-in-out infinite !important;
    border-radius: 2px;
    border-width: 2px !important;
    border-style: solid !important;
}

/* Sticky status animations - zen parallax glide */
@keyframes slideDownGentle {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpGentle {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.sticky-status-container {
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tutorial overlay */
.tutorial-click-me {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.tutorial-click-me.visible {
    opacity: 1;
    animation: tutorialGlow 1.2s ease-in-out infinite;
}

@keyframes tutorialGlow {
    0%, 100% {
        color: #cc5500;
        text-shadow: 
            0 0 10px rgba(204, 85, 0, 0.8),
            0 0 20px rgba(204, 85, 0, 0.6),
            0 0 30px rgba(204, 85, 0, 0.4),
            0 0 40px rgba(220, 110, 0, 0.3);
        filter: hue-rotate(0deg);
    }
    50% {
        color: #dd6600;
        text-shadow: 
            0 0 20px rgba(221, 102, 0, 0.9),
            0 0 30px rgba(221, 102, 0, 0.7),
            0 0 40px rgba(230, 130, 0, 0.6),
            0 0 50px rgba(230, 150, 0, 0.5);
        filter: hue-rotate(5deg);
    }
}

/* Volcano selector pulsing glow */
#volcano.pulse-glow {
    animation: volcanoPulseGlow 1.2s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes volcanoPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(200, 100, 100, 0);
        border-color: rgba(80, 40, 40, 0.6);
    }
    50% {
        box-shadow: 0 0 15px rgba(200, 120, 120, 0.4), 0 0 25px rgba(180, 100, 100, 0.3);
        border-color: rgba(200, 100, 100, 0.8);
    }
}

/* Disabled slider styles */
input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulseButton {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        background: white;
        color: #c82333;
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
        background: #fff5f5;
        color: #c82333;
        border-color: #e85d5d;
        box-shadow: 0 0 8px rgba(200, 35, 51, 0.3);
    }
}

.frequency-display {
    grid-column: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    color: #999;
    font-style: italic;
    font-size: 0.85em;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    max-width: 160px;
    min-width: 120px;
}

.frequency-display.selected {
    color: #333;
    font-style: normal;
    font-weight: 500;
}

.frequency-display.pulse {
    animation: pulseFrequencyDisplay 0.8s ease-out;
}

.notes-field.pulse {
    animation: pulseNotesField 0.8s ease-out;
}

@keyframes pulseFrequencyDisplay {
    0% {
        background-color: white;
        border-color: #c82333;
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
    50% {
        background-color: #ffcccc;
        border-color: #ff0000;
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    }
    100% {
        background-color: white;
        border-color: #c82333;
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
}

@keyframes pulseNotesField {
    0% {
        background-color: white;
        border-color: #e0e0e0;
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
    }
    50% {
        background-color: #fff5f5;
        border-color: #ffaaaa;
        box-shadow: 0 0 20px rgba(200, 35, 51, 0.8), 0 0 10px rgba(200, 35, 51, 0.5);
        transform: scale(1.005);
    }
    100% {
        background-color: white;
        border-color: #e0e0e0;
        box-shadow: 0 0 0 rgba(200, 35, 51, 0);
        transform: scale(1);
    }
}

/* Region Highlight on Waveform */
.region-highlight {
    position: absolute;
    top: 0;
    height: 135px;
    background: rgba(68, 136, 255, 0.2);
    border-left: 2px solid rgba(68, 136, 255, 0.6);
    border-right: 2px solid rgba(68, 136, 255, 0.6);
    pointer-events: none;
    transition: opacity 0.2s;
}

.region-highlight.active {
    background: rgba(68, 136, 255, 0.5);
    border-left-color: rgba(68, 136, 255, 0.9);
    border-right-color: rgba(68, 136, 255, 0.9);
}

/* Selection Box for Waveform and Spectrogram */
.selection-box {
    position: absolute;
    top: 0;
    background: rgba(255, 255, 0, 0.2);
    border-left: 2px solid rgba(255, 200, 0, 0.8);
    border-right: 2px solid rgba(255, 200, 0, 0.8);
    pointer-events: none;
}

/* TEST TRIANGLE */
.test-triangle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-top: 150px solid #0056b3;
    z-index: 99999;
    cursor: pointer;
}

.test-triangle:hover {
    border-top: 150px solid orange;
}

/* Add Region Button */
.add-region-button {
    position: absolute;
    padding: 9px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    height: auto;
    display: inline-block;
    align-items: unset;
    justify-content: unset;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.4);
    z-index: 10000;
    white-space: nowrap;
    opacity: 0;
    transition: background 0.2s, box-shadow 0.2s;
}

.add-region-button:hover {
    background: #ff8c00;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.6);
}

.add-region-button::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #0056b3;
    cursor: pointer;
}

.add-region-button:hover::after {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #b35900;
}

/* Begin Analysis Button Sparkle Effect */
.begin-analysis-btn:not(:disabled) {
    position: relative;
    animation: subtle-sparkle 3s ease-in-out infinite;
    background: #0056b3 !important; /* Darker blue */
    border-color: #0056b3 !important;
}

/* Participant ID text box - dark background theme */
#participantIdText {
    background: rgba(40, 40, 40, 0.4) !important;
    border: 1px solid rgba(100, 100, 100, 0.6) !important;
    color: #aaa !important;
}

#participantIdText:hover {
    background: rgba(80, 50, 50, 0.6) !important;
}

#participantIdValue {
    color: #bbb !important;
}

.begin-analysis-btn:not(:disabled):hover {
    background: #004085 !important; /* Even darker blue on hover */
    border-color: #004085 !important;
}

.begin-analysis-btn:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: sparkle-sweep 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes subtle-sparkle {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 4px rgba(0, 123, 255, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 8px rgba(0, 123, 255, 0.5), 0 0 12px rgba(0, 123, 255, 0.2);
        filter: brightness(1.15);
    }
}

@keyframes sparkle-sweep {
    0% {
        transform: translateX(-40%);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(80%);
        opacity: 0;
    }
}

