/* Key / Pitch Detector Styles */

/* Key Display */
.key-display-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.05) 0%, rgba(5, 44, 101, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(5, 44, 101, 0.2);
}

[data-bs-theme="dark"] .key-display-container {
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.15) 0%, rgba(5, 44, 101, 0.25) 100%);
    border-color: rgba(5, 44, 101, 0.4);
}

.key-main {
    text-align: center;
}

.key-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    line-height: 1;
    font-family: 'Georgia', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.key-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* Info Cards (BPM, Camelot) */
.info-card {
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.05) 0%, rgba(5, 44, 101, 0.1) 100%);
    border-radius: 10px;
    border: 2px solid rgba(5, 44, 101, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

[data-bs-theme="dark"] .info-card {
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.15) 0%, rgba(5, 44, 101, 0.25) 100%);
    border-color: rgba(5, 44, 101, 0.4);
}

.info-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    line-height: 1.2;
}

.info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Camelot Card Special Style */
.camelot-card {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1) 0%, rgba(111, 66, 193, 0.2) 100%);
    border-color: rgba(111, 66, 193, 0.3);
}

[data-bs-theme="dark"] .camelot-card {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.25) 100%);
    border-color: rgba(168, 85, 247, 0.4);
}

.camelot-value {
    color: #6f42c1;
    font-family: 'Courier New', monospace;
}

[data-bs-theme="dark"] .camelot-value {
    color: #a855f7;
}

/* Piano Visualization */
.piano-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: #2c2c2c;
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
}

.piano-keys {
    display: flex;
    position: relative;
    height: 120px;
}

.piano-key {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.white-key {
    width: 40px;
    height: 120px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    border: 1px solid #333;
    border-radius: 0 0 4px 4px;
    margin: 0 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.white-key:hover {
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
}

.white-key.active {
    background: linear-gradient(to bottom, #6ea8fe 0%, #0d6efd 100%);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}

.black-key {
    width: 28px;
    height: 75px;
    background: linear-gradient(to bottom, #2c2c2c 0%, #000000 100%);
    border: 1px solid #000;
    border-radius: 0 0 3px 3px;
    position: absolute;
    z-index: 2;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.black-key:hover {
    background: linear-gradient(to bottom, #3c3c3c 0%, #1c1c1c 100%);
}

.black-key.active {
    background: linear-gradient(to bottom, #ffc107 0%, #ff9800 100%);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

.key-label-text {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    user-select: none;
}

.white-key.active .key-label-text {
    color: white;
}

.black-key .key-label-text {
    color: #999;
    bottom: 3px;
    font-size: 0.65rem;
}

.black-key.active .key-label-text {
    color: white;
}

/* Real-time Display */
.realtime-display {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.05) 0%, rgba(5, 44, 101, 0.1) 100%);
    border-radius: 10px;
    border: 2px solid rgba(5, 44, 101, 0.2);
}

[data-bs-theme="dark"] .realtime-display {
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.15) 0%, rgba(5, 44, 101, 0.25) 100%);
    border-color: rgba(5, 44, 101, 0.4);
}

.realtime-note {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    line-height: 1;
    font-family: 'Georgia', serif;
    margin-bottom: 10px;
}

.realtime-freq {
    font-size: 1.3rem;
    font-weight: 600;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

/* Pitch Meter */
.pitch-meter {
    position: relative;
    width: 100%;
    height: 30px;
    background: linear-gradient(to right,
        #dc3545 0%,
        #ffc107 25%,
        #28a745 40%,
        #28a745 60%,
        #ffc107 75%,
        #dc3545 100%
    );
    border-radius: 6px;
    overflow: visible;
    margin-top: 20px;
}

.pitch-meter-bar {
    position: absolute;
    top: -10px;
    left: 50%;
    width: 4px;
    height: 50px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.5);
    transition: left 0.1s linear;
    transform: translateX(-50%);
}

.pitch-meter-center {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    transform: translateX(-50%);
}

/* ============================================
   WAVEFORM SECTION
   ============================================ */

.waveform-container {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.06) 100%);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 128px;
}

[data-bs-theme="dark"] .waveform-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.waveform-controls {
    font-size: 0.9rem;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   PLAYBACK CONTROLS
   ============================================ */

.playback-controls .btn {
    transition: all 0.2s ease;
}

.playback-controls .btn:hover {
    transform: scale(1.05);
}

.playback-controls .btn-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CARD STYLES
   ============================================ */

.card {
    border-radius: 8px;
    border: 1px dotted var(--bs-dark-bg-subtle);
    background: var(--bs-light-border-subtle);
}

.card-header {
    background: var(--bs-secondary-bg-subtle);
    border-bottom: 1px dotted var(--bs-dark-bg-subtle);
}

[data-bs-theme="dark"] .card {
    background-color: rgba(30, 34, 42, 0.6);
    border-color: rgba(168, 85, 247, 0.3);
}

[data-bs-theme="dark"] .card-header {
    background: rgba(30, 34, 42, 0.8);
    border-bottom-color: rgba(168, 85, 247, 0.3);
}

/* ============================================
   FILTER SVG
   ============================================ */

.filter-svg {
    filter: none;
}

[data-bs-theme="dark"] .filter-svg {
    filter: invert(1) brightness(0.8);
}

/* ============================================
   AUDIO SLIDER (with progress fill)
   ============================================ */

.audio-slider {
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        #e9ecef,
        #e9ecef 5px,
        #d3d6d9 5px,
        #d3d6d9 10px
    );
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #052c65;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.audio-slider::-webkit-slider-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.audio-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #052c65;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.audio-slider::-moz-range-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.audio-slider::-webkit-slider-runnable-track {
    height: 8px;
    background: linear-gradient(to right,
        #052c65 0%,
        #052c65 var(--value, 0%),
        transparent var(--value, 0%)),
        repeating-linear-gradient(
            45deg,
            #e9ecef,
            #e9ecef 5px,
            #d3d6d9 5px,
            #d3d6d9 10px
        );
    border-radius: 4px;
}

.audio-slider::-moz-range-track {
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        #e9ecef,
        #e9ecef 5px,
        #d3d6d9 5px,
        #d3d6d9 10px
    );
    border-radius: 4px;
}

.audio-slider::-moz-range-progress {
    height: 8px;
    background: #052c65;
    border-radius: 4px;
}

/* Dark mode slider */
[data-bs-theme="dark"] .audio-slider {
    background: #343a40;
}

[data-bs-theme="dark"] .audio-slider::-webkit-slider-thumb {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .audio-slider::-webkit-slider-thumb:hover {
    background: #9ec5fe;
}

[data-bs-theme="dark"] .audio-slider::-moz-range-thumb {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .audio-slider::-moz-range-thumb:hover {
    background: #9ec5fe;
}

[data-bs-theme="dark"] .audio-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #6ea8fe 0%, #6ea8fe var(--value, 0%), #343a40 var(--value, 0%), #343a40 100%);
}

[data-bs-theme="dark"] .audio-slider::-moz-range-track {
    background: #343a40;
}

[data-bs-theme="dark"] .audio-slider::-moz-range-progress {
    background: #6ea8fe;
}

/* Responsive */
@media (max-width: 768px) {

    .key-value {
        font-size: 3rem;
    }

    .realtime-note {
        font-size: 2.5rem;
    }

    .white-key {
        width: 30px;
        height: 100px;
    }

    .black-key {
        width: 22px;
        height: 65px;
    }

    .key-label-text {
        font-size: 0.65rem;
    }
}
