:root {
    --bg-color: #0f0f13;
    --surface-color: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #8c52ff; /* Vibrant purple */
    --accent-gradient: linear-gradient(135deg, #8c52ff, #5ce1e6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* Prevent native scroll, handle inside app container */
}

.app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* For mobile browsers */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

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

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    z-index: 10;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
}

.highlight {
    color: var(--accent-color);
}

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

.profile-pic-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    padding-bottom: 120px; /* Space for mini player + nav */
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
}

#searchInput {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    width: 100%;
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

/* Horizontal Scroll Sections */
.home-section {
    margin-bottom: 30px;
}

.home-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.horizontal-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 10px;
}
.horizontal-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.card {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.card img {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card.square img {
    border-radius: 8px;
}

.card h4 {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card p {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Skeleton Loading */
.skeleton-card {
    min-width: 140px;
    height: 140px;
    border-radius: 12px;
    background: linear-gradient(90deg, #1e1e24 25%, #2a2a35 50%, #1e1e24 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom); /* For iPhone notch */
    z-index: 100;
}

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

.nav-item span:last-child {
    font-size: 11px;
    font-weight: 500;
}

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

/* Mini Player */
.mini-player {
    position: absolute;
    bottom: 80px; /* Above bottom nav */
    left: 10px;
    width: calc(100% - 20px);
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 90;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mini-player.hidden {
    transform: translateY(150px);
}

#mini-art {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
}

.mini-info {
    flex: 1;
    overflow: hidden;
}

.mini-info h4 {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-info p {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Full Player Modal */
.full-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-top: env(safe-area-inset-top);
}

#close-player {
    cursor: pointer;
    font-size: 32px;
}

.album-art-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

#full-art {
    width: 90%;
    max-width: 320px;
    aspect-ratio: 1;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    object-fit: cover;
}

.song-info {
    margin-bottom: 25px;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#full-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.favorite-btn {
    color: var(--text-secondary);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.progress-container span {
    font-size: 12px;
    color: var(--text-secondary);
}

#progress-bar {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: var(--surface-color);
    border-radius: 2px;
    outline: none;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

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

.control-btn {
    font-size: 36px;
    cursor: pointer;
}

.control-btn.small {
    font-size: 24px;
    color: var(--text-secondary);
}

.play-pause-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(140, 82, 255, 0.4);
}

.play-btn {
    font-size: 40px;
    color: #fff;
}
/* Premium Menu */
.player-menu {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    border: 1px solid var(--glass-border);
}

.player-menu .menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.player-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-menu .menu-item .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-secondary);
}

/* My Vibe Offline List */
.offline-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--surface-color);
    border-radius: 12px;
    cursor: pointer;
}
.offline-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}
.offline-item-info {
    flex: 1;
}
.offline-item-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}
.offline-item-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.offline-badge {
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}
/* Search Suggestions */
.suggestion-item {
    padding: 12px 20px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}
.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.suggestion-item .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-secondary);
}

/* List View (Vertical) */
.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.list-item:hover {
    background: rgba(255,255,255,0.1);
}
.list-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}
.list-item-info {
    flex: 1;
}
.list-item-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}
.list-item-info p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 3-Dot Menu Fix */
.player-menu.hidden {
    display: none !important;
}

/* SPA View Pages */
.view-page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.view-page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Advanced Home Sections */
.home-section {
    margin-bottom: 25px;
}
.home-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding: 0 5px;
}

/* Search Header */
.search-header {
    margin-bottom: 20px;
}
.search-header h1 {
    font-size: 28px;
    font-weight: 700;
}

/* Clickable Logo */
.logo-text {
    cursor: pointer;
}
/* Premium Visualizer */
.visualizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 30px;
    margin: 10px 0 20px 0;
}
.visualizer.hidden {
    display: none !important;
}
.visualizer .bar {
    width: 6px;
    background: var(--accent-color);
    border-radius: 3px;
    animation: eq 1s ease-in-out infinite alternate;
}
.visualizer .bar:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.visualizer .bar:nth-child(2) { height: 20px; animation-delay: 0.3s; }
.visualizer .bar:nth-child(3) { height: 30px; animation-delay: 0.5s; }
.visualizer .bar:nth-child(4) { height: 15px; animation-delay: 0.2s; }
.visualizer .bar:nth-child(5) { height: 25px; animation-delay: 0.4s; }

@keyframes eq {
    0% { height: 5px; }
    100% { height: 30px; }
}

/* Modals (Lyrics & Timer) */
.lyrics-modal {
    position: absolute;
    top: 60px;
    left: 20px;
    right: 20px;
    bottom: 200px;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: opacity 0.3s;
}
.lyrics-modal.hidden {
    display: none !important;
}
.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lyrics-header h3 {
    margin: 0;
    font-size: 18px;
}
.lyrics-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.timer-options {
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.timer-btn {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
}
.timer-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Color Thief Background */
.full-player {
    transition: background 1s ease-in-out;
}
