/* ==========================================================================
   SonicVault - Modern Dark Audio Platform Theme
   ========================================================================== */

:root {
    --bg-main: #0a0d14;
    --bg-sidebar: #0e131d;
    --bg-card: #141b29;
    --bg-card-hover: #1c2638;
    --bg-surface: #121824;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.35);
    
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-gold: #f59e0b;
    --accent-purple: #8b5cf6;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --player-height: 84px;
    --sidebar-width: 250px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    user-select: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #242f44;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* ==========================================================================
   Layout Architecture
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    padding-bottom: var(--player-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    bottom: var(--player-height);
    left: 0;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1.5px solid rgba(234, 179, 8, 0.4);
    box-shadow: 0 0 14px rgba(234, 179, 8, 0.25);
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title-main {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 10px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item:hover {
    color: #fff;
    background: var(--bg-card-hover);
}

.nav-item.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.sidebar-ad-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 800;
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-ad-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.sidebar-ad-card p {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.btn-upgrade {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-upgrade:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.library-stats-box {
    margin-top: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}
.stat-row:last-child { margin-bottom: 0; }
.stat-label { color: var(--text-muted); }
.stat-val { font-weight: 700; color: #fff; }
.text-green { color: var(--accent-green); }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px 32px 140px;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.search-wrapper {
    flex: 1;
    max-width: 680px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 12px 42px 12px 46px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-clear {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}
.btn-clear.hidden { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-dropdown-wrapper {
    position: relative;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e293b;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
    min-width: 160px;
    backdrop-filter: blur(12px);
}

.lang-menu.hidden {
    display: none;
}

.lang-opt {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-opt:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
}

.lang-opt.active {
    background: var(--primary);
    color: #fff;
}

.btn-license-info {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-license-info:hover {
    color: #fff;
    border-color: var(--border-hover);
}

.btn-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    transition: var(--transition);
}
.btn-pro:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

/* Billboard Ad Banner */
.ad-billboard-container {
    background: linear-gradient(90deg, #131d2e 0%, #1e293b 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.ad-slot-header {
    margin-bottom: 6px;
}

.ad-tag {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-billboard-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ad-pill {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 4px;
}

.ad-content-left h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.ad-content-left p {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.btn-ad-cta {
    background: #fff;
    color: #0f172a;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-ad-cta:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

/* Genre Pills */
.genre-pill-section {
    margin-bottom: 24px;
}

.genre-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.genre-pills::-webkit-scrollbar { height: 4px; }

.pill {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.pill:hover {
    color: #fff;
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.pill.active {
    background: #fff;
    color: #0a0d14;
    font-weight: 700;
    border-color: #fff;
}

/* Toolbar */
.track-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.result-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.checkbox-container input {
    cursor: pointer;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 13px;
    color: var(--text-muted);
}

.sort-select {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

/* ==========================================================================
   Music Library Table Styles
   ========================================================================== */

.tracks-container {
    width: 100%;
    margin-top: 10px;
}

.tracks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    table-layout: auto;
}

#tracksTableBody {
    transition: opacity 0.15s ease;
}

.tracks-table th {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 0.5px;
    user-select: none;
}

.th-play { width: 50px; text-align: center; }
.th-cover { width: 60px; }
.th-title { min-width: 250px; }
.th-genre { width: 200px; }
.th-license { width: 120px; }
.th-actions { width: 230px; text-align: right; }

.track-row {
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.track-row td {
    padding: 10px 14px;
    vertical-align: middle;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

.track-row td:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    border-left: 1px solid transparent;
}

.track-row td:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    border-right: 1px solid transparent;
}

.track-row:hover {
    background: var(--bg-card-hover);
}

.track-row.playing {
    background: rgba(59, 130, 246, 0.12);
}
.track-row.playing td {
    border-color: rgba(59, 130, 246, 0.3);
}

.btn-table-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-table-play:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.08);
}

.track-row.playing .btn-table-play {
    background: var(--primary);
    color: #fff;
}

.table-cover-img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.td-title {
    max-width: 400px;
}

.track-title-text {
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.track-row.playing .track-title-text {
    color: #60a5fa;
}

.track-prompt-text {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.genre-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.inst-tag {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.license-pill {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-block;
}

.td-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-row-dl {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-row-dl:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-row-cert {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

.btn-row-cert:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
    transform: scale(1.08);
}

/* In-Feed Sponsored Card */
.in-feed-ad-row {
    background: linear-gradient(90deg, #1e1b4b, #172554);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0;
}

.in-feed-ad-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ad-icon-box {
    font-size: 28px;
}

.in-feed-ad-left h4 {
    font-size: 14.5px;
    color: #fff;
    font-weight: 700;
}

.in-feed-ad-left p {
    font-size: 12px;
    color: #cbd5e1;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Load More Wrapper */
.load-more-wrapper {
    text-align: center;
    margin: 40px 0 20px;
}

.btn-load-more {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 14px 44px;
    border-radius: var(--radius-full);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 24px var(--primary-glow);
    transform: translateY(-2px);
}

/* ==========================================================================
   Bottom Audio Player Bar
   ========================================================================== */

/* ==========================================================================
   Bottom Audio Player Bar (Fixed at bottom)
   ========================================================================== */

.bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(10, 13, 20, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 320px;
    min-width: 0;
}

.player-cover {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.player-cover.hidden {
    display: none;
}

.player-meta {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.player-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-prompt {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.btn-fav-player {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-fav-player:hover {
    transform: scale(1.2);
}

/* Center Controls */
.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 600px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-control {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-control:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-control.play-btn {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-control.play-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.08);
}

.player-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.player-progress-bar span {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    width: 36px;
}

#durationTime {
    text-align: right;
}

.player-progress-bar input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: var(--radius-full);
}

/* Player Right */
.player-right {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 300px;
    justify-content: flex-end;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vol-icon {
    font-size: 14px;
}

.volume-control input[type="range"] {
    width: 75px;
    height: 4px;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-player-action {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-player-action:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-player-license {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--transition);
}

.btn-player-license:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
    transform: scale(1.08);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.2s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 680px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.btn-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}
.btn-modal-close:hover { color: #fff; }

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.modal-header h2 {
    font-size: 22px;
    color: #fff;
    margin: 8px 0 4px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-ad-banner {
    background: #1e293b;
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.ad-box-mock strong {
    font-size: 13px;
    color: var(--accent-gold);
    display: block;
    margin-top: 2px;
}
.ad-box-mock p {
    font-size: 11.5px;
    color: #94a3b8;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dl-option-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.dl-option-card.pro-card {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.25) 0%, rgba(20, 27, 41, 1) 100%);
}

.opt-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.opt-tag.tag-pro {
    color: var(--primary);
}

.dl-option-card h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
}

.opt-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.opt-features {
    list-style: none;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-dl-free {
    background: var(--bg-surface);
    color: #fff;
    border: 1px solid var(--border-hover);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-dl-free:hover {
    background: #334155;
}

.cert-input-wrapper {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cert-input-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-gold);
    text-align: left;
}

.cert-input-text {
    background: #0f172a;
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #fff;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: 100%;
    outline: none;
    transition: var(--transition);
}

.cert-input-text:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.pro-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-dl-pro {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--primary-glow);
    text-align: center;
}
.btn-dl-pro:hover {
    background: var(--primary-hover);
}

.btn-dl-cert {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-dl-cert:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.modal-share-bar {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.btn-modal-share {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-hover);
    color: #fff;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-modal-share:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* Pricing Grid */
.pricing-card {
    max-width: 680px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan-card.highlighted {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.15) 0%, rgba(20, 27, 41, 1) 100%);
}

.popular-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.plan-card h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 8px;
}

.plan-card .price {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}
.plan-card .price span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
}

.plan-card ul {
    list-style: none;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    flex: 1;
}

.btn-plan {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-plan.current {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.btn-plan.subscribe {
    background: var(--primary);
    color: #fff;
}
.btn-plan.subscribe:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* ==========================================================================
   Extended New Features: Tags, Favorites, Terms, and Toast
   ========================================================================== */

/* Favorites Badge in Sidebar */
.fav-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

/* Sidebar Footer Link */
.sidebar-footer-links {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}
.btn-text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}
.btn-text-link:hover {
    color: var(--primary);
}

/* Terms Button in Header */
.btn-terms-info {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-terms-info:hover {
    color: #fff;
    border-color: var(--border-hover);
}

/* Quick Creator Mood & Purpose Tags Bar */
.creator-tags-section {
    margin-bottom: 16px;
}
.creator-tags-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.tags-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.tag-chip {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.tag-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}
.tag-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Row Action Buttons: Heart & Share */
.btn-fav-row, .btn-share-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}
.btn-fav-row:hover, .btn-share-row:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.08);
}
.btn-fav-row.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

/* Player Heart Button */
.btn-fav-player {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}
.btn-fav-player:hover {
    transform: scale(1.2);
}

/* Terms Modal */
.terms-card {
    max-width: 820px;
    width: 94%;
}
.terms-content-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    max-height: 520px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.terms-content-box h3 {
    color: #58a6ff;
    margin: 16px 0 8px;
    font-size: 14px;
}
.terms-content-box h3:first-child {
    margin-top: 0;
}
.terms-content-box p {
    margin: 4px 0 8px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: #1e293b;
    border: 1px solid #3b82f6;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 13.5px;
    font-weight: 600;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile Brand Header Bar */
.mobile-brand-header {
    display: none;
    margin-bottom: 12px;
}

.brand-logo-img-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(234, 179, 8, 0.4);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.25);
}

.brand-title-main-sm {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}

.brand-subtitle-sm {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* Desktop Only helper */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Mobile Footer Legal & Info Links */
.mobile-footer-links {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
    .mobile-footer-links {
        display: flex !important;
    }
}

.btn-footer-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-divider {
    color: var(--text-muted);
    font-size: 11px;
}

/* Universal Responsive Breakpoints (All Smartphones, Tablets, PCs) */

.btn-terms-info, .btn-license-info, .btn-pro, .lang-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Tablet & iPad (<= 1024px) */
@media (max-width: 1024px) {
    .sidebar { display: none !important; }
    .mobile-brand-header { display: flex !important; align-items: center; }
    .main-content { 
        margin-left: 0 !important; 
        width: 100vw !important; 
        max-width: 100vw !important; 
        padding: 16px 16px 140px !important; 
        overflow-x: hidden !important;
    }
    .tracks-table th:nth-child(4), .tracks-table td:nth-child(4) { display: none !important; }
    .pricing-grid { grid-template-columns: 1fr; }
    .dl-options-grid { grid-template-columns: 1fr; }
}

/* Smartphone & Mobile (<= 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 12px 10px 130px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .mobile-brand-header {
        display: flex !important;
        align-items: center;
        margin-bottom: 10px;
    }

    /* Top Header */
    .top-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }
    
    .search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }
    .search-wrapper input {
        font-size: 12.5px !important;
        padding: 9px 36px 9px 40px !important;
    }
    
    /* Header Button Row (Clean 2-Button Row on Mobile: [🌐 Language] and [👑 Pro]) */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .lang-dropdown-wrapper {
        flex: 1 !important;
        position: relative !important;
        z-index: 50 !important;
    }
    
    .btn-icon {
        width: 100% !important;
        padding: 7px 12px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        justify-content: center !important;
        height: 36px !important;
        border-radius: var(--radius-full) !important;
        background: linear-gradient(135deg, #1e293b, #0f172a) !important;
        border: 1px solid rgba(59, 130, 246, 0.4) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    .lang-menu {
        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 100% !important;
        z-index: 9999 !important;
    }

    .btn-pro {
        flex: 1 !important;
        padding: 7px 12px !important;
        font-size: 12px !important;
        border-radius: var(--radius-full) !important;
        white-space: nowrap !important;
        height: 36px !important;
        justify-content: center !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Ad Billboard Banner */
    .ad-billboard-container {
        padding: 12px 14px !important;
        margin-bottom: 14px !important;
    }
    .ad-billboard-content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .ad-content-left h3 {
        font-size: 13.5px !important;
        line-height: 1.35 !important;
    }
    .ad-content-left p {
        font-size: 11px !important;
    }
    .btn-ad-cta {
        width: 100% !important;
        text-align: center !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    /* Genre & Tag Scrolls */
    .creator-tags-scroll, .genre-pills {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
    }
    .creator-tags-scroll::-webkit-scrollbar, .genre-pills::-webkit-scrollbar { display: none !important; }
    
    .tag-chip, .pill {
        padding: 5px 10px !important;
        font-size: 11.5px !important;
        flex-shrink: 0 !important;
    }

    /* Toolbar & Filters */
    .track-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }
    .toolbar-left {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .result-count {
        font-size: 12px !important;
    }
    .checkbox-container {
        font-size: 11.5px !important;
    }
    .toolbar-right {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .sort-select {
        font-size: 12px !important;
        padding: 5px 8px !important;
        width: 100% !important;
    }

    /* Tracks Table Mobile Fit */
    .tracks-table {
        table-layout: fixed !important;
        width: 100% !important;
        border-spacing: 0 6px !important;
    }
    .tracks-table thead {
        display: none !important;
    }
    
    .tracks-table th:nth-child(4), .tracks-table td:nth-child(4),
    .tracks-table th:nth-child(5), .tracks-table td:nth-child(5) {
        display: none !important;
    }
    
    .th-play, .td-play { 
        width: 32px !important; 
        padding: 6px 0px 6px 2px !important; 
        text-align: center !important;
    }
    .btn-table-play {
        width: 28px !important;
        height: 28px !important;
        font-size: 10px !important;
    }
    
    .th-cover, .td-cover { 
        width: 40px !important; 
        padding: 6px 2px !important; 
    }
    .table-cover-img { 
        width: 36px !important; 
        height: 36px !important; 
        min-width: 36px !important;
        max-width: 36px !important;
        border-radius: 6px !important;
    }
    
    .td-title { 
        width: auto !important;
        padding: 6px 6px !important; 
        overflow: hidden !important;
    }
    .track-title-text { 
        font-size: 12.5px !important; 
        margin-bottom: 1px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 160px !important;
    }
    .track-prompt-text { 
        font-size: 10px !important; 
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 160px !important;
        display: block !important;
    }
    
    .td-actions { 
        width: 108px !important; 
        padding: 6px 4px 6px 0px !important; 
        text-align: right !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 4px !important;
    }
    .btn-fav-row {
        display: inline-flex !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 13px !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        flex-shrink: 0 !important;
    }
    .btn-fav-row.active {
        background: rgba(239, 68, 68, 0.2) !important;
        border-color: #ef4444 !important;
        color: #ef4444 !important;
    }
    .btn-row-dl { 
        padding: 6px 10px !important; 
        font-size: 11px !important; 
        font-weight: 700 !important;
        white-space: nowrap !important;
        border-radius: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
    .btn-share-row, .btn-row-cert { 
        display: none !important; 
    }

    /* Bottom Player Mobile Optimization with Volume toggle */
    .bottom-player {
        height: 64px !important;
        padding: 0 10px !important;
    }
    .player-left {
        width: auto !important;
        max-width: 40% !important;
        gap: 6px !important;
    }
    .player-cover {
        width: 34px !important;
        height: 34px !important;
    }
    .player-title { 
        font-size: 11px !important; 
    }
    .player-prompt { 
        display: none !important; 
    }
    .btn-fav-player { 
        display: none !important; 
    }
    
    .player-center {
        max-width: 38% !important;
        gap: 2px !important;
    }
    .player-controls { 
        gap: 4px !important; 
    }
    .btn-control { 
        font-size: 11px !important; 
        padding: 2px !important; 
    }
    .btn-control.play-btn { 
        width: 26px !important; 
        height: 26px !important; 
        font-size: 10px !important; 
    }
    .player-progress-bar span { 
        display: none !important; 
    }
    
    .player-right {
        display: flex !important;
        width: auto !important;
        gap: 4px !important;
    }
    .volume-control input {
        display: none !important;
    }
    .vol-icon {
        font-size: 14px !important;
        cursor: pointer;
        padding: 2px;
    }
    .btn-player-action {
        padding: 5px 8px !important;
        font-size: 10.5px !important;
    }
    .btn-player-license {
        display: none !important;
    }
}

