/* Digital Spots Country Badges on Main Page */
.digital-spots-badges-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

.digital-spots-badges-main.empty {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.digital-spots-badges-main .country-badge {
    padding: 6px 12px;
    background: #4a9eff;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.digital-spots-badges-main .country-badge:hover {
    background: #3a8eef;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.digital-spots-badges-main .country-badge:active {
    transform: translateY(0);
}

/* CW Spots Country Badges on Main Page */
.cw-spots-badges-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

.cw-spots-badges-main.empty {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.cw-spots-badges-main .country-badge {
    padding: 6px 12px;
    background: #17a2b8;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.cw-spots-badges-main .country-badge:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.cw-spots-badges-main .country-badge:active {
    transform: translateY(0);
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background-color: #dc3545;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    font-size: 14px;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

.notification-toast.show {
    display: block;
}

.notification-toast.error {
    background-color: #dc3545;
}

.notification-toast.warning {
    background-color: #ffc107;
    color: #000;
}

.notification-toast.info {
    background-color: #17a2b8;
}

.notification-toast.success {
    background-color: #28a745;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification-toast.hiding {
    animation: slideOut 0.3s ease-in;
}

/* ka9q UberSDR Styles */

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

/* Audio Start Overlay */
.audio-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.audio-start-overlay.hidden {
    display: none;
}

.audio-start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.audio-start-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.audio-start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

.audio-start-button:active {
    transform: scale(0.98);
}

.audio-start-button svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.audio-start-button span {
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.overlay-buttons-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    align-items: center;
}

.band-conditions-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.band-conditions-button:hover {
    transform: scale(1.05);
}

.band-conditions-button:active {
    transform: scale(0.98);
}

.blue-button {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.blue-button:hover {
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.digital-spots-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.digital-spots-button:hover {
    transform: scale(1.05);
}

.digital-spots-button:active {
    transform: scale(0.98);
}

.orange-button {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.orange-button:hover {
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #adb5bd;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #333;
}

.container {
    width: 100%;
    margin: 0;
    background: #adb5bd;
    overflow: hidden;
    position: relative;
}

/* Site Description in audio start overlay */
.site-description {
    padding: 12px 24px;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 8px;
    color: #ecf0f1;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.site-description a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.site-description a:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Time Display in bottom left */
.time-display {
    position: fixed;
    bottom: 0;
    left: 0;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 0 6px 0 0;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-line {
    color: white;
    font-size: 10px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* Audio Buffer Display in bottom right */
.audio-buffer-display {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 12px;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 6px 0 0 0;
    z-index: 10002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Space Weather Display under audio buffer */
.space-weather-display {
    position: fixed;
    bottom: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 0 0 0 6px;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
}

.space-weather-text {
    color: white;
    font-size: 9px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    display: flex;
    gap: 4px;
}

.space-weather-text span {
    display: inline-block;
}

.audio-buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease-out, background-color 0.3s ease-out;
    border-radius: 6px 0 0 0;
    pointer-events: none;
}

.audio-buffer-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1;
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.site-footer p {
    display: inline-block;
    margin: 0;
    padding: 4px 15px;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 6px;
    color: #ecf0f1;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #5dade2;
    text-decoration: underline;
}

.status-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #adb5bd;
    border-bottom: 2px solid #868e96;
}

.status-item {
    text-align: center;
}

.status-item .label {
    font-weight: bold;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.status-item .value {
    font-size: 1.2em;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

.value.connected {
    background: #28a745;
    color: white;
}

.value.disconnected {
    background: #dc3545;
    color: white;
}

/* Band Status Bar */
.band-status-bar {
    padding: 8px 30px;
    background: transparent;
    position: relative;
    z-index: 100;
}

.band-status-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 8px 15px;
    position: relative;
    z-index: 100;
}

.band-status-badge {
    padding: 6px 14px;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    user-select: none;
    pointer-events: auto;
    display: inline-block;
}

.band-status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    filter: brightness(1.2);
}

.band-status-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.band-status-badge[data-status="EXCELLENT"] {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.band-status-badge[data-status="GOOD"] {
    background: #fbbf24;
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.band-status-badge[data-status="FAIR"] {
    background: #ff9800;
    border-color: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}

.band-status-badge[data-status="POOR"] {
    background: #ef4444;
    border-color: #ef4444;
}

.band-status-badge[data-status="UNKNOWN"] {
    background: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
}

/* Active state - bright white border with glow (works for all status colors) */
.band-status-badge.active {
    border: 3px solid white !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
                0 0 8px rgba(255, 255, 255, 0.6) inset !important;
    transform: scale(1.1) translateY(-2px);
    z-index: 10;
}


.controls {
    padding: 30px 12.5% 10px 12.5%; /* Use percentage padding for centering */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px; /* Gap between columns */
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: -30px; /* Reduce gap from waterfall */
    margin-bottom: -60px; /* Compensate for scaled height */
}

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

.control-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

.frequency-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 10px;
    max-width: 150px; /* Limit wrapper width to fit frequency values */
}

.frequency-input-wrapper input[type="number"] {
    flex: 1;
    padding-right: 35px; /* Make room for Hz text */
    -moz-appearance: textfield; /* Firefox */
}

.frequency-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.frequency-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.frequency-unit {
    position: absolute;
    right: 12px;
    color: #6c757d;
    font-weight: bold;
    font-size: 0.9em;
    pointer-events: none;
}

.control-group input[type="number"],
.control-group select {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.control-group input[type="number"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.preset-buttons button {
    padding: 8px;
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.preset-buttons button:hover:not(.active) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: #155724 !important;
    color: white;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.9;
}

.band-btn.active {
    background: #155724 !important;
    color: white !important;
    font-weight: bold;
}

.tuning-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.tuning-buttons button {
    padding: 8px 12px;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 45px;
}

.tuning-buttons button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tuning-buttons button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

/* Different styling for different step sizes */
.tuning-buttons button:nth-child(1),
.tuning-buttons button:nth-child(6) {
    /* Coarse tuning (1 kHz) - larger, more prominent */
    font-size: 1.1em;
    background: #d4d8dd;
}

.tuning-buttons button:nth-child(2),
.tuning-buttons button:nth-child(5) {
    /* Fine tuning (100 Hz) - medium */
    font-size: 1em;
}

.tuning-buttons button:nth-child(3),
.tuning-buttons button:nth-child(4) {
    /* Ultra-fine tuning (10 Hz) - smaller */
    font-size: 0.9em;
    padding: 8px 10px;
}

.bandwidth-control {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.bandwidth-control label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.bandwidth-control input[type="range"] {
    width: 100%;
}

.bandwidth-controls {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.bandwidth-controls .control-group {
    flex: 1;
}

.bandwidth-controls .control-group label {
    font-size: 0.9em;
    white-space: nowrap;
}

.bandwidth-controls .control-group input[type="range"] {
    width: 100%;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.primary-btn {
    background: #667eea;
    color: white;
}

.primary-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

button:not(.primary-btn):not(:disabled):not(.band-conditions-button):not(.digital-spots-button) {
    background: #28a745;
    color: white;
}

button:not(.primary-btn):not(:disabled):not(.band-conditions-button):not(.digital-spots-button):hover {
    background: #218838;
    transform: translateY(-2px);
}

.audio-controls {
    padding: 5px 0;
    background: #adb5bd;
    border-top: none;
    border-bottom: none;
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: -70px; /* Reduce gap from controls */
    margin-bottom: -20px; /* Compensate for scaled height */
}

.audio-controls .control-group {
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* Compact VU Meter in audio controls */
.vu-meter-compact-container {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 600px;
}

.vu-meter-compact-container .vu-meter {
    width: 100%;
}

input[type="range"] {
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

#volume-value {
    min-width: 50px;
    font-weight: bold;
    color: #667eea;
}

#mute-btn {
    background: #ffc107;
    color: #333;
}

#mute-btn:hover {
    background: #e0a800;
}

/* Audio Visualization Section (Collapsible) */
.audio-visualization-section {
    padding: 0 30px;
    background: #adb5bd;
    border-top: none;
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: 20px;
}

/* When collapsed, reduce negative margin */
.audio-visualization-section:has(.audio-visualization-content[style*="display: none"]) {
    margin-bottom: 0px;
}

/* When expanded, use full negative margin */
.audio-visualization-section:has(.audio-visualization-content[style*="display: block"]) {
    margin-bottom: -180px;
}

.audio-visualization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #34495e;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
    border-radius: 6px;
}

.audio-visualization-header:hover {
    background: #3d566e;
}

.audio-visualization-header h3 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.1em;
}

.toggle-icon {
    color: #ecf0f1;
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.3s;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.audio-visualization-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* Visualizer Panel */
.visualizer-panel {
    padding: 10px 0 10px 0;
    background: #adb5bd;
}

.visualizer-panel h3 {
    margin-bottom: 20px;
    color: #495057;
}

/* Top visualizers container */
.top-visualizers {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 20px;
    align-items: start;
}

/* VU Meter */
.vu-meter-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vu-meter-container label {
    font-weight: bold;
    color: #495057;
}

.vu-meter {
    position: relative;
    width: 100%;
    height: 40px;
    background: #2c3e50;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.vu-meter-bar {
    position: absolute;
    height: 100%;
    width: 0%;
    /* Gradient will be set dynamically by JavaScript to show correct portion */
    transition: width 0.05s ease-out;
    border-radius: 6px 0 0 6px;
}

.vu-meter-peak {
    position: absolute;
    height: 100%;
    width: 3px;
    background: #ffffff;
    left: 0%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    transition: left 0.05s ease-out;
}

.vu-meter-scale {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    pointer-events: none;
}

.vu-meter-scale span {
    font-size: 0.7em;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

.vu-meter-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.vu-value-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.vu-label {
    font-size: 0.85em;
    font-weight: bold;
    color: #666;
    margin-bottom: 2px;
}

.vu-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
}

/* Oscilloscope */
.oscilloscope-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.oscilloscope-container label {
    font-weight: bold;
    color: #495057;
}

#oscilloscope-canvas {
    width: 100%;
    height: 160px;
    background: #2c3e50;
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.oscilloscope-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #34495e;
    border-radius: 0 0 6px 6px;
}

.oscilloscope-controls label {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0;
}

.oscilloscope-controls input[type="range"] {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: #2c3e50;
    outline: none;
    -webkit-appearance: none;
}

.oscilloscope-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff00;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.oscilloscope-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff00;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.oscilloscope-controls span {
    color: #00ff00;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 60px;
    text-align: center;
}

/* Spectrum Analyzer */
.spectrum-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

.spectrum-container label {
    font-weight: bold;
    color: #495057;
}

#spectrum-canvas {
    width: 100%;
    height: 150px;
    background: #2c3e50;
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Waterfall Display */
.waterfall-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.waterfall-container label {
    font-weight: bold;
    color: #495057;
}

#waterfall-canvas {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated; /* Crisp pixels for waterfall */
    display: block;
    margin-bottom: 0;
}

.waterfall-controls {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #2c3e50;
    border-radius: 0;
    align-items: center;
}

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

.waterfall-control-group label {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0;
}

.waterfall-control-group select {
    padding: 6px 10px;
    border: 2px solid #34495e;
    border-radius: 4px;
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.waterfall-control-group select:hover {
    border-color: #667eea;
    background: #fff;
}

.waterfall-control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.waterfall-control-group input[type="range"] {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: #34495e;
    outline: none;
    -webkit-appearance: none;
}

.waterfall-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.waterfall-control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.waterfall-control-group span {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 45px;
    text-align: center;
}

.info-panel {
    padding: 30px;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #495057;
}

/* Current settings text (simple display under mode buttons) */
.current-settings-text {
    margin-top: 30px;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.95em;
    color: #495057;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 500;
}

.current-settings-text span {
    font-weight: bold;
    color: #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.info-label {
    font-weight: bold;
    color: #666;
    display: block;
    margin-bottom: 3px;
    font-size: 0.85em;
}

.info-value {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.log-panel {
    padding: 30px;
    background: #adb5bd;
}

.log-panel h3 {
    margin-bottom: 15px;
    color: #495057;
}

.log-content {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
}

.log-entry.info {
    color: #333;
}

.log-entry.error {
    background: #f8d7da;
    color: #721c24;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .audio-controls .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    input[type="range"] {
        width: 100%;
    }
    
    .top-visualizers {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar styling */
.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Equalizer */
.equalizer-container {
    margin-top: 0;
    padding: 15px 20px;
    background: #34495e;
    border-radius: 6px;
}

.equalizer-container label {
    display: block;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.equalizer-bands {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    padding: 20px;
    background: #2c3e50;
    border-radius: 6px;
    min-height: 200px;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.eq-slider {
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 30px;
    height: 150px;
    background: linear-gradient(to top, #e74c3c 0%, #f39c12 50%, #2ecc71 100%);
    border-radius: 15px;
    outline: none;
    cursor: pointer;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 15px;
    border-radius: 8px;
    background: #ecf0f1;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.eq-slider::-moz-range-thumb {
    width: 30px;
    height: 15px;
    border-radius: 8px;
    background: #ecf0f1;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.eq-value {
    font-size: 0.85em;
    font-weight: bold;
    color: #3498db;
    min-width: 50px;
    text-align: center;
}

.eq-label {
    font-size: 0.8em;
    color: #95a5a6;
    text-align: center;
    font-weight: bold;
}

.eq-reset-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.eq-reset-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Filter Panels Grid Container - 2x2 Grid (default) */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 10px 30px;
    background: #adb5bd;
    transform: scale(0.75);
    transform-origin: top center;
    margin-bottom: -220px;
}

/* Filter Panels Grid Container - 2x3 Grid (with NR2) */
.filters-grid.filters-grid-2x3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Uniform styling for filter panels in grid */
.squelch-panel,
.bandpass-panel,
.notch-panel,
.compressor-panel,
.noise-reduction-panel,
.stereo-virtualizer-panel {
    padding: 0;
    background: transparent;
    border-top: none;
    transform: none;
    transform-origin: top center;
    margin-bottom: 0;
    min-height: 400px;
}

/* Empty panel slot */
.empty-panel {
    padding: 0;
    background: transparent;
    min-height: 400px;
}

/* Uniform styling for filter containers in grid */
.squelch-container,
.bandpass-container,
.notch-container,
.compressor-container,
.noise-reduction-container,
.stereo-virtualizer-container {
    padding: 15px 20px;
    background: #2c3e50;
    border-radius: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Equalizer Panel - Full Width Below Grid */
.equalizer-panel {
    padding: 10px 30px;
    background: #adb5bd;
    border-top: none;
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: 0;
    margin-bottom: -80px;
}

.equalizer-container {
    padding: 15px 20px;
    background: #2c3e50;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

/* Filter Status Badges */
.filter-status-badge {
    position: absolute;
    top: 8px;
    right: 15px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 100;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid;
    transition: all 0.3s ease;
}

.filter-status-badge.filter-disabled {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
}

.filter-status-badge.filter-enabled {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
}

/* Filter Latency Badges */
.filter-latency-badge {
    position: absolute;
    top: 8px;
    right: 105px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 100;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid #3498db;
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.15);
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

/* CW Decoder Panel - Full Width */
.cw-decoder-panel {
    padding: 10px 30px;
    background: #adb5bd;
    border-top: none;
    transform: scale(0.75);
    transform-origin: top center;
    margin-bottom: -20px;
}

.cw-decoder-container {
    padding: 15px 20px;
    background: #2c3e50;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

/* Uniform control group styling within filters */
.filters-grid .control-group {
    margin-bottom: 12px;
}

.filters-grid .control-group label {
    font-size: 0.9em;
    color: #ecf0f1;
    margin-bottom: 6px;
    display: block;
}

.filters-grid .control-group input[type="range"] {
    width: 100%;
}

.filters-grid .control-group span {
    font-size: 0.9em;
    color: #3498db;
}

/* Uniform control group styling for all filter containers */
.filters-grid .control-group,
.equalizer-panel .control-group,
.cw-decoder-panel .control-group {
    margin-bottom: 15px;
}

.filters-grid .control-group label,
.equalizer-panel .control-group label,
.cw-decoder-panel .control-group label {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 8px;
    font-size: 0.9em;
    cursor: pointer;
    user-select: none;
}

.filters-grid .control-group input[type="checkbox"],
.equalizer-panel .control-group input[type="checkbox"],
.cw-decoder-panel .control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.filters-grid .control-group input[type="range"],
.equalizer-panel .control-group input[type="range"],
.cw-decoder-panel .control-group input[type="range"] {
    width: 100%;
}

.filters-grid .control-group span,
.equalizer-panel .control-group span,
.cw-decoder-panel .control-group span {
    display: inline-block;
    min-width: 60px;
    font-weight: bold;
    color: #3498db;
    margin-left: 10px;
    font-size: 0.9em;
}

#squelch-controls,
#bandpass-controls,
#notch-controls,
#compressor-controls,
#noise-reduction-controls,
#stereo-virtualizer-controls,
#equalizer-controls,
#cw-decoder-controls {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
    flex: 1;
}

/* Help text styling for noise reduction */
.help-text {
    color: #95a5a6;
    font-size: 0.85em;
    font-style: italic;
    margin-top: 10px;
    line-height: 1.4;
}

.squelch-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 15px;
    background: #34495e;
    border-radius: 4px;
}

.squelch-status label {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 0.9em;
    margin: 0;
}

#squelch-status {
    font-size: 1em;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

#squelch-level {
    font-size: 0.9em;
}


#notch-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notch-filter-item {
    padding: 15px;
    background: #34495e;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

.notch-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.notch-filter-title {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 1em;
}

.notch-remove-btn {
    padding: 4px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s;
}

.notch-remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.notch-filter-item .control-group {
    margin-bottom: 10px;
}

.notch-filter-item .control-group label {
    font-size: 0.9em;
    color: #ecf0f1;
    margin-bottom: 5px;
}

.notch-filter-item .control-group input[type="range"] {
    width: 100%;
    max-width: 600px;
}

.notch-filter-item .control-group span {
    display: inline-block;
    min-width: 80px;
    font-weight: bold;
    color: #e74c3c;
    margin-left: 10px;
}

#notch-count {
    font-size: 0.9em;
    margin-left: 5px;
}

.notch-add-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 0.95em;
}

.notch-add-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

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


.equalizer-bands {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 12px;
    padding: 15px;
    background: #2c3e50;
    border-radius: 6px;
}

.eq-band {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eq-label {
    font-size: 0.85em;
    color: #ecf0f1;
    font-weight: bold;
    text-align: center;
}

.eq-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
        #2ecc71 0%,
        #2ecc71 33.33%,
        #f39c12 33.33%,
        #f39c12 50%,
        #e74c3c 50%,
        #e74c3c 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ecf0f1;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 2px solid #34495e;
}

.eq-slider::-webkit-slider-thumb:hover {
    background: #fff;
}

.eq-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ecf0f1;
    cursor: pointer;
    border: 2px solid #34495e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.eq-slider::-moz-range-thumb:hover {
    background: #fff;
}

.eq-value {
    font-size: 0.85em;
    font-weight: bold;
    color: #3498db;
    text-align: center;
}

.eq-reset-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.eq-reset-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.cw-decoder-display {
    background: #2c3e50;
    border-radius: 6px;
    padding: 20px;
    color: #ecf0f1;
}

.cw-current-symbol {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #34495e;
    border-radius: 4px;
}

.cw-current-symbol label {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 0.9em;
}

.cw-current-symbol span {
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
    min-width: 100px;
}

.cw-decoded-text-container {
    margin-bottom: 15px;
}

.cw-decoded-text-container label {
    display: block;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.cw-decoded-text {
    background: #1a252f;
    border: 2px solid #34495e;
    border-radius: 4px;
    padding: 15px;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #00ff00;
    line-height: 1.6;
    word-wrap: break-word;
}

.cw-decoded-text::-webkit-scrollbar {
    width: 8px;
}

.cw-decoded-text::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 4px;
}

.cw-decoded-text::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.cw-decoded-text::-webkit-scrollbar-thumb:hover {
    background: #5dade2;
}

.cw-decoder-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cw-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s;
}

.cw-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

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

#cw-wpm-value,
#cw-threshold-value {
    display: inline-block;
    min-width: 40px;
    color: #3498db;
    font-weight: bold;
}

/* CW Decoder Signal Meter */
.cw-status-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #34495e;
    border-radius: 4px;
}

.cw-signal-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.cw-signal-indicator label {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 0.9em;
    white-space: nowrap;
}

.cw-signal-meter {
    flex: 1;
    height: 20px;
    background: #1a252f;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #2c3e50;
}

.cw-signal-bar {
    height: 100%;
    width: 0%;
    background: #6c757d;
    transition: width 0.1s ease-out, background 0.3s ease;
    border-radius: 8px;
}

#cw-signal-value {
    font-weight: bold;
    color: #3498db;
    font-size: 0.9em;
    min-width: 40px;
    text-align: right;
}

/* Spectrum Display Panel (Full-band FFT from radiod) */
.spectrum-display-panel {
    padding: 0 0 5px 0;
    background: #adb5bd;
    border-top: none;
}

.spectrum-display-panel h3 {
    margin-bottom: 20px;
    color: #495057;
}

.spectrum-display-container {
    position: relative; /* For absolute positioning of controls overlay and line graph */
    z-index: 1; /* Base stacking context */
}

/* Spectrum frequency overlay - below audio start overlay */
.spectrum-frequency-overlay {
    z-index: 9000 !important;
    background: transparent !important;
}

/* In split view, container needs to be tall enough for both line graph and waterfall */
.spectrum-display-container:has(#spectrum-line-graph-canvas.split-mode) {
    min-height: 635px; /* 300px line graph + 300px waterfall + 35px overlay */
}

/* In graph-only view, container needs to be tall enough for the full-height line graph */
.spectrum-display-container:has(#spectrum-line-graph-canvas.graph-only-mode) {
    min-height: 600px; /* 600px line graph */
}

#spectrum-display-canvas {
    width: 100%;
    height: 600px;
    background: #000;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: crosshair;
    image-rendering: pixelated; /* Crisp pixels for waterfall, no smoothing */
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Split view mode - waterfall takes bottom half */
#spectrum-display-canvas.split-view {
    height: 300px;
    border-radius: 0 0 0 0;
}

/* Line graph canvas - absolutely positioned within spectrum-display-container */
#spectrum-line-graph-canvas {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
}

/* Line graph canvas in split mode - 300px height, overlays top of waterfall */
#spectrum-line-graph-canvas.split-mode {
    display: block !important;
    height: 300px;
}

/* Line graph canvas in graph-only mode - 600px height, covers entire waterfall */
#spectrum-line-graph-canvas.graph-only-mode {
    display: block !important;
    height: 600px;
}

.spectrum-display-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    gap: 10px; /* Reduced gap */
    padding: 5px 10px; /* Reduced padding for less height */
    background: rgba(44, 62, 80, 0.65);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    font-size: 0.65em; /* Scale down text */
}

.spectrum-control-group {
    display: flex;
    align-items: center;
    gap: 3px; /* Reduced for tighter spacing */
}

.spectrum-control-group button {
    padding: 4px 8px; /* Scaled down from default */
    font-size: 0.85em;
    min-width: 30px;
}

.spectrum-control-group select {
    padding: 3px 6px; /* Scaled down */
    font-size: 0.85em;
}

.spectrum-control-group input[type="range"] {
    width: 100px; /* Scaled down from 150px */
    height: 4px; /* Scaled down from 6px */
}

.spectrum-control-group input[type="range"]::-webkit-slider-thumb {
    width: 12px; /* Scaled down from 18px */
    height: 12px;
}

.spectrum-control-group input[type="range"]::-moz-range-thumb {
    width: 12px; /* Scaled down from 18px */
    height: 12px;
}

.spectrum-control-group label {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0;
    white-space: nowrap;
}

.spectrum-control-group select {
    padding: 6px 10px;
    border: 2px solid #34495e;
    border-radius: 4px;
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.spectrum-control-group select:hover {
    border-color: #667eea;
    background: #fff;
}

.spectrum-control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.spectrum-control-group input[type="range"] {
    width: 100px; /* Scaled down to match other sliders */
    height: 4px; /* Scaled down */
    border-radius: 2px;
    background: #34495e;
    outline: none;
    -webkit-appearance: none;
}

.spectrum-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; /* Scaled down to match other sliders */
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spectrum-control-group input[type="range"]::-moz-range-thumb {
    width: 12px; /* Scaled down to match other sliders */
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spectrum-control-group span {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.9em;
    min-width: unset;
    text-align: left;
}

.spectrum-status {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    background: #34495e;
    color: #f44336;
}

.spectrum-status.connected {
    color: #4CAF50;
}

/* Signal Meter in Spectrum Controls */
.signal-meter {
    position: relative;
    width: 120px;
    height: 16px;
    background: #1a252f;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #34495e;
}

/* S-Meter with Needle */
.s-meter-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

#s-meter-canvas {
    background: #2c3e50;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    display: block;
}

.signal-meter-bar {
    position: absolute;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #28a745 0%, #ffc107 50%, #dc3545 100%);
    transition: width 0.1s ease-out, background 0.3s ease-out;
    border-radius: 6px;
}

#signal-meter-value {
    min-width: 55px;
    text-align: center;
    transition: color 0.3s ease-out;
}

#signal-meter-value.flashing {
    animation: signal-flash 0.5s ease-in-out infinite;
}

@keyframes signal-flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* S-Meter Overload Flashing */
.s-meter-overload {
    animation: s-meter-overload-flash 0.5s ease-in-out infinite;
}

@keyframes s-meter-overload-flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}


/* Audio Recorder Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.recorder-modal-content {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #34495e;
}

.modal-header h2 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.5em;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

/* Recorder Status */
.recorder-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #34495e;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recorder-status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #95a5a6;
    transition: all 0.3s;
}

