:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-hover: #222240;
    --accent: #e040fb;
    --accent-dim: #9c27b0;
    --accent-glow: rgba(224, 64, 251, 0.3);
    --text-primary: #f0f0f5;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --border: #2a2a3e;
    --player-bg: #0d0d15;
    --success: #00e676;
    --radius: 8px;
    --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 90px;
}

a { color: inherit; text-decoration: none; }

/* --- NAV --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 2rem;
}
.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--accent);
    white-space: nowrap;
}
.nav-logo span {
    color: var(--text-primary);
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}
.nav-search {
    margin-left: auto;
    position: relative;
}
.nav-search input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px 8px 36px;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 240px;
    outline: none;
    transition: border-color 0.2s, width 0.3s;
}
.nav-search input:focus {
    border-color: var(--accent);
    width: 300px;
}
.nav-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

/* --- MAIN LAYOUT --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- HERO --- */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
}
.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
}

/* --- SECTION --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}
.section-header a {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
}
.section { margin-bottom: 3rem; }

/* --- TRACK GRID --- */
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.track-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
    position: relative;
}
.track-card:hover {
    transform: translateY(-4px);
    background: var(--bg-hover);
}
.track-card-cover {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.track-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.track-card-cover .no-cover {
    font-size: 3rem;
    color: var(--text-muted);
}
.track-card-cover .play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.track-card:hover .play-overlay { opacity: 1; }
.play-overlay svg {
    width: 48px;
    height: 48px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.track-card-info {
    padding: 0.75rem 1rem;
}
.track-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
}

/* --- TRACK LIST (table style) --- */
.track-list { width: 100%; }
.track-list-item {
    display: grid;
    grid-template-columns: 40px 56px 1fr 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    transition: background 0.15s;
    cursor: pointer;
}
.track-list-item:hover {
    background: var(--bg-card);
}
.track-list-item .num {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}
.track-list-item:hover .num { display: none; }
.track-list-item .play-btn-small { display: none; }
.track-list-item:hover .play-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
}
.track-list-item .thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}
.track-list-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.track-list-item .title-col .title {
    font-weight: 500;
    font-size: 0.9rem;
}
.track-list-item .title-col .artist-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.track-list-item .album-col {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.track-list-item .duration {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 40px;
    text-align: right;
}
.track-list-item .type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.track-list-item .type-badge.video {
    background: rgba(224, 64, 251, 0.15);
    color: var(--accent);
}

/* --- ARTIST CARDS --- */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}
.artist-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.artist-card:hover { background: var(--bg-card); }
.artist-card-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    margin: 0 auto 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.artist-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artist-card-img .no-img {
    font-size: 2.5rem;
    color: var(--text-muted);
}
.artist-card-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- ALBUM CARDS --- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}
.album-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, background 0.2s;
}
.album-card:hover {
    transform: translateY(-4px);
    background: var(--bg-hover);
}
.album-card-cover {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    overflow: hidden;
}
.album-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.album-card-info { padding: 0.75rem 1rem; }
.album-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}
.album-card-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* --- FILTERS --- */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* --- DETAIL PAGE --- */
.detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}
.detail-cover {
    width: 240px;
    height: 240px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-info h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.detail-info .meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.detail-info .meta a {
    color: var(--accent);
}
.detail-info .description {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
}

/* --- VIDEO PLAYER --- */
.video-container {
    background: black;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
}
.video-container video {
    width: 100%;
    display: block;
}

/* YouTube 16:9 landscape */
.video-container.landscape {
    max-width: 900px;
    aspect-ratio: 16 / 9;
}
.video-container.landscape video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* TikTok 9:16 portrait */
.video-container.portrait {
    max-width: 400px;
    aspect-ratio: 9 / 16;
}
.video-container.portrait video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Square 1:1 */
.video-container.square {
    max-width: 600px;
    aspect-ratio: 1 / 1;
}
.video-container.square video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Format label on video */
.video-format-label {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 2;
}

@media (max-width: 768px) {
    .video-container.portrait { max-width: 100%; }
    .video-container.landscape { max-width: 100%; }
    .video-container.square { max-width: 100%; }
}

/* --- PLAYER BAR --- */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--player-bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    display: none;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}
.player-bar.active { display: flex; }

.player-track-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    max-width: 280px;
}
.player-thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    background: var(--bg-card);
    overflow: hidden;
    flex-shrink: 0;
}
.player-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.player-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.player-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}
.player-btn:hover { color: var(--text-primary); }
.player-btn.play-pause {
    color: white;
    background: var(--accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-btn.play-pause:hover {
    background: var(--accent-dim);
}
.player-btn svg {
    width: 20px;
    height: 20px;
}

.player-progress {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.player-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}
.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.progress-bar:hover { height: 6px; }
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
}
.progress-bar:hover .progress-fill::after { opacity: 1; }

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: flex-end;
}
.volume-slider {
    width: 80px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.volume-fill {
    height: 100%;
    background: var(--text-secondary);
    border-radius: 2px;
    width: 80%;
}

/* --- SEARCH RESULTS --- */
.search-section { margin-bottom: 2rem; }
.search-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.no-results h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-secondary); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-inner { padding: 0 1rem; gap: 1rem; }
    .nav-links { display: none; }
    .nav-search input { width: 160px; }
    .nav-search input:focus { width: 200px; }
    .container { padding: 1rem; }
    .hero { padding: 2rem 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-cover { width: 200px; height: 200px; }
    .track-list-item { grid-template-columns: 48px 1fr auto; gap: 0.75rem; }
    .track-list-item .num, .track-list-item .album-col { display: none; }
    .player-bar { gap: 0.5rem; padding: 0 0.75rem; }
    .player-track-info { min-width: 120px; }
    .player-volume { display: none; }
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
