/* ==========================================================================
   BasHouse Music Player (BMP) - Web Edition Stylesheet
   Strict CSP-Compliant & Windows 125%-150% Scaling Ready
   ========================================================================== */

/* State Utilities */
.hidden {
    display: none !important;
}

/* Base Container */
.bmp-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Header & Breadcrumbs Actions */
.bmp-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.bmp-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bmp-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--line, #d7e0e6);
    background: var(--surface, #ffffff);
    color: var(--ink, #18232d);
    transition: all 0.15s ease;
}

.bmp-nav-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

.bmp-nav-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.bmp-nav-btn.primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* Main Player Shell (Glassmorphic Audio Console) */
.bmp-player-shell {
    position: relative;
    background: #0f172a;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    color: #f8fafc;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Top Toolbar */
.bmp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bmp-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bmp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bmp-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.bmp-btn.bmp-btn-primary {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.bmp-btn.bmp-btn-primary:hover {
    background: #1d4ed8;
}

.bmp-btn.active {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.bmp-search-input {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-size: 13px;
    outline: none;
    min-width: 200px;
    transition: border-color 0.15s ease;
}

.bmp-search-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* 2-Column Main Stage (BMP Desktop Layout) */
.bmp-main-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    min-height: 480px;
}

/* Left Column: Now Playing & Karaoke Lyrics */
.bmp-lyrics-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.bmp-now-playing-header {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
}

.bmp-track-title {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px;
    line-height: 1.25;
    word-break: break-word;
}

.bmp-track-artist {
    font-size: 15px;
    color: #94a3b8;
    margin: 0 0 12px;
    font-weight: 500;
}

.bmp-track-meta-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bmp-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.3px;
}

/* Lyrics Toolbar & Viewport */
.bmp-lyrics-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 360px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    overflow: hidden;
}

.bmp-lyrics-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bmp-lyrics-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bmp-lyrics-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.bmp-source-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    white-space: nowrap;
}

.bmp-lyrics-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bmp-mini-btn {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bmp-mini-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

/* The Scrollable Lyrics Stage */
.bmp-lyrics-viewport {
    flex: 1;
    min-height: 280px;
    max-height: 440px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* High-Contrast Karaoke Lines */
.bmp-lyric-line {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.5;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: text;
}

.bmp-lyric-line:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.bmp-lyric-line.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.45) 0%, rgba(56, 189, 248, 0.25) 100%);
    font-weight: 700;
    font-size: clamp(18px, 2.1vw, 23px);
    transform: translateX(10px);
    border-left: 4px solid #38bdf8;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
    padding-left: 18px;
}

.bmp-lyric-line.passed {
    color: #475569;
}

/* Plain Unsynced Lyrics */
.bmp-plain-lyrics {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.8;
}

.bmp-plain-line {
    padding: 2px 0;
}

/* Empty / Not Found View */
.bmp-lyrics-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 16px;
    gap: 10px;
    color: #94a3b8;
}

.bmp-empty-icon {
    font-size: 32px;
}

.bmp-lyrics-empty-box h3 {
    margin: 0;
    color: #f1f5f9;
    font-size: 17px;
}

.bmp-lyrics-empty-box p {
    margin: 0;
    font-size: 14px;
}

.bmp-manual-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin-top: 10px;
}

.bmp-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 13px;
    outline: none;
}

.bmp-input:focus {
    border-color: #38bdf8;
}

/* Right Column: Visualizer, Player Controls & Queue */
.bmp-controls-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Visual Box: Album Art & Canvas */
.bmp-visual-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
}

.bmp-cover-wrap {
    width: 86px;
    height: 86px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bmp-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bmp-cover-fallback {
    font-size: 36px;
    color: #38bdf8;
}

.bmp-visualizer-canvas {
    flex: 1;
    height: 64px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
}

/* Player Console & Transport */
.bmp-console-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
}

/* Scrubber Timeline */
.bmp-timeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bmp-time-text {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}

.bmp-progress-bar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.bmp-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.bmp-progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Transport Buttons */
.bmp-buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.bmp-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bmp-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: scale(1.06);
}