.recorder-status-indicator.recording {
    background: #e74c3c;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.recorder-status-indicator.stopped {
    background: #95a5a6;
}

@keyframes pulse-recording {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

#recorder-status-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #ecf0f1;
}

/* Recorder Time Display */
.recorder-time {
    text-align: center;
    padding: 20px;
    background: #1a252f;
    border-radius: 8px;
    margin-bottom: 20px;
}

#recording-time {
    font-size: 3em;
    font-weight: bold;
    color: #3498db;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

/* Recorder Controls */
.recorder-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.recorder-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.recorder-btn span {
    font-size: 1.2em;
}

.recorder-start-btn {
    background: #28a745;
    color: white;
}

.recorder-start-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.recorder-stop-btn {
    background: #dc3545;
    color: white;
}

.recorder-stop-btn:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.recorder-btn:disabled {
    background: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* Recorder Actions */
.recorder-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.recorder-download-btn {
    background: #007bff;
    color: white;
}

.recorder-download-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.recorder-clear-btn {
    background: #ffc107;
    color: #333;
}

.recorder-clear-btn:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Recorder Info */
.recorder-info {
    padding: 15px;
    background: #34495e;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.recorder-info p {
    margin: 8px 0;
    color: #ecf0f1;
    font-size: 0.9em;
    line-height: 1.5;
}

.recorder-info p:first-child {
    margin-top: 0;
}

.recorder-info p:last-child {
    margin-bottom: 0;
}

.recorder-info strong {
    color: #3498db;
}

/* Rec Button Styling */
#rec-btn {
    background-color: #dc3545;
    color: white;
    transition: all 0.3s;
}

