/* ===== BEATS PAGE ===== */
.beat-page { width: 100%; min-height: 100vh; padding-bottom: var(--player-height); }

/* HERO */
.hero { position: relative; width: 100%; height: 380px; overflow: hidden; background: var(--bg-main); }
.hero-bg-blur { position: absolute; top: -20%; left: -10%; width: 120%; height: 140%; background-size: cover; background-position: center; filter: blur(60px) brightness(0.3) saturate(1.4); z-index: 0; opacity: 0.7; }
.hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 48px; max-width: 1200px; margin: 0 auto; padding: 40px 48px; height: 100%; }
.hero-artwork { flex-shrink: 0; width: 280px; height: 280px; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 80px rgba(167,139,250,0.1); }
.hero-artwork img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.now-playing-label { font-size: 11px; font-weight: 600; letter-spacing: 3px; color: var(--accent-active); }
.track-title { font-size: 42px; font-weight: 700; color: #e8e8e8; line-height: 1.1; }
.hero-meta { display: flex; gap: 10px; margin-top: 4px; }
.mood-tag { background: rgba(142,168,195,0.12); border: 1px solid rgba(142,168,195,0.25); color: var(--accent-passive); padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.hero-progress { margin-top: 12px; max-width: 450px; }
.progress-bar-hero { width: 100%; height: 4px; background: var(--border-subtle); border-radius: 4px; overflow: hidden; cursor: pointer; }
.progress-fill-hero { width: 0%; height: 100%; background: var(--accent-active); border-radius: 4px; transition: width 0.1s linear; }
.progress-times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-secondary); }