.bmp-ctrl-btn.active {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.bmp-ctrl-btn.play-btn {
    width: 52px;
    height: 52px;
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.5);
}

.bmp-ctrl-btn.play-btn:hover {
    background: #1d4ed8;
    transform: scale(1.08);
}

/* Volume Row */
.bmp-volume-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.bmp-vol-icon {
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

.bmp-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.bmp-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
}

/* Playlist / Queue Box */
.bmp-queue-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    min-height: 180px;
    max-height: 260px;
}

.bmp-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bmp-queue-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.bmp-queue-empty {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    padding: 24px 10px;
}

.bmp-queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bmp-queue-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.bmp-queue-item.active {
    background: rgba(37, 99, 235, 0.25);
    border-left: 3px solid #38bdf8;
    padding-left: 12px;
}

.bmp-queue-num {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    min-width: 20px;
}

.bmp-queue-item.active .bmp-queue-num {
    color: #38bdf8;
}

.bmp-queue-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.bmp-queue-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bmp-queue-item.active .bmp-queue-title {
    color: #38bdf8;
}

.bmp-queue-artist {
    font-size: 11px;
    color: #94a3b8;
}

/* Fullscreen / Karaoke Focus Mode */
.bmp-player-shell.karaoke-focus-active .bmp-main-stage {
    grid-template-columns: 1fr;
}

.bmp-player-shell.karaoke-focus-active .bmp-controls-column {
    display: none;
}

.bmp-player-shell.karaoke-focus-active .bmp-lyrics-viewport {
    min-height: 480px;
    max-height: 640px;
    text-align: center;
    padding: 40px 20px;
}

.bmp-player-shell.karaoke-focus-active .bmp-lyric-line {
    font-size: clamp(22px, 3.2vw, 32px);
    padding: 14px 20px;
}

.bmp-player-shell.karaoke-focus-active .bmp-lyric-line.active {
    font-size: clamp(28px, 4vw, 40px);
    transform: scale(1.04);
    border-left: none;
    border-bottom: 3px solid #38bdf8;
    padding-bottom: 16px;
}

/* Drag and Drop Overlay */
.bmp-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #38bdf8;
    border-radius: 18px;
}

.bmp-drop-card {
    text-align: center;
    color: #f8fafc;
}

.bmp-drop-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* Collapsible Desktop Download & Info Box */
.bmp-info-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--line, #d7e0e6);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bmp-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bmp-info-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--accent-soft, #e8f0ff);
    padding: 6px;
    border: 1px solid var(--line, #d7e0e6);
}

.bmp-info-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--ink, #18232d);
}

.bmp-info-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.bmp-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line, #d7e0e6);
}

.bmp-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink, #18232d);
}

.bmp-feature-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==========================================================================
   Responsive Model (Master Rule 19-21)
   ========================================================================== */

/* Trap 1: Compact desktop & Windows 125%-150% scaling (1280x600 - 1500x820) */
@media (min-width: 769px) and (max-width: 1500px), (min-width: 769px) and (max-height: 820px) {
    .bmp-player-shell {
        padding: 16px;
    }
    .bmp-main-stage {
        gap: 16px;
        min-height: 400px;
    }
    .bmp-lyrics-viewport {
        max-height: 340px;
        min-height: 220px;
    }
    .bmp-queue-box {
        max-height: 180px;
    }
    .bmp-visual-box {
        padding: 10px 14px;
    }
    .bmp-cover-wrap {
        width: 68px;
        height: 68px;
    }
    .bmp-visualizer-canvas {
        height: 52px;
    }
}

/* Trap 2: Mobile & Tablet (<=768px) */
@media (max-width: 768px) {
    .bmp-main-stage {
        grid-template-columns: 1fr;
    }
    .bmp-lyrics-viewport {
        max-height: 300px;
    }
    .bmp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .bmp-toolbar-group {
        justify-content: center;
    }
    .bmp-search-input {
        width: 100%;
    }
    .bmp-buttons-row {
        gap: 10px;
    }
    .bmp-ctrl-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .bmp-ctrl-btn.play-btn {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}
