/* ============================================
   MOODIFY - Main Stylesheet
   Dark Premium Theme
   Developed by Bima Haris
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg: #090a10;
    --panel: #11131d;
    --panel2: #171a27;
    --panel3: #1e2235;
    --line: #25283a;
    --text: #f4f5fb;
    --text-secondary: #c8cce0;
    --muted: #9298ad;
    --purple: #9b7cff;
    --purple-dark: #7c5ce0;
    --pink: #ff6da9;
    --pink-dark: #e85a96;
    --cyan: #6ee7e0;
    --violet: #b48cff;
    --neon-glow: rgba(155, 124, 255, 0.3);
    --gradient-primary: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--violet) 0%, var(--cyan) 100%);
    --gradient-hero: linear-gradient(135deg, #1a1040 0%, #0d0b1a 50%, #150d25 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--neon-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 75% -10%, #30214e 0%, transparent 35%), var(--bg);
    color: var(--text);
    font: 15px/1.6 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--pink);
}

button {
    cursor: pointer;
    border: none;
    color: inherit;
    font: inherit;
    background: none;
    transition: var(--transition);
}

input, textarea, select {
    font: inherit;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--neon-glow);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

::placeholder {
    color: var(--muted);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--panel);
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* --- App Layout --- */
.app {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 300px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    padding: 28px 20px;
    border-right: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-glow);
}

.brand span {
    color: var(--pink);
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 0 10px;
}

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

.nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--muted);
    text-align: left;
    width: 100%;
}

.nav button:hover {
    background: var(--panel2);
    color: var(--text);
}