/* VIBES BAR (tags + filter toggle) */
.vibes-bar { max-width: 1200px; margin: 0 auto; padding: 20px 48px 0; }
.vibes-bar-inner { display: flex; align-items: center; gap: 16px; }
.tags-container { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.tag-pill { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 500; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.25s ease; }
.tag-pill:hover { border-color: var(--accent-passive); color: var(--accent-passive); background: rgba(142,168,195,0.06); }
.tag-pill.active { background: var(--accent-active); border-color: var(--accent-active); color: #1e1e1e; font-weight: 600; }

/* Filter / Type expand buttons */
.vibes-bar-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.filter-expand-btn,
.type-expand-btn { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 8px 18px; border-radius: 24px; font-size: 13px; font-weight: 500; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.25s ease; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.filter-expand-btn:hover,
.type-expand-btn:hover { border-color: var(--accent-passive); color: var(--accent-passive); }
.filter-expand-btn.open,
.type-expand-btn.open { background: var(--accent-active); border-color: var(--accent-active); color: #1e1e1e; }
.type-expand-btn.has-selection:not(.open) { border-color: var(--accent-active); color: var(--accent-active); }
.filter-btn-chev,
.type-btn-chev { font-size: 9px; transition: transform 0.2s ease; }
.filter-expand-btn.open .filter-btn-chev,
.type-expand-btn.open .type-btn-chev { transform: rotate(180deg); }
/* "Type" is a mobile-only button — hidden on desktop, shown ≤ 768px */
.type-expand-btn { display: none; }

/* Mobile: collapse tag pills behind the "Type" button (mirrors filter-panel pattern) */
@media (max-width: 768px) {
    .vibes-bar-inner { flex-wrap: wrap; }
    .type-expand-btn { display: flex; }
    .vibes-bar-buttons { order: 1; flex: 1; }
    .tags-container { order: 2; flex: 0 0 100%; max-height: 0; overflow: hidden; gap: 8px; padding: 0; transition: max-height 0.35s ease, padding 0.35s ease; }
    .tags-container.open { max-height: 280px; overflow-y: auto; padding-top: 14px; }
}

/* Collapsible filter panel */
.filter-panel { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; }
.filter-panel.open { max-height: 200px; padding-top: 16px; }
.filter-panel-inner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Filter chips (inside panel) */
.filter-chip { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 8px 18px; border-radius: 24px; font-size: 13px; font-weight: 500; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.25s ease; display: flex; align-items: center; gap: 8px; }
.filter-chip:hover { border-color: var(--accent-passive); color: var(--accent-passive); }
.filter-chip.active { background: var(--accent-active); border-color: var(--accent-active); color: #1e1e1e; }
.filter-chip.has-selection { border-color: var(--accent-active); color: var(--accent-active); }
.filter-chip i { font-size: 10px; }
.filter-clear { border-color: rgba(217,119,85,0.3); color: var(--accent-warn); }
.filter-clear:hover { border-color: var(--accent-warn); background: rgba(217,119,85,0.08); color: var(--accent-warn); }

/* Filter dropdowns (positioned from chips) */
.filter-dropdown-wrap { position: relative; }
.filter-dropdown-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 8px; min-width: 180px; z-index: 100; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.filter-dropdown-panel.show { display: block; }
.dropdown-option { display: block; width: 100%; background: none; border: none; color: var(--text-secondary); padding: 10px 14px; border-radius: 8px; font-size: 13px; font-family: 'Inter', sans-serif; cursor: pointer; text-align: left; transition: all 0.15s ease; }
.dropdown-option:hover { background: rgba(142,168,195,0.08); color: var(--accent-passive); }
.dropdown-option.active { color: var(--accent-active); }

.key-panel { min-width: 220px; padding: 12px; }
.key-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.key-pill { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 500; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; }
.key-pill:hover { border-color: var(--accent-passive); color: var(--accent-passive); }
.key-pill.active { background: var(--accent-active); border-color: var(--accent-active); color: #1e1e1e; font-weight: 600; }

.bpm-panel { min-width: 260px; padding: 16px; }
.bpm-slider-container { display: flex; align-items: center; gap: 14px; }
.bpm-value { font-size: 12px; color: var(--accent-passive); font-weight: 500; min-width: 28px; }
.bpm-slider-track { flex: 1; height: 4px; background: var(--border-subtle); border-radius: 4px; position: relative; }
.bpm-slider-fill { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: var(--accent-active); border-radius: 4px; }
.bpm-handle { position: absolute; top: 50%; width: 16px; height: 16px; background: var(--accent-active); border: 2px solid #1e1e1e; border-radius: 50%; transform: translate(-50%, -50%); cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.bpm-handle-left { left: 0%; }
.bpm-handle-right { left: 100%; }

/* RESULTS BAR */
.results-bar { max-width: 1200px; margin: 0 auto; padding: 12px 48px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--border-subtle); }
.results-count { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.results-actions { display: flex; align-items: center; gap: 12px; }
.shuffle-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; font-size: 14px; }
.shuffle-btn:hover { border-color: var(--accent-active); color: var(--accent-active); }
.sort-dropdown-wrap { position: relative; }
.sort-btn { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 500; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 6px; }
.sort-btn:hover { border-color: var(--accent-active); color: var(--accent-active); }
.sort-btn i { font-size: 9px; }
.sort-dropdown-panel { display: none; position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 6px; min-width: 160px; z-index: 100; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.sort-dropdown-panel.show { display: block; }
.sort-option { display: block; width: 100%; background: none; border: none; color: var(--text-secondary); padding: 9px 14px; border-radius: 6px; font-size: 13px; font-family: 'Inter', sans-serif; cursor: pointer; text-align: left; transition: all 0.15s; }
.sort-option:hover { background: rgba(142,168,195,0.08); color: var(--accent-passive); }
.sort-option.active { color: var(--accent-active); }

/* TRACKLIST */
.tracklist { max-width: 1200px; margin: 0 auto; padding: 4px 48px 40px; }
.track-row { display: flex; align-items: center; padding: 14px 16px; border-radius: 10px; transition: all 0.2s ease; cursor: pointer; border-bottom: 1px solid rgba(58,58,58,0.4); }
.track-row:hover { background: rgba(255,255,255,0.03); }
.track-row.active-track { background: rgba(167,139,250,0.06); border-bottom-color: rgba(167,139,250,0.15); }
.track-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.track-thumb { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.track-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); opacity: 0; transition: opacity 0.2s ease; }
.track-row:hover .play-overlay, .track-row.active-track .play-overlay { opacity: 1; }
.play-overlay i { color: #fff; font-size: 16px; }
.track-details { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.track-name { font-size: 15px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-track .track-name { color: var(--accent-active); }
.track-mood { font-size: 12px; color: var(--text-secondary); }

/* Asset badges — raw colored icons with a soft gem-like glow.
   Stacked drop-shadows give a tight inner bloom + softer outer halo. */
.track-badges { display: flex; align-items: center; gap: 8px; margin-top: 3px; line-height: 1; }
.track-badge-icon {
    display: inline-flex; align-items: center; justify-content: center;
    height: 12px; font-size: 11px;
    cursor: default; opacity: 0.92;
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}
.track-badge-icon svg { width: auto; height: 12px; display: block; }
.track-badge-icon.badge-stems {
    color: var(--accent-active);
    filter: drop-shadow(0 0 1.5px rgba(167,139,250,0.55))
            drop-shadow(0 0 5px  rgba(167,139,250,0.22));
}
.track-badge-icon.badge-midi {
    color: var(--accent-passive);
    filter: drop-shadow(0 0 1.5px rgba(142,168,195,0.55))
            drop-shadow(0 0 5px  rgba(142,168,195,0.22));
}
.track-badge-icon:hover { opacity: 1; transform: translateY(-0.5px) scale(1.08); }
.track-badge-icon.badge-stems:hover {
    filter: drop-shadow(0 0 2px rgba(167,139,250,0.75))
            drop-shadow(0 0 8px rgba(167,139,250,0.35));
}
.track-badge-icon.badge-midi:hover {
    filter: drop-shadow(0 0 2px rgba(142,168,195,0.75))
            drop-shadow(0 0 8px rgba(142,168,195,0.35));
}

/* Stems action button */
.stems-btn:hover { border-color: var(--accent-active); color: var(--accent-active); background: rgba(167,139,250,0.08); }
.track-center { width: 100px; text-align: center; }
.track-bpm { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.track-actions { display: flex; gap: 8px; align-items: center; }
.action-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; font-size: 14px; }
.action-btn:hover { border-color: var(--accent-passive); color: var(--accent-passive); background: rgba(142,168,195,0.08); }
.cart-btn:hover { border-color: var(--accent-active); color: var(--accent-active); background: rgba(167,139,250,0.08); }
.fav-btn.favorited { border-color: var(--accent-active); color: var(--accent-active); background: rgba(167,139,250,0.1); }

/* EMPTY STATE */
.tracklist-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14px; display: none; }
.tracklist-empty i { font-size: 32px; margin-bottom: 12px; display: block; color: var(--border-subtle); }

/* LOADING SPINNER */
.tracklist-loading { text-align: center; padding: 40px; display: none; }
.tracklist-loading .spinner { width: 32px; height: 32px; border: 3px solid var(--border-subtle); border-top-color: var(--accent-active); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Track name as product permalink (added with track-row product link) */
.track-name-link { text-decoration: none; color: inherit; cursor: pointer; }
.track-name-link:hover { color: var(--accent-active); }
.active-track .track-name-link { color: var(--accent-active); }

/* filter-panel-overflow-fix: dropdowns inside .filter-panel are absolutely
 * positioned and were being clipped by overflow:hidden + max-height:200px.
 * Keep overflow hidden during the slide-down animation, then flip to visible
 * once expanded so dropdowns can render outside the panel bounds. */
.filter-panel { transition: max-height 0.35s ease, padding 0.35s ease, overflow 0s linear 0.35s; }
.filter-panel.open { overflow: visible; transition: max-height 0.35s ease, padding 0.35s ease, overflow 0s linear 0s; }


/* ========== Vybe Filter Panel ========== */
.beat-page .filter-dropdown-panel.vibe-panel {
    width: 280px;
    max-height: 360px;
    overflow: hidden;
    flex-direction: column;
    padding: 10px;
}
.beat-page .filter-dropdown-panel.vibe-panel.show {
    display: flex;
}

.beat-page .vibe-search-input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: Inter, sans-serif;
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 8px;
}

.beat-page .vibe-search-input:focus {
    border-color: var(--accent-passive);
}

.beat-page .vibe-options-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.beat-page .dropdown-option.vibe-option.active {
    background: rgba(142, 168, 195, 0.18);
    color: var(--accent-passive);
    border-color: rgba(142, 168, 195, 0.4);
}

.beat-page .vibe-empty {
    padding: 14px 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-align: center;
    font-style: italic;
}

/* ========== Active Filters Chip Bar ========== */
.beat-page .active-filters-bar {
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 0;
}

.beat-page .active-filters-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.beat-page .active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.beat-page .active-filter-chip .filter-source-label {
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.beat-page .active-filter-chip .filter-chip-label {
    font-weight: 500;
}

.beat-page .active-filter-chip[data-source="vibe"] {
    border-color: rgba(142, 168, 195, 0.4);
}
.beat-page .active-filter-chip[data-source="vibe"] .filter-source-label {
    color: var(--accent-passive);
}

.beat-page .active-filter-chip[data-source="tag"] {
    border-color: rgba(167, 139, 250, 0.4);
}
.beat-page .active-filter-chip[data-source="tag"] .filter-source-label {
    color: var(--accent-active);
}

.beat-page .active-filter-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 4px;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.beat-page .active-filter-remove:hover {
    opacity: 1;
    color: var(--text-primary);
}

/* ===== PAGINATION ===== */
.beat-page .tracklist-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 32px 48px 16px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
.beat-page .pagination-page,
.beat-page .pagination-nav { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); min-width: 36px; height: 36px; padding: 0 10px; border-radius: 4px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease; }
.beat-page .pagination-page:hover:not(.active),
.beat-page .pagination-nav:hover:not(:disabled) { border-color: var(--accent-passive); color: var(--accent-passive); }
.beat-page .pagination-page.active { background: var(--accent-active); border-color: var(--accent-active); color: #1e1e1e; cursor: default; }
.beat-page .pagination-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.beat-page .pagination-ellipsis { color: var(--text-secondary); padding: 0 4px; font-size: 14px; user-select: none; }


/* ===== FAVORITES VIEW (/beats/?favorites=1) ===== */
.bb-fav-banner {
    max-width: 1200px;
    margin: 0 auto 16px;
    padding: 14px 24px;
    background: rgba(167,139,250,0.06);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
}
.bb-fav-banner > span {
    color: var(--text-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.bb-fav-banner > span i {
    color: var(--accent-active);
}
.bb-fav-banner-clear {
    color: var(--accent-passive);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}
.bb-fav-banner-clear:hover {
    color: var(--accent-active);
}

.bb-fav-empty {
    max-width: 480px;
    margin: 60px auto 80px;
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
}
.bb-fav-empty i {
    font-size: 36px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 16px;
    display: block;
}
.bb-fav-empty h3 {
    color: #e8e8e8;
    font-size: 18px;
    margin: 0 0 8px;
    font-weight: 600;
}
.bb-fav-empty p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.6;
}
.bb-fav-empty-btn {
    display: inline-block;
    background: var(--accent-active);
    color: #1e1e1e !important;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.bb-fav-empty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(167,139,250,0.3);
}

/* Active heart badge in nav stays purple */
.nav-fav-count.has-favs {
    background: var(--accent-active);
    color: #1e1e1e;
}
