/* Metronome Styles - Professional Edition */

/* Metronome Display */
.metronome-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(5, 44, 101, 0.05) 0%, rgba(5, 44, 101, 0.1) 100%);
    border-radius: 16px;
    border: 2px solid rgba(5, 44, 101, 0.2);
}

[data-bs-theme="dark"] .metronome-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);
}

/* Beat Bars Container */
.beat-bars-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.beat-bars {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.beat-bar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(145deg, #e9ecef, #dee2e6);
    border: 3px solid var(--bs-primary-text-emphasis);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.08s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.beat-bar span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    font-family: 'Arial', sans-serif;
}

.beat-bar.active {
    background: linear-gradient(145deg, var(--bs-primary-text-emphasis), #041f4a);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(5, 44, 101, 0.6);
}

.beat-bar.active span {
    color: white;
}

.beat-bar.accent {
    background: linear-gradient(145deg, #dc3545, #b02a37);
    border-color: #dc3545;
    box-shadow: 0 0 25px rgba(220, 53, 69, 0.7);
}

.beat-bar.accent span {
    color: white;
}

[data-bs-theme="dark"] .beat-bar {
    background: linear-gradient(145deg, #495057, #343a40);
}

[data-bs-theme="dark"] .beat-bar span {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .beat-bar.active {
    background: linear-gradient(145deg, #6ea8fe, #3d8bfd);
}

[data-bs-theme="dark"] .beat-bar.active span {
    color: #212529;
}

/* Subdivision Dots */
.subdivision-dots {
    display: flex;
    justify-content: center;
    gap: 20px;
    min-height: 20px;
}

.subdivision-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.subdivision-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ced4da;
    transition: all 0.08s ease;
}

.subdivision-dot.main {
    width: 14px;
    height: 14px;
    background: #6c757d;
}

.subdivision-dot.active {
    background: var(--bs-primary-text-emphasis);
    box-shadow: 0 0 8px rgba(5, 44, 101, 0.5);
    transform: scale(1.3);
}

[data-bs-theme="dark"] .subdivision-dot {
    background: #495057;
}

[data-bs-theme="dark"] .subdivision-dot.main {
    background: #6c757d;
}

[data-bs-theme="dark"] .subdivision-dot.active {
    background: #6ea8fe;
    box-shadow: 0 0 8px rgba(110, 168, 254, 0.5);
}

/* BPM Section */
.bpm-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.bpm-display-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.bpm-adjust-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--bs-primary-text-emphasis);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bpm-adjust-btn:hover {
    background: var(--bs-primary-text-emphasis);
    transform: scale(1.1);
}

.bpm-adjust-btn:hover img {
    filter: brightness(0) invert(1) !important;
}

[data-bs-theme="dark"] .bpm-adjust-btn {
    background: #343a40;
    border-color: #6ea8fe;
}

[data-bs-theme="dark"] .bpm-adjust-btn:hover {
    background: #6ea8fe;
}

.bpm-display-center {
    text-align: center;
}

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

.bpm-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 4px;
    letter-spacing: 3px;
}

/* Tap Tempo Button */
.tap-tempo-btn {
    padding: 12px 28px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.15s ease;
}

.tap-tempo-btn:active,
.tap-tempo-btn.tapping {
    transform: scale(0.95);
    background: var(--bs-primary-text-emphasis);
    color: white;
}

.tap-tempo-btn.tapping img {
    filter: brightness(0) invert(1);
}

/* Counter Section */
.counter-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .counter-section {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.counter-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    font-family: 'Courier New', monospace;
}

[data-bs-theme="dark"] .counter-value {
    color: #6ea8fe;
}

.counter-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.counter-divider {
    width: 2px;
    height: 40px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 1px;
}

[data-bs-theme="dark"] .counter-divider {
    background: rgba(255, 255, 255, 0.15);
}

/* Tempo Quick Buttons */
.tempo-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tempo-btn {
    flex: 0 0 auto;
    min-width: 140px;
    font-weight: 600;
}

.tempo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 44, 101, 0.2);
}

/* Speed Trainer Progress */
.speed-trainer-progress .progress {
    border-radius: 12px;
    overflow: hidden;
}

.speed-trainer-progress .progress-bar {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 0 12px;
}

#speedTrainerSettings {
    transition: opacity 0.3s ease;
}