.nav button.active {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.nav button .ico {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.sidebar-bottom .avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.sidebar-bottom b {
    font-size: 13px;
}

.sidebar-bottom small {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

/* --- Avatar --- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.avatar.a2 {
    background: var(--gradient-secondary);
}

.avatar.a3 {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
}

/* --- Main Content --- */
.main {
    padding: 28px 32px 120px;
    min-width: 0;
}

/* --- Top Bar --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.greeting h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.greeting p {
    color: var(--muted);
    font-size: 14px;
    margin: 4px 0 0;
}

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

.search {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 50px;
    padding: 10px 18px;
    color: var(--text);
    font-size: 14px;
    width: 260px;
    transition: var(--transition);
}

.search:focus {
    width: 320px;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--neon-glow);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--muted);
}

.icon-btn:hover {
    background: var(--panel2);
    color: var(--text);
    border-color: var(--purple);
}

/* --- Hero Section --- */
.hero {
    background: var(--gradient-hero);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px;
    min-height: 280px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--neon-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 500px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--purple);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero h2 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.hero-art {
    position: absolute;
    right: 30px;
    bottom: 20px;
    width: 160px;
    height: 160px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    opacity: 0.6;
    box-shadow: var(--shadow-glow);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- Buttons --- */
.primary {
    background: var(--gradient-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-glow);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--neon-glow);
}

.secondary {
    background: var(--panel2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 13px;
}

.secondary:hover {
    border-color: var(--purple);
    background: var(--panel3);
}

.text-btn {
    color: var(--purple);
    font-size: 13px;
    font-weight: 600;
}

.text-btn:hover {
    color: var(--pink);
}

/* --- Section Headers --- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    margin-top: 32px;
}

.section-head h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-head p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

/* --- Mood Row --- */
.mood-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.mood {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--muted);
    transition: var(--transition);
}

.mood span {
    font-size: 28px;
}

.mood:hover {
    border-color: var(--purple);
    background: var(--panel2);
    transform: translateY(-3px);
}

.mood.selected {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

/* --- Music Cards --- */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.music-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    transition: var(--transition);
}

.music-card:hover {
    border-color: var(--purple);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.cover.c1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.cover.c2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.cover.c3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.cover.c4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.play-cover {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.music-card:hover .play-cover {
    opacity: 1;
    transform: translateY(0);
}

.music-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card p {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.tiny {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 50px;
    background: var(--panel2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.tiny:hover {
    border-color: var(--purple);
    color: var(--text);
}

.tiny.liked {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* --- Feed / Posts --- */
.feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
}

.post:hover {
    border-color: var(--purple);
}

.post-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-head strong {
    font-size: 14px;
}

.post-head small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.post-copy {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.shared-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.shared-track .cover {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 20px;
    aspect-ratio: unset;
    margin-bottom: 0;
}

.track-info b {
    font-size: 13px;
    display: block;
}

.track-info small {
    font-size: 12px;
    color: var(--muted);
}

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

.post-actions button {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-actions button:hover {
    color: var(--purple);
}

.follow {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--line);
    background: var(--panel2);
    color: var(--muted);
}

.follow:hover, .follow.following {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* --- Right Sidebar --- */
.rightbar {
    padding: 28px 20px;
    border-left: 1px solid var(--line);
    background: var(--panel);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.rightbar h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.trend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: var(--transition);
}

.trend:hover {
    background: var(--panel2);
}

.trend .cover {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 16px;
    aspect-ratio: unset;
    margin-bottom: 0;
}

.trend b {
    font-size: 13px;
    display: block;
}

.trend small {
    font-size: 11px;
    color: var(--muted);
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: var(--transition);
}

.person:hover {
    background: var(--panel2);
}

.person-info b {
    font-size: 13px;
    display: block;
}

.person-info small {
    font-size: 11px;
    color: var(--muted);
}

.person button {
    margin-left: auto;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--line);
    background: var(--panel2);
    color: var(--muted);
}

.person button:hover {
    border-color: var(--purple);
    color: var(--text);
}

.right-card {
    background: var(--gradient-hero);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}

.right-card h3 {
    margin-top: 0;
}

.right-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* --- Bottom Player --- */
.player {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.now-playing .cover {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 20px;
    aspect-ratio: unset;
    margin-bottom: 0;
}

.now-playing b {
    font-size: 13px;
    display: block;
}

.now-playing small {
    font-size: 12px;
    color: var(--muted);
}

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

.player-controls button {
    font-size: 18px;
    color: var(--muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.player-controls button:hover {
    color: var(--text);
}

.play-main {
    width: 48px !important;
    height: 48px !important;
    background: var(--gradient-primary) !important;
    color: white !important;
    font-size: 20px !important;
    box-shadow: var(--shadow-glow);
}

.play-main:hover {
    transform: scale(1.05);
}

.progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.progress-wrap span {
    font-size: 11px;
    color: var(--muted);
    min-width: 30px;
}

.progress {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.progress i {
    display: block;
    width: 35%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.volume {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

/* --- Volume Control --- */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 0 6px var(--neon-glow);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px var(--neon-glow);
}

/* --- Queue Panel --- */
.queue-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 360px;
    max-height: 400px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 9;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
}

.queue-panel.show {
    display: flex;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.queue-header b {
    font-size: 14px;
}

.queue-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-actions button {
    font-size: 12px;
    color: var(--muted);
}

.queue-actions button:hover {
    color: var(--text);
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.queue-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--muted);
    font-size: 13px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.queue-item:hover {
    background: var(--panel2);
}

.queue-item.current {
    background: var(--panel3);
    border: 1px solid var(--purple);
}

.queue-number {
    font-size: 12px;
    color: var(--muted);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.queue-item.current .queue-number {
    color: var(--purple);
    font-weight: 700;
}

.queue-info {
    flex: 1;
    min-width: 0;
}

.queue-info b {
    font-size: 13px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-info small {
    font-size: 11px;
    color: var(--muted);
}

.queue-item .tiny {
    font-size: 10px;
    padding: 4px 8px;
    flex-shrink: 0;
}

/* --- Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-backdrop.show .modal {
    transform: translateY(0);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-head h2 {
    font-size: 20px;
    font-weight: 700;
}

.close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--muted);
}

.close:hover {
    background: var(--panel2);
    color: var(--text);
}

#modalBody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gradient-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 200;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Mobile Nav --- */
.mobile-nav {
    display: none;
}

/* --- Empty State --- */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
}

.muted {
    color: var(--muted);
}

/* --- Page Sections --- */
section[hidden] {
    display: none;
}

/* --- Settings Page --- */
.settings-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row label {
    font-size: 14px;
    font-weight: 500;
}

.settings-row small {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* --- Spotify Connect --- */
.spotify-connect {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--panel2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.spotify-icon {
    width: 48px;
    height: 48px;
    background: #1DB954;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.spotify-info {
    flex: 1;
}

.spotify-info b {
    display: block;
    font-size: 15px;
}

.spotify-info small {
    color: var(--muted);
    font-size: 12px;
}

.connect-btn {
    background: #1DB954;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 13px;
}

.connect-btn:hover {
    background: #1ed760;
    transform: translateY(-2px);
}

.disconnect-btn {
    background: var(--panel3);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
}

.disconnect-btn:hover {
    border-color: var(--pink);
    color: var(--pink);
}

/* --- Auth Modal --- */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--purple);
    border-bottom-color: var(--purple);
}

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

.auth-form.hidden {
    display: none;
}

/* --- Playlist Page --- */
.playlist-header {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 32px;
}

.playlist-cover {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    box-shadow: var(--shadow);
}

.playlist-info h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.playlist-info p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

.playlist-stats {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.playlist-stats span {
    font-size: 13px;
    color: var(--muted);
}

/* --- Playlist Track List --- */
.track-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}

.track-item:last-child {
    border-bottom: none;
}

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

.track-item .cover {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 16px;
    aspect-ratio: unset;
    margin-bottom: 0;
}

.track-item .track-info {
    flex: 1;
    min-width: 0;
}

.track-item .track-info b {
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-item .track-info small {
    font-size: 12px;
    color: var(--muted);
}

.track-item .track-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-item .track-actions button {
    font-size: 14px;
    color: var(--muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.track-item .track-actions button:hover {
    color: var(--text);
    background: var(--panel3);
}

/* --- YouTube Player Container --- */
.youtube-player-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.youtube-player-container.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

/* Ensure the iframe inside is visible */
.youtube-player-container .youtube-iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.youtube-player-container .youtube-iframe-wrapper iframe,
.youtube-player-container .youtube-iframe-wrapper #youtubePlayerElement iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.youtube-player-container .youtube-iframe-wrapper #youtubePlayerElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-player-container .player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

.youtube-player-container .player-header b {
    font-size: 13px;
}

.youtube-player-container .player-header button {
    font-size: 14px;
    color: var(--muted);
}

.youtube-iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.youtube-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Developer Credit --- */
.dev-credit {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    margin-top: 40px;
}

.dev-credit a {
    color: var(--purple);
    font-weight: 600;
}

/* ============================================
   SPOTIFY INTEGRATION STYLES
   ============================================ */

/* Status Badges */
.spotify-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spotify-status-badge.connected {
    background: rgba(29, 185, 84, 0.15);
    color: #1DB954;
    border: 1px solid rgba(29, 185, 84, 0.3);
}

.spotify-status-badge.not-connected {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--line);
}

.spotify-status-badge.not-configured {
    background: rgba(255, 165, 0, 0.1);
    color: orange;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

/* Open in Spotify Button */
.open-spotify-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1DB954;
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.open-spotify-btn:hover {
    background: #1ed760;
    transform: translateY(-1px);
    color: white;
}

/* Demo Label */
.demo-label {
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.demo-label span {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--purple);
}

.demo-label p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* Spotify Playlists Grid */
.spotify-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.spotify-playlist-card {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spotify-playlist-card:hover {
    background: var(--panel3);
    border-color: var(--purple);
    transform: translateY(-2px);
}

.spotify-playlist-card .playlist-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--panel3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: unset;
    height: unset;
    font-size: 32px;
    box-shadow: none;
}

.spotify-playlist-card .playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-playlist-card .playlist-cover-empty {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    font-size: 48px;
}

.spotify-playlist-card .playlist-info {
    flex: 1;
}

.spotify-playlist-card .playlist-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-playlist-card .playlist-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.spotify-playlist-card .playlist-meta {
    font-size: 11px;
    color: var(--muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.spotify-playlist-card .open-spotify-btn {
    align-self: flex-end;
    margin-top: auto;
}

/* Spotify Tracks List */
.spotify-tracks-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.spotify-track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}

.spotify-track-item:last-child {
    border-bottom: none;
}

.spotify-track-item:hover {
    background: var(--panel2);
}

.spotify-track-item .track-number {
    width: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    flex-shrink: 0;
}

.spotify-track-item .track-artwork {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--panel3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.spotify-track-item .track-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-track-item .track-artwork-empty {
    background: linear-gradient(135deg, var(--purple), var(--pink));
}

.spotify-track-item .track-info {
    flex: 1;
    min-width: 0;
}

.spotify-track-item .track-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-track-item .track-artist {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-track-item .track-album {
    font-size: 12px;
    color: var(--muted);
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.spotify-track-item .track-duration {
    font-size: 12px;
    color: var(--muted);
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.spotify-track-item .track-open-spotify {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1DB954;
    text-decoration: none;
    border-radius: 50%;
    transition: var(--transition);
    font-size: 14px;
    flex-shrink: 0;
}

.spotify-track-item .track-open-spotify:hover {
    background: rgba(29, 185, 84, 0.15);
    color: #1ed760;
}

/* Playlist Details Header */
.playlist-details-header {
    padding: 16px;
    background: var(--panel2);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: 1px solid var(--line);
    border-bottom: none;
}

.playlist-details-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.playlist-details-header p {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

/* Spotify Loading */
.spotify-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.spotify-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--purple);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

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

.spotify-loading p {
    font-size: 13px;
    margin: 0;
}

/* Spotify Empty State */
.spotify-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--muted);
    font-size: 13px;
}

/* Inline Spotify Profile */
.spotify-inline-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--panel2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.spotify-inline-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.spotify-inline-name {
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   Music Source Badges
   ============================================ */

.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-right: 4px;
}

.source-badge.itunes {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.2);
}

.source-badge.youtube {
    background: rgba(255, 0, 0, 0.12);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.2);
}

.source-badge.musicbrainz {
    background: rgba(120, 120, 200, 0.15);
    color: #9999dd;
    border: 1px solid rgba(120, 120, 200, 0.2);
}

.source-badge.audius {
    background: rgba(0, 170, 255, 0.15);
    color: #00aaff;
    border: 1px solid rgba(0, 170, 255, 0.2);
}

.source-badge.spotify {
    background: rgba(29, 185, 84, 0.15);
    color: #1DB954;
    border: 1px solid rgba(29, 185, 84, 0.2);
}

.source-badge.demo {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.source-badge.unknown {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--line);
}

/* ============================================
   Play Type Info
   ============================================ */

.play-info {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--line);
    margin-right: 4px;
}

.duration {
    display: inline-block;
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
}

/* ============================================
   Card Meta Row
   ============================================ */

.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 6px 0;
}

/* ============================================
   Source Groups (Search Results)
   ============================================ */

.source-group {
    margin-bottom: 28px;
}

.source-group:last-child {
    margin-bottom: 0;
}

.source-group-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

/* ============================================
   Loading Spinner
   ============================================ */

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

.empty .loading-spinner {
    margin: 0 auto 16px;
}

.empty p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* ============================================
   Music Card Enhancements
   ============================================ */

.music-card {
    position: relative;
}

.music-card h3 {
    margin: 8px 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-card p {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
