/* ─────────────────────────────────────────────────────────────
   Sound Meter page styles
   ───────────────────────────────────────────────────────────── */

/* ── FIXED BOTTOM BAR ── */
.bottombar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottombar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bottom-btn {
    flex: 1;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 14px 12px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.bottom-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.bottom-btn--start { background: var(--accent); color: #fff; }
.bottom-btn--start:hover { background: var(--accent-hover); }
.bottom-btn--start:active { transform: scale(0.97); }
.bottom-btn--stop { background: var(--red); color: #fff; }
.bottom-btn--stop:hover { background: var(--red-dark); }
.bottom-btn--secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.bottom-btn--secondary:hover { background: var(--bg-input); border-color: var(--border-strong); }
.bottom-btn--secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SETTINGS PANEL ── */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    max-width: 85vw;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.settings-panel.open { transform: translateX(0); }
html[dir="rtl"] .settings-panel { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); transform: translateX(-100%); }
html[dir="rtl"] .settings-panel.open { transform: translateX(0); }

.settings-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.settings-header h2 { font-size: 16px; font-weight: 700; }
.settings-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.settings-footer { border-top: 1px solid var(--border); padding: 12px 20px; flex-shrink: 0; }

.setting-group { margin-bottom: 20px; }
.setting-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.setting-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; line-height: 1.5; }

/* ── NOTICE BANNER ── */
.notice {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}
.notice--error { border-color: var(--red); background: var(--red-soft); }
.notice--error .notice-text { color: var(--red-dark); }
.notice-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.notice-text { flex: 1; }
.notice-text strong { color: var(--text); display: block; margin-bottom: 2px; font-size: 14px; }
.notice-steps { margin-top: 8px; padding-left: 18px; font-size: 12px; line-height: 1.8; }

/* ── BIG DISPLAY ── */
.big-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.db-value {
    font-family: var(--mono);
    font-size: clamp(60px, 14vw, 104px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -3px;
    transition: color 0.3s;
    color: var(--text-tertiary);
}
.db-unit {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
    letter-spacing: 0;
}
.db-label {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s;
}
.clip-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.clip-badge.visible { opacity: 1; }

/* ── STATS ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}
.stat-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 600;
}
.stat-unit {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── PROGRESS ── */
.progress-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}
.progress-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-tertiary); margin-bottom: 6px; font-weight: 500; }
.progress-track { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s, background 0.3s; width: 0%; }
.progress-markers { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-tertiary); margin-top: 4px; }

/* ── CHARTS ── */
.chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.chart-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.chart-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chart-title svg { width: 14px; height: 14px; color: var(--text-tertiary); }
.chart-body { position: relative; height: 260px; padding: 8px; }
.chart-body canvas { width: 100% !important; height: 100% !important; display: block; }
.chart-body--spectrum { height: 200px; }

/* ── REFERENCE ── */
.ref-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.ref-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ref-header h2 { font-size: 14px; font-weight: 600; }
.ref-list { padding: 4px 8px; }
.ref-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: var(--radius-xs);
    transition: background 0.15s;
}
.ref-item:hover { background: var(--bg-elevated); }
.ref-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ref-db { font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 50px; }
.ref-desc { font-size: 13px; color: var(--text-secondary); flex: 1; }
.ref-item.highlight { background: var(--accent-soft); }
.ref-item.highlight .ref-desc { color: var(--text); font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .big-display { padding: 20px 16px 18px; }
    .db-value { font-size: 72px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 10px 6px; }
    .stat-value { font-size: 17px; }
    .chart-body { height: 220px; }
    .chart-body--spectrum { height: 170px; }
    .bottombar-inner { padding: 10px 12px; }
    .bottom-btn { padding: 12px 8px; font-size: 13px; }
}