#rec-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

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

/* Active Channels Panel */
.active-channels-panel {
    padding: 10px 30px 30px 30px;
    background: #adb5bd;
    border-top: none;
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: -20px;
    margin-bottom: -40px;
}

.active-channels-container {
    padding: 20px;
    background: #34495e;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.active-channels-container h3 {
    margin: 0 0 20px 0;
    color: #ecf0f1;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-channels-container h3::before {
    content: "";
    font-size: 1.3em;
}

#active-channels-list {
    color: #ecf0f1;
    background: #2c3e50;
    border-radius: 6px;
    padding: 15px;
    min-height: 100px;
    max-height: 280px;
    overflow-y: auto;
}

/* Custom scrollbar for active channels list */
#active-channels-list::-webkit-scrollbar {
    width: 10px;
}

#active-channels-list::-webkit-scrollbar-track {
    background: #1a252f;
    border-radius: 5px;
}

#active-channels-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

#active-channels-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#active-channels-list table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#active-channels-list thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#active-channels-list th {
    text-align: left;
    padding: 12px 15px;
    color: white;
    font-weight: bold;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#active-channels-list th:first-child {
    border-radius: 6px 0 0 0;
}

#active-channels-list th:last-child {
    border-radius: 0 6px 0 0;
}

#active-channels-list tbody tr {
    transition: all 0.3s ease;
}

