:root {
    /* Premium Dark Palette */
    --bg-deep: #0a0b0e;
    --bg-surface: #14161c;
    --accent: #1ed760; /* Octave Green */
    --text-primary: #ffffff;
    --text-secondary: #a0a4b8;
    
    /* Glassmorphism */
    --glass-bg: rgba(20, 22, 28, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Heavy Duty Shadows */
    --shadow-soft: 4px 4px 10px rgba(0, 0, 0, 0.4), -2px -2px 6px rgba(255, 255, 255, 0.02);
    --shadow-heavy: 8px 8px 20px rgba(0, 0, 0, 0.6), -2px -2px 8px rgba(255, 255, 255, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    overflow: hidden; /* Lock body */
    height: 100dvh; /* Mobile viewport height fix */
}

/* Base App Structure */
.mobile-app {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Scroll Utilities (Hidden scrollbars for clean mobile UI) */
.scroll-y { overflow-y: auto; overflow-x: hidden; }
.scroll-x { overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.scroll-y::-webkit-scrollbar, .scroll-x::-webkit-scrollbar { display: none; }
.scroll-y, .scroll-x { -ms-overflow-style: none; scrollbar-width: none; }

.main-content {
    flex: 1;
    padding-bottom: 20px;
}

.bottom-spacer {
    height: 160px; /* Space for mini-player and bottom nav */
}

/* --- HEADER & CHIPS --- */
.app-header {
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to bottom, rgba(30, 215, 96, 0.15) 0%, var(--bg-deep) 100%);
}

.greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.greeting h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.filter-chips {
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
}

.chip {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.02);
}

.chip.active {
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
}

/* --- SECTIONS & CARDS --- */
.content-section {
    padding: 24px 0 0 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Horizontal Scrolling Cards */
.horizontal-scroll {
    display: flex;
    gap: 16px;
    padding-right: 20px;
}

.square-card {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-art {
    width: 140px;
    height: 140px;
    background: #2a2d36;
    border-radius: 12px;
}

.shadow-heavy {
    box-shadow: var(--shadow-heavy);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Vertical Lists */
.vertical-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 20px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.list-art {
    width: 65px;
    height: 65px;
    background: #2a2d36;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.list-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- GLASSMORPHISM COMPONENTS --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
}

/* Floating Mini Player */
.mini-player {
    position: fixed;
    bottom: 70px; /* Sits right above nav */
    left: 8px;
    right: 8px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}

.progress-bar-mini {
    height: 2px;
    background: var(--text-primary);
    position: absolute;
    top: 0; left: 0;
    border-radius: 2px;
}

.mini-inner {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

.mini-art {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #444;
    box-shadow: var(--shadow-soft);
}

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

.mini-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    font-size: 12px;
    color: var(--accent);
}

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

.mini-controls .icon-btn {
    font-size: 18px;
    color: var(--text-primary);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 90;
    padding-bottom: 5px; /* Safe area adjustment */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 60px;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active i {
    transform: scale(1.1);
}
/* --- DYNAMIC VIEWS (SEARCH & LIBRARY) --- */
.search-header { 
    padding: 40px 20px 20px 20px; 
    background: var(--bg-deep); 
}

.search-title { 
    font-size: 24px; 
    font-weight: 700; 
    margin-bottom: 16px; 
}

.search-input-wrap { 
    position: relative; 
}

.search-input-wrap i { 
    position: absolute; 
    left: 16px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-secondary); 
}

.search-box { 
    width: 100%; 
    background: var(--bg-surface); 
    border: 1px solid var(--glass-border); 
    padding: 14px 14px 14px 44px; 
    border-radius: 8px; 
    color: var(--text-primary); 
    font-family: inherit; 
    font-size: 14px; 
    box-shadow: var(--shadow-soft); 
    outline: none; 
}

.search-box:focus { 
    border-color: var(--accent); 
}

.search-results { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.result-item { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
    padding: 12px; 
    background: var(--bg-surface); 
    border-radius: 8px; 
    box-shadow: var(--shadow-soft); 
    cursor: pointer; 
    transition: background 0.2s; 
}

.result-item:active { 
    background: var(--bg-deep); 
}

.result-thumb { 
    width: 50px; 
    height: 50px; 
    border-radius: 6px; 
    background: #2a2d36; 
    object-fit: cover; 
}

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

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

.result-artist { 
    font-size: 12px; 
    color: var(--text-secondary); 
}

/* Loading Spinner for Search */
.spinner { 
    border: 3px solid rgba(255,255,255,0.1); 
    border-top-color: var(--accent); 
    border-radius: 50%; 
    width: 24px; 
    height: 24px; 
    animation: spin 1s linear infinite; 
    margin: 20px auto; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}
/* --- FULL SCREEN NOW PLAYING PAGE --- */
.full-player-overlay {
    position: fixed;
    top: 100vh; /* Hidden below screen initially */
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(180deg, #1e2128 0%, var(--bg-deep) 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.full-player-overlay.active {
    top: 0;
}

.fp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    margin-bottom: 40px;
}

.fp-header-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.fp-art-container {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 40px;
}

#fp-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: none; /* Hidden until loaded */
}

.fp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.fp-meta {
    flex: 1;
    min-width: 0;
    padding-right: 16px;
}

#fp-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#fp-artist {
    font-size: 16px;
    color: var(--text-secondary);
}

.fp-progress-section {
    margin-bottom: 30px;
}

.fp-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-bottom: 8px;
}

.fp-progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    position: relative;
    transition: width 0.2s linear;
}

.fp-progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.fp-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.fp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.play-btn-huge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px rgba(30, 215, 96, 0.3);
}
/* --- MODALS & UI OVERLAYS --- */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 11, 14, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 340px;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--glass-border);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
}