/* Keyboard Shortcuts Hint */
.keyboard-shortcuts-hint {
    text-align: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .keyboard-shortcuts-hint {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.keyboard-shortcuts-hint kbd {
    background: var(--bs-primary-text-emphasis);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0 2px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .keyboard-shortcuts-hint kbd {
    background: #6ea8fe;
    color: #212529;
}

/* Audio Preview */
.audio-preview-wrapper {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .audio-preview-wrapper {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

.audio-preview {
    width: 100%;
    outline: none;
}

/* Range Sliders */
#bpm,
#volume {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #ced4da;
}

#bpm::-webkit-slider-track,
#volume::-webkit-slider-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e9ecef 0%, var(--bs-primary-text-emphasis) 100%);
    border: none;
}

#bpm::-moz-range-track,
#volume::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e9ecef 0%, var(--bs-primary-text-emphasis) 100%);
    border: 1px solid #ced4da;
}

#bpm::-webkit-slider-thumb,
#volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bs-primary-text-emphasis);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#bpm::-moz-range-thumb,
#volume::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bs-primary-text-emphasis);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#bpm::-webkit-slider-thumb:hover,
#volume::-webkit-slider-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 44, 101, 0.4);
}

#bpm::-moz-range-thumb:hover,
#volume::-moz-range-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 44, 101, 0.4);
}

/* Dark mode sliders */
[data-bs-theme="dark"] #bpm,
[data-bs-theme="dark"] #volume {
    background: #6c757d;
    border-color: #495057;
}

[data-bs-theme="dark"] #bpm::-webkit-slider-track,
[data-bs-theme="dark"] #volume::-webkit-slider-track {
    background: linear-gradient(to right, #495057 0%, #6ea8fe 100%);
}

[data-bs-theme="dark"] #bpm::-moz-range-track,
[data-bs-theme="dark"] #volume::-moz-range-track {
    background: linear-gradient(to right, #495057 0%, #6ea8fe 100%);
    border-color: #495057;
}

[data-bs-theme="dark"] #bpm::-webkit-slider-thumb,
[data-bs-theme="dark"] #volume::-webkit-slider-thumb {
    background: #6ea8fe;
    border-color: #212529;
}

[data-bs-theme="dark"] #bpm::-moz-range-thumb,
[data-bs-theme="dark"] #volume::-moz-range-thumb {
    background: #6ea8fe;
    border-color: #212529;
}

/* Responsive */
@media (max-width: 768px) {
    .metronome-display {
        padding: 20px 15px;
        gap: 20px;
    }

    .beat-bars {
        gap: 8px;
    }

    .beat-bar {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .beat-bar span {
        font-size: 1.2rem;
    }

    .bpm-value {
        font-size: 3rem;
        min-width: 100px;
    }

    .bpm-display-wrapper {
        gap: 12px;
    }

    .bpm-adjust-btn {
        width: 40px;
        height: 40px;
    }

    .counter-section {
        padding: 12px 20px;
        gap: 16px;
    }

    .counter-value {
        font-size: 1.4rem;
    }

    .tempo-buttons {
        flex-direction: column;
    }

    .tempo-btn {
        width: 100%;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .keyboard-shortcuts-hint {
        display: none;
    }

    .subdivision-dots {
        gap: 12px;
    }

    .subdivision-group {
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .beat-bar {
        width: 40px;
        height: 40px;
    }

    .beat-bar span {
        font-size: 1rem;
    }

    .bpm-value {
        font-size: 2.5rem;
    }
}