#active-channels-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #34495e;
    color: #ecf0f1;
    font-size: 0.95em;
}

#active-channels-list tbody tr:last-child td {
    border-bottom: none;
}

#active-channels-list tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.15);
}

/* Highlight current user row */
#active-channels-list tbody tr:first-child {
    background-color: rgba(40, 167, 69, 0.2);
    border-left: 4px solid #28a745;
}

#active-channels-list tbody tr:first-child td {
    font-weight: bold;
    color: #a8e6cf;
}


/* Empty state styling */
#active-channels-list p {
    text-align: center;
    padding: 30px;
    color: #95a5a6;
    font-style: italic;
    font-size: 1em;
}

/* Error state styling */
#active-channels-list p[style*="color: #dc3545"] {
    color: #e74c3c !important;
    font-weight: bold;
    font-style: normal;
}

/* Decoder Extension Panels */
.decoder-extension-panel {
    padding: 0 30px;
    background: #adb5bd;
    border-top: none;
    transform: scale(0.75);
    transform-origin: top center;
    margin-top: 20px;
    margin-bottom: -100px;
}

.decoder-extension-container {
    padding: 15px 20px;
    background: #2c3e50;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.decoder-extension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #34495e;
}

.decoder-extension-header h3 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.2em;
    font-weight: bold;
}