.btn-primary:active { background: #18ab4c; }

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:active { background: rgba(255,255,255,0.05); }

.modern-input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.modern-input:focus {
    border-color: var(--accent);
}

/* --- HAMBURGER SIDE DRAWER --- */
.drawer-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.side-drawer {
    position: fixed;
    top: 0; right: -300px;
    width: 280px;
    height: 100%;
    background: var(--bg-surface);
    z-index: 1501;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 30px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.drawer-header h2 { font-size: 20px; }

.drawer-links {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-item {
    padding: 16px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.drawer-item i {
    font-size: 18px;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.drawer-item:hover, .drawer-item:active {
    background: rgba(255,255,255,0.05);
}
/* --- Z-INDEX FIXES & OVERLAYS --- */
.drawer-backdrop { z-index: 3000 !important; }
.side-drawer { z-index: 3001 !important; }
.modal-overlay { z-index: 4000 !important; }

.track-opts-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

.empty-state-text {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}
/* --- MEGA UPDATE OVERLAYS & ACTIONS --- */
.fp-action-row { 
    display: flex; 
    justify-content: center; 
    gap: 32px; 
    margin-top: 24px; 
}
.fp-action-row .icon-btn { 
    color: var(--text-secondary); 
    font-size: 18px; 
    transition: color 0.2s;
}
.fp-action-row .icon-btn:active { color: var(--accent); }

.full-overlay-panel { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(10, 11, 14, 0.95); 
    backdrop-filter: blur(15px); 
    z-index: 100; 
    padding: 60px 20px 20px; 
    display: none; 
    flex-direction: column; 
    overflow-y: auto; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
}
.full-overlay-panel.active { 
    display: flex; 
    opacity: 1; 
}

.panel-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 24px; 
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
}
.panel-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }

#lyrics-content { 
    color: var(--text-primary); 
    font-size: 16px; 
    line-height: 2; 
    text-align: center; 
    white-space: pre-wrap; 
    padding-bottom: 40px; 
}
/* --- BEAUTIFUL FULL PLAYER LAYOUT --- */
.full-player-overlay {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 40px; /* Gives breathing room for navigation bars */
}

.fp-art-container {
    flex: 1;
    max-height: 40vh; /* Keeps art from pushing controls off-screen */
    display: flex;
    align-items: center;
    justify-content: center;
}

#fp-art {
    max-height: 100%;
    width: auto;
    border-radius: 12px;
}

.fp-actions-grid {
    display: flex;
    justify-content: space-between;
    padding: 10px 40px;
}

.fp-actions-grid .icon-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 16px;
    color: var(--text-secondary);
}

.fp-progress-section {
    margin-top: auto;
    margin-bottom: 10px;
}

.fp-controls {
    margin-bottom: 20px;
}
/* --- TIGHTENED FULL PLAYER LAYOUT --- */
.full-player-overlay {
    padding: 10px 20px 20px 20px !important;
    justify-content: space-between;
}

.fp-art-container {
    max-height: 35vh; /* Prevents overflow */
    margin: 10px 0;
}

#fp-art {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.fp-info-row {
    margin-bottom: 5px;
}

/* 30% Smaller Lyrics/Queue row */
.fp-actions-grid {
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    transform: scale(0.7); /* Reduces size by 30% */
    transform-origin: center;
    margin: -10px 0;
}

.fp-progress-section {
    margin-top: 10px;
}

.fp-controls {
    margin-bottom: 10px;
}
/* --- SPOTIFY-STYLE TIGHT LAYOUT --- */
.full-player-overlay {
    display: flex;
    flex-direction: column;
    padding: 10px 20px 30px 20px !important; /* Extra bottom padding for nav */
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden; /* No scrolling */
}

.fp-art-container {
    flex: 0 1 auto; 
    max-height: 35vh; /* ART SHRINKS TO FIT */
    margin: 10px auto;
    display: flex;
    justify-content: center;
}

#fp-art {
    max-height: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.fp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

/* Lyrics/Queue buttons 30% smaller */
.fp-actions-grid {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: scale(0.7);
    transform-origin: center;
    margin: -10px 0;
}

.fp-progress-section {
    margin: 10px 0;
}

.fp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
}
/* --- PREMIUM LIQUID LAYOUT --- */
.full-player-overlay {
    position: fixed;
    top: 100vh; left: 0; width: 100%; height: 100%;
    background: var(--bg-deep); /* Base dark background */
    padding: 10px 20px 20px 20px !important;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Liquid Ambient Background */
.ambient-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    filter: blur(60px) saturate(200%);
    opacity: 0.3;
    pointer-events: none;
    background-size: cover;
    background-position: center;
}

.fp-art-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    min-height: 0; /* Critical for preventing overflow */
}

#fp-art {
    width: 100%;
    max-width: 350px;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.fp-info-row {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.fp-actions-grid {
    display: flex;
    justify-content: space-around;
    padding: 5px 20px;
    margin-bottom: 5px;
}

.fp-progress-section {
    margin: 5px 0;
}

.fp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 10px;
}
