/* Loudness Meter Styles */

.meter-section {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

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

.loudness-meter-container {
    position: relative;
    width: 100%;
    height: 40px;
    background: linear-gradient(to right,
        #28a745 0%,
        #28a745 60%,
        #ffc107 60%,
        #ffc107 85%,
        #dc3545 85%,
        #dc3545 100%
    );
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .loudness-meter-container {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loudness-meter-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    transition: width 0.05s linear;
    border-right: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.3);
}

.rms-bar {
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.25) 100%
    );
}

.peak-bar {
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.35) 100%
    );
    border-right: 3px solid rgba(255, 255, 255, 1);
}

.peak-hold-bar {
    background: none;
    border: none;
    box-shadow: none;
}

.peak-hold-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 4px rgba(255, 255, 255, 0.6);
    transition: left 0.1s linear;
    display: none;
}

.peak-hold-indicator.active {
    display: block;
}

.meter-value-badge {
    background-color: var(--bs-primary-text-emphasis) !important;
    color: white !important;
    font-size: 0.95rem;
    padding: 6px 12px;
    min-width: 75px;
    text-align: center;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Clipping warning */
.meter-value-badge.clipping {
    background-color: #dc3545 !important;
    animation: pulse-red 0.5s infinite;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

/* Meter scale marks */
.loudness-meter-container::before,
.loudness-meter-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.loudness-meter-container::before {
    left: 60%; /* -10 dB mark */
}

.loudness-meter-container::after {
    left: 85%; /* -3 dB mark */
}

[data-bs-theme="dark"] .loudness-meter-container::before,
[data-bs-theme="dark"] .loudness-meter-container::after {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .loudness-meter-container {
        height: 35px;
    }

    .meter-value-badge {
        font-size: 0.85rem;
        padding: 4px 8px;
        min-width: 65px;
    }

    .meter-section {
        padding: 12px;
    }

}
