:root {
    /* Color Palette - Premium Dark Theme */
    --bg-base: #0a0a0c;
    --bg-surface: rgba(25, 25, 30, 0.6);
    --bg-surface-hover: rgba(40, 40, 48, 0.8);
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #ec4899; /* Pink */
    --accent: #06b6d4; /* Cyan */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(16px);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-hero: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(236, 72, 153, 0.2));
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden; /* App-like feel, scroll in specific areas */
    /* Dynamic moving background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    background-size: 100vw 100vh;
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

.btn-icon i.active {
    color: var(--secondary);
}

/* Layout Container */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr 90px; /* 90px for bottom player */
    height: 100vh;
    padding: 12px;
    gap: 12px;
}

/* Sidebar */
.sidebar {
    grid-column: 1;
    grid-row: 1 / 2; /* Spans above the player */
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 0; }

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

.brand-icon {
    font-size: 1.8rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.brand h2 span {
    font-weight: 300;
    color: var(--text-secondary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-bottom {
    margin-top: auto;
}

.premium-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.premium-card h4 {
    margin-bottom: 4px;
}

.premium-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.premium-card .btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.6rem;
}

/* Main Content Area */
.main-content {
    grid-column: 2;
    grid-row: 1;
    overflow-y: auto;
    padding: 0 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 10;
    /* Transparent initially, could add a background on scroll via JS */
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 9999px;
    width: 400px;
}

.search-bar i {
    color: var(--text-secondary);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    width: 100%;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 8px;
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--bg-surface-hover);
}

.search-result-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}

.search-result-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.search-result-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    cursor: pointer;
}

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

/* Hero Section */
.hero-section {
    border-radius: 20px;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 8px;
    font-weight: 800;
}

.hero-artist {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* Featured Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.see-all {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

.see-all:hover {
    text-decoration: underline;
}

.track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-item {
    display: grid;
    grid-template-columns: 40px 60px 1fr 1fr 60px auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.track-item:hover {
    background: var(--bg-surface-hover);
}

.track-num {
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.track-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
}

.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 ease;
    border-radius: 8px;
}

.track-item:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    color: white;
    font-size: 1.2rem;
}

.track-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.track-artist, .track-album {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.track-duration {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Bottom Player */
.music-player {
    grid-column: 1 / -1;
    grid-row: 2;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}

.player-title {
    font-size: 1rem;
    font-weight: 600;
}

.player-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.play-pause-btn {
    font-size: 2.2rem;
    color: var(--text-primary);
}

.play-pause-btn:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Custom Sliders (Progress and Volume) */
.progress-bar-bg, .volume-bar-bg {
    flex-grow: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill, .volume-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
}

.progress-container:hover .progress-bar-fill,
.volume-container:hover .volume-bar-fill {
    background: var(--gradient-primary);
}

.progress-dot, .volume-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.progress-container:hover .progress-dot,
.volume-container:hover .volume-dot {
    opacity: 1;
}

.player-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.volume-container {
    display: flex;
    align-items: center;
    width: 120px;
}

/* Responsiveness (Basic) */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 80px 1fr;
    }
    
    .brand h2, .nav-item span, .nav-label, .premium-card {
        display: none;
    }

    .brand {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px 0;
    }
    
    .nav-item i {
        margin: 0;
        font-size: 1.3rem;
    }

    .track-album {
        display: none;
    }
    .track-item {
        grid-template-columns: 40px 60px 1fr 60px auto auto;
    }
}

/* Modals & Forms */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 20px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
}

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

.modal-header h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary);
}

.w-100 {
    width: 100%;
}

.modal-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-footer a {
    color: var(--primary);
    font-weight: 600;
}

.modal-footer a:hover {
    text-decoration: underline;
}