.decoder-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.decoder-close-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.decoder-close-btn:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.decoder-extension-content {
    color: #ecf0f1;
    background: #34495e;
    border-radius: 6px;
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom scrollbar for decoder extension content */
.decoder-extension-content::-webkit-scrollbar {
    width: 8px;
}

.decoder-extension-content::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 4px;
}

.decoder-extension-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.decoder-extension-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}


/* Decoder Extension Modal Button */
.decoder-modal-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.decoder-modal-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

/* Decoder Extension Modal Overlay */
.decoder-extension-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.decoder-extension-modal.show {
    display: flex;
}

.decoder-extension-modal-content {
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 90%;
    height: 90%;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.decoder-extension-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #34495e;
    background: #34495e;
}

.decoder-extension-modal-header h2 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.5em;
}

.decoder-extension-modal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.decoder-extension-modal-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2c3e50;
    border-radius: 6px;
}

.decoder-extension-modal-zoom-btn {
    background: #3498db;
    border: none;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
    line-height: 1;
}

.decoder-extension-modal-zoom-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.decoder-extension-modal-zoom-btn:active {
    transform: scale(0.95);
}

.decoder-extension-modal-zoom-display {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 0.95em;
    min-width: 45px;
    text-align: center;
}

.decoder-extension-modal-close {
    background: #e74c3c;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.decoder-extension-modal-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.decoder-extension-modal-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #34495e;
}

/* Modal content wrapper for zoom transform */
.modal-content-wrapper {
    transform-origin: top center;
    transition: transform 0.3s ease;
}

/* Custom scrollbar for modal body */
.decoder-extension-modal-body::-webkit-scrollbar {
    width: 10px;
}

.decoder-extension-modal-body::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 5px;
}

.decoder-extension-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.decoder-extension-modal-body::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Leaflet Tooltip Line Height Fix */
.leaflet-tooltip {
    line-height: 1.2 !important;
}

.leaflet-tooltip br {
    line-height: 1.2 !important;
}

/* Buffer Configuration Modal Button Styles */
.buffer-preset-btn.active {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.buffer-preset-btn:hover {
    background: #667eea !important;
    border-color: #667eea !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}
