/* CSS Variables */
:root {
    --bg-primary: #121212;
    --bg-secondary: #000000;
    --bg-elevated: #181818;
    --bg-highlight: #282828;
    --bg-press: #000000;

    --primary: #1DB954;
    --primary-hover: #1ed760;
    --text-primary: #FFFFFF;
    --text-secondary: #b3b3b3;
    --text-muted: #a7a7a7;
    --border: rgba(255, 255, 255, 0.1);

    --error: #e91429;
    --warning: #ffa42b;
    --sidebar-width: 240px;
    --player-height: 90px;
    --header-height: 64px;

    /* Smoother transitions */
    --transition-fast: 0.1s ease;
    --transition: 0.2s cubic-bezier(0.3, 0, 0.4, 1);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    --radius: 4px;
    --radius-lg: 8px;
    --radius-pill: 500px;
    --blur: 40px;
}

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

/* Base */
html,
body {
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

body {
    font-family: 'CircularSp', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

input[type="text"],
input[type="search"] {
    background: var(--bg-highlight);
    /* Lighter than body */
    border: 0;
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    padding: 12px 20px;
    /* More padding */
    border-radius: 500px;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="search"]:focus {
    background: #333;
    /* Even lighter on focus */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    /* Focus ring */
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    /* Rounded pill shape */
    border: 2px solid transparent;
    /* Gap around thumb */
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Helper Class for "Button Pressure" effect */
.btn-press:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* App Layout */
#app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-row: 1 / 3;
    background: rgba(0, 0, 0, 0.3);
    /* Dark transparent */
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

/* Sidebar */
.sidebar {
    grid-row: 1 / 3;
    background-color: #000000;
    padding: 24px 12px;
    /* Spotify has less horizontal padding but consistent vertical */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: var(--sidebar-width);
    z-index: 10;
}

.sidebar-header {
    padding: 0 12px 24px;
}

.sidebar-close {
    display: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 4px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.sidebar-logo span {
    font-size: 20px;
    /* Slightly smaller, more refined */
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* More breathing room between main items */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    /* Optimized padding */
    border-radius: 4px;
    /* Less rounded, more Spotify-like */
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: none;
    /* Spotify doesn't have bg on hover for nav items, just text color change */
}

.nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-highlight);
    /* Subtle background for active state */
}

.nav-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    /* Inherit color change */
}

/* Specific styling for Liked Songs to match "Your Library" vibe */
.liked-songs-link {
    margin-top: 24px;
    opacity: 0.8;
}

.liked-songs-link:hover {
    opacity: 1;
}

.liked-songs-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #450af5, #c4efd9);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.liked-songs-icon svg {
    width: 12px;
    /* Smaller icon inside the box */
    height: 12px;
    fill: white;
}

.sidebar-divider {
    height: 1px;
    background: var(--bg-highlight);
    margin: 16px 12px;
    /* Separator line */
    opacity: 0.5;
}

.sidebar-section {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* For scrolling playlists */
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sidebar-playlists {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    /* Scrollable playlists */
    flex: 1;
    margin-right: -10px;
    /* Hide scrollbar visually but keep function */
    padding-right: 10px;
}

/* Custom scrollbar for playlists */
.sidebar-playlists::-webkit-scrollbar {
    width: 8px;
}

.sidebar-playlists::-webkit-scrollbar-thumb {
    background: transparent;
    /* Hidden by default */
}

.sidebar-playlists:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    /* Visible on hover */
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition-fast);
    cursor: default;
    /* Spotify playlists are links but feel like list items */
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: none;
}

/* Main Content Area */
/* Main Content Area */
.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
    /* Base background */
    position: relative;
    /* Create a gradient overlay for the "top of playlist" feel */
    background: linear-gradient(180deg, #2a2a2a 0%, var(--bg-primary) 400px);
}

.header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    background: rgba(0, 0, 0, 0);
    /* Start transparent */
    transition: background-color var(--transition-smooth);
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-height);
}

/* Header becomes solid on scroll (handled by JS usually, but setting base here) */
.header.scrolled {
    background-color: #070707;
}

.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

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

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: var(--transition-fast);
    cursor: pointer;
}

.nav-btn:hover {
    transform: scale(1.04);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 32px;
    /* Adjusted top padding */
    isolation: isolate;
    /* Create new stacking context */
}

/* Section Styles */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.section-title:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Song/Card Grid Shared Styles */
.song-grid,
.artist-grid,
.album-grid,
.playlists-grid,
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* Optimizing for slightly wider cards */
    gap: 24px;
}

/* Base Card Style */
.song-card,
.artist-card,
.album-card,
.playlist-card {
    background-color: #181818;
    padding: 16px;
    border-radius: 6px;
    /* Slightly tighter radius than before */
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    isolation: isolate;
}

.song-card:hover,
.artist-card:hover,
.album-card:hover,
.playlist-card:hover {
    background-color: #282828;
}

/* Card Images */
.song-card-image,
.artist-card-image,
.album-card-image,
.playlist-card-image {
    position: relative;
    margin-bottom: 16px;
    border-radius: 4px;
    /* Tighter radius for images */
    overflow: hidden;
    aspect-ratio: 1;
    background-color: #333;
    /* Placeholder color */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.artist-card-image {
    border-radius: 50%;
    /* Circle for artists */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.song-card-image img,
.artist-card-image img,
.album-card-image img,
.playlist-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Play Button Overlay (The iconic Green Button) */
.play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.play-overlay svg {
    width: 24px;
    height: 24px;
    fill: #000;
    /* Black icon on green */
    margin-left: 2px;
    /* Visual center adjustment */
}

/* Hover Effects logic */
.song-card:hover .play-overlay,
.album-card:hover .play-overlay,
.playlist-card:hover .play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.play-overlay:hover {
    transform: scale(1.05) translateY(0);
    background-color: var(--primary-hover);
}

/* Card Text */
.song-card-title,
.album-card-title,
.artist-card-name,
.playlist-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card-artist,
.album-card-artist,
.artist-card-type,
.album-card-year {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Multiline truncation for artist names */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-weight: 400;
}

.song-card-artist:hover,
.album-card-artist:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* Download Button (Specific to this app, keep it subtle) */
.download-song-card {
    position: absolute;
    top: 8px;
    /* Move to top left to avoid conflict with play button */
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.song-card:hover .download-song-card {
    opacity: 1;
}

.download-song-card:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Placeholder Cover */
.placeholder-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #282828;
}

.placeholder-cover svg {
    width: 48px;
    height: 48px;
    fill: #7f7f7f;
}

.placeholder-cover.lg svg {
    width: 80px;
    height: 80px;
}

/* Song Table */
.song-table {
    display: flex;
    flex-direction: column;
}

.song-table-header {
    display: grid;
    grid-template-columns: 50px 1fr 200px 100px;
    gap: 16px;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.song-table-header svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.song-row {
    display: grid;
    grid-template-columns: 50px 1fr 200px 100px 50px;
    gap: 16px;
    padding: 8px 16px;
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.song-row:hover {
    background: var(--bg-elevated);
}

.song-row-index {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.song-row:hover .index-number {
    display: none;
}

.index-play {
    display: none;
}

.song-row:hover .index-play {
    display: block;
}

.index-play svg {
    width: 18px;
    height: 18px;
    fill: var(--text-primary);
}

.song-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.song-row-main img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-row-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.song-row-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-artist {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-artist:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

.song-row-album {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-album:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

.song-row-duration {
    font-size: 14px;
    color: var(--text-secondary);
}

.song-row-actions {
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.song-row:hover .song-row-actions {
    opacity: 1;
}

/* Page Headers */
.artist-header,
.album-header,
.playlist-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 40px 0;
    min-height: 280px;
}

.artist-header {
    background-size: cover;
    background-position: center;
    margin: -32px -32px 0;
    padding: 100px 32px 24px;
}

.artist-image,
.album-cover,
.playlist-cover {
    width: 232px;
    height: 232px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.artist-image {
    border-radius: 50%;
}

.artist-info,
.album-info,
.playlist-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.artist-name,
.album-title,
.playlist-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
}

.album-meta,
.playlist-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}

.album-artist {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.album-artist:hover {
    text-decoration: underline;
}

.dot {
    margin: 0 4px;
}

/* Action Buttons */
.artist-actions,
.album-actions,
.playlist-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
}

.btn-play-large {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.btn-play-large svg {
    width: 28px;
    height: 28px;
    fill: var(--bg-primary);
    margin-left: 3px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 500px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 24px;
    border: 1px solid var(--text-secondary);
    border-radius: 500px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
}

/* Search Page */
.search-page {
    padding-top: 16px;
}

.search-header {
    margin-bottom: 32px;
}

.search-input-container {
    position: relative;
    max-width: 400px;
}

.search-input-container input {
    padding-left: 52px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 14px 48px;
    background: var(--bg-elevated);
    border-radius: 500px;
    font-size: 14px;
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
}

.clear-search.visible {
    opacity: 1;
}

.clear-search svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
}

/* Genre Cards */
.browse-content h2 {
    margin-bottom: 20px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.genre-card {
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: var(--transition);
}

.genre-card:hover {
    transform: scale(1.02);
}

/* Song List (Search Results) */
.song-list {
    display: flex;
    flex-direction: column;
}

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

.song-list-item:hover {
    background: var(--bg-elevated);
}

.song-index {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
}

.song-list-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.song-list-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-list-artist {
    font-size: 14px;
    color: var(--text-secondary);
}

.song-list-play {
    opacity: 0;
    transition: var(--transition);
}

.song-list-item:hover .song-list-play {
    opacity: 1;
}

.song-list-play svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

/* Top Result Card */
.top-result-card {
    position: relative;
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    max-width: 400px;
}

.top-result-card:hover {
    background: var(--bg-highlight);
}

.top-result-card img {
    width: 92px;
    height: 92px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.top-result-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.top-result-card p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-type {
    display: inline-block;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 500px;
    font-size: 12px;
    text-transform: uppercase;
}

.btn-play-large.top-result-card .play-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

/* Library Page */
.library-page {
    padding-top: 16px;
}

.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.library-header h1 {
    font-size: 32px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Loading */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 60px auto;
}

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

/* Skeleton Loading */
.skeleton {
    pointer-events: none;
}

.skeleton-image {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-highlight) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-highlight) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Error State */
.error-message,
.error-page {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.error-icon {
    width: 48px;
    height: 48px;
    fill: var(--text-muted);
    margin: 0 auto 16px;
}

.retry-btn {
    margin-top: 16px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin: 0 auto 16px;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
}

.modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal h2 {
    margin-bottom: 20px;
}

.modal input[type="text"] {
    width: 100%;
    margin-bottom: 20px;
}

.modal .btns {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.song-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.song-preview img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
}

.btn-create-new,
.full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.pl-list {
    max-height: 200px;
    overflow-y: auto;
}

.pl-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pl-opt:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.close-modal svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: calc(var(--player-height) + 24px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

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

.notification.error {
    background: var(--error);
    color: white;
}

.notification.warning {
    background: var(--warning);
    color: var(--bg-primary);
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--error);
    color: white;
    padding: 8px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1002;
}

.offline-banner svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
}

.verified-badge svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

/* Scroll Horizontal */
.scroll-horizontal {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
}

.scroll-horizontal::-webkit-scrollbar {
    display: none;
}

.scroll-horizontal .album-card {
    min-width: 180px;
    flex-shrink: 0;
}

/* ========== NEW FEATURES STYLES ========== */

/* Player Extras (Queue, Share buttons) */
.player-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Quality Selector */
.quality-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.quality-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 140px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.quality-selector.open .quality-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: var(--transition);
}

.quality-option:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.quality-option.active {
    color: var(--primary);
    background: rgba(29, 185, 84, 0.1);
}

.quality-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-muted);
}

.quality-option:hover .quality-badge {
    background: var(--bg-primary);
}

.quality-badge.low {
    color: var(--warning);
}

/* Like Button */
.like-btn {
    margin-left: 12px;
}

.like-btn.active {
    color: var(--primary);
}

.like-btn.active svg {
    fill: var(--primary);
}

/* Queue Button Active */
#queue-btn.active {
    color: var(--primary);
}

/* Queue Panel */
.queue-panel {
    position: fixed;
    right: -380px;
    top: 0;
    bottom: var(--player-height);
    width: 380px;
    background: var(--bg-secondary);
    z-index: 90;
    /* Lower than sidebar (100) to prevent overlap conflicts */
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.queue-panel.open {
    right: 0;
}

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

.queue-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.queue-section {
    padding: 16px 20px;
}

.queue-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Queue Panel Container */
.queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: var(--bg-elevated);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.queue-panel.open {
    transform: translateX(0);
}

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

.queue-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.close-queue {
    color: var(--text-secondary);
}

.close-queue:hover {
    color: var(--text-primary);
}

.queue-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Important for nested scroll */
}

.queue-section h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

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

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

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

.queue-item.current {
    background: var(--bg-elevated);
}

.queue-index {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.queue-item img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
}

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

.queue-item-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .remove-queue {
    opacity: 0;
    transition: opacity 0.2s;
}

.queue-item:hover .remove-queue {
    opacity: 1;
}

.empty-queue {
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
}

.clear-queue {
    margin: 16px 20px;
}

/* Favorites Page */
.favorites-page {
    padding-top: 0;
}

.favorites-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 60px 0 24px;
    background: linear-gradient(transparent 0, rgba(80, 56, 160, 0.5) 100%);
    margin: -32px -32px 0;
    padding-left: 32px;
    padding-right: 32px;
    min-height: 300px;
}

.favorites-icon {
    width: 232px;
    height: 232px;
    background: linear-gradient(135deg, #450af5, #8e8ee5);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
}

.favorites-icon svg {
    width: 92px;
    height: 92px;
    fill: white;
}

.favorites-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.favorites-info span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.favorites-info h1 {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
}

.favorites-info p {
    color: var(--text-secondary);
}

.favorites-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
}

.remove-favorite {
    color: var(--primary) !important;
}

/* Improved Notifications */
.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.notification.success {
    border-left-color: var(--primary);
}

.notification.error {
    background: var(--bg-elevated);
    border-left-color: var(--error);
    color: var(--text-primary);
}

.notification.warning {
    background: var(--bg-elevated);
    border-left-color: var(--warning);
    color: var(--text-primary);
}

.notification-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--text-muted);
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--text-primary);
}

.notification-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Seek Feedback Overlay */
.seek-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.seek-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.seek-feedback svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Liked Songs Link in Sidebar */
.liked-songs-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
    margin: 0 0 8px;
}

.liked-songs-link:hover {
    color: var(--text-primary);
}

.liked-songs-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #450af5, #8e8ee5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.liked-songs-icon svg {
    width: 14px;
    height: 14px;
    fill: white;
}

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

.btn-shuffle:hover {
    color: var(--primary);
}

/* Audio Quality Selector */
.quality-selector {
    position: relative;
}

#quality-btn {
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-secondary);
}

#quality-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.quality-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.quality-selector.open .quality-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    color: var(--text-secondary);
    transition: var(--transition);
}

.quality-option:hover {
    background: var(--bg-highlight);
    color: var(--text-primary);
}

.quality-option.active {
    color: var(--primary);
}

.quality-option.active::before {
    content: '✓';
    margin-right: 8px;
}

.quality-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.quality-badge.low {
    background: var(--text-muted);
}

/* Section Icon (for Made For You) */
.section-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    vertical-align: middle;
    margin-right: 8px;
}

/* ========== SPOTIFY-STYLE UI ========== */

/* Greeting Header */
.greeting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 24px;
}

.greeting-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.greeting-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.greeting-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Horizontal Scroll Row (Spotify-style) */
.scroll-section {
    margin-bottom: 32px;
}

.scroll-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-right: 16px;
}

.scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

/* Spotify-style Cards */
.spotify-card {
    flex-shrink: 0;
    width: 140px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    scroll-snap-align: start;
}

.spotify-card:hover {
    background: var(--bg-elevated);
}

.spotify-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-elevated);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

.spotify-card-image.artist {
    border-radius: 50%;
}

.spotify-card .play-overlay {
    width: 40px;
    height: 40px;
    bottom: 6px;
    right: 6px;
}

.spotify-card .play-overlay svg {
    width: 20px;
    height: 20px;
}

.spotify-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.spotify-card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Radio badge overlay (Spotify-style) */
.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.card-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--primary);
}

/* Bottom Navigation Bar (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.95) 0%, #121212 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

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

/* Home page layout */
.home-page {
    padding-bottom: 20px;
}

/* ========== FULL-SCREEN NOW PLAYING ========== */

/* ========== FULL-SCREEN NOW PLAYING ========== */

.fullscreen-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    visibility: visible;
    /* Always visible for transform to work, moved off-screen */
    display: flex;
    /* Flexbox for centering */
    align-items: center;
    justify-content: center;
}

.fullscreen-player.open {
    transform: translateY(0);
}

.fullscreen-player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #1e1e1e 0%, #000000 100%);
    z-index: 0;
    transition: background 1s ease;
    /* Smooth color transitions */
}

/* Gradient Mesh Overlay for depth */
.fullscreen-player-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 60%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.fullscreen-player-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    /* Constrain width for desktop readability */
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 32px;
    padding-top: max(32px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* Header */
.fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.fullscreen-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: scale(1.05);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.fullscreen-title {
    text-align: center;
    opacity: 0.8;
}

.fullscreen-title span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
}

/* Album Art - The Hero */
.fullscreen-artwork {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0 48px;
    perspective: 1000px;
}

.fullscreen-artwork img {
    width: 100%;
    max-width: 400px;
    /* Limit size */
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

/* Song Info */
.fullscreen-info {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.fullscreen-song-details {
    flex: 1;
    min-width: 0;
    margin-right: 24px;
}

.fullscreen-song-title {
    font-size: 28px;
    /* Larger title */
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.fullscreen-song-artist {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}

.fullscreen-song-artist:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.fullscreen-song-album {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    cursor: pointer;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen-song-album:hover {
    color: white;
    text-decoration: underline;
}

.fullscreen-like-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.fullscreen-like-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
    background: none;
}

.fullscreen-like-btn.active {
    color: var(--primary);
}

.fullscreen-like-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Progress Bar (Immersive) */
.fullscreen-progress {
    margin-bottom: 32px;
}

.fullscreen-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    /* Hit area */
    padding: 8px 0;
    margin: -8px 0;
    background-clip: content-box;
}

.fullscreen-progress-fill {
    height: 4px;
    background: var(--text-primary);
    border-radius: 2px;
    width: 0%;
    position: absolute;
    top: 8px;
    /* align with padding */
    left: 0;
    pointer-events: none;
}

.fullscreen-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fullscreen-progress-bar:hover .fullscreen-progress-fill {
    background: var(--primary);
}

.fullscreen-progress-bar:hover .fullscreen-progress-fill::after {
    opacity: 1;
}

.fullscreen-time {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.fullscreen-time span {
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Main Controls */
.fullscreen-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
}

.fullscreen-control-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    /* Lighter grey for better visibility on dark bg */
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.fullscreen-control-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.fullscreen-control-btn.active {
    color: var(--primary);
    position: relative;
}

/* Dot indicator for active shuffle/repeat */
.fullscreen-control-btn.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.fullscreen-control-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.fullscreen-control-lg svg {
    width: 32px;
    height: 32px;
}

.fullscreen-play-btn {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fullscreen-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fullscreen-play-btn svg {
    width: 32px;
    height: 32px;
    fill: #000;
    margin-left: 4px;
}

/* Extra Controls (Volume/Device) */
.fullscreen-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align right */
    gap: 16px;
    padding: 0 12px;
}

.fullscreen-volume {
    flex: 1;
    /* Take remaining space */
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 200px;
    margin-left: auto;
}

.fullscreen-volume svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

/* Fullscreen Volume Slider */
.fullscreen-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: transparent;
    cursor: pointer;
    border-radius: 2px;
}

.fullscreen-volume-slider:focus {
    outline: none;
}

/* Chrome/Safari/Edge */
.fullscreen-volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: linear-gradient(to right, #b3b3b3 var(--volume-percent, 50%), #535353 var(--volume-percent, 50%));
    border-radius: 2px;
}

.fullscreen-volume-slider:hover::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #1DB954 var(--volume-percent, 50%), #535353 var(--volume-percent, 50%));
}

.fullscreen-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -4px;
    /* (4px track - 12px thumb) / 2 */
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.fullscreen-volume-slider:hover::-webkit-slider-thumb,
.fullscreen-volume:hover .fullscreen-volume-slider::-webkit-slider-thumb {
    opacity: 1;
}

/* Firefox */
.fullscreen-volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #535353;
    border-radius: 2px;
}

.fullscreen-volume-slider::-moz-range-progress {
    background-color: #b3b3b3;
    height: 4px;
    border-radius: 2px;
}

.fullscreen-volume-slider:hover::-moz-range-progress {
    background-color: #1DB954;
}

.fullscreen-volume-slider::-moz-range-thumb {
    height: 12px;
    width: 12px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.fullscreen-volume-slider:hover::-moz-range-thumb,
.fullscreen-volume:hover .fullscreen-volume-slider::-moz-range-thumb {
    opacity: 1;
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .fullscreen-player-content {
        padding: 24px;
        /* Ensure full height usage */
        justify-content: flex-start;
    }

    .fullscreen-artwork {
        margin: 16px 0 24px;
        max-height: 40vh;
        flex-shrink: 1;
        /* Allow shrinking on small screens */
    }

    .fullscreen-song-title {
        font-size: 24px;
    }

    .fullscreen-controls {
        gap: 20px;
        margin-bottom: 24px;
    }

    .fullscreen-play-btn {
        width: 64px;
        height: 64px;
    }

    /* Volume Section - Enhanced for Mobile */
    .fullscreen-volume {
        display: flex;
        width: 100%;
        max-width: 100%;
        margin-bottom: 32px;
        /* More spacing from bottom */
        padding: 0 16px;
        /* Align with other elements */
        margin-top: auto;
        /* Push to bottom */
        background: rgba(255, 255, 255, 0.05);
        /* Subtle background container */
        border-radius: 12px;
        height: 48px;
        /* Taller touch area */
        align-items: center;
    }

    .fullscreen-volume svg {
        width: 24px;
        height: 24px;
        opacity: 0.8;
    }

    .fullscreen-volume-slider-container {
        flex: 1;
        display: flex;
        align-items: center;
        height: 100%;
        padding: 0 8px;
    }

    .fullscreen-volume-slider {
        height: 6px;
        border-radius: 3px;
        background: rgba(255, 255, 255, 0.2);
    }

    /* Track Fill Simulation (using gradient if supported, otherwise simple bg) */
    .fullscreen-volume-slider::-webkit-slider-runnable-track {
        height: 6px;
        border-radius: 3px;
    }

    .fullscreen-volume-slider::-webkit-slider-thumb {
        width: 20px;
        /* Larger touch target */
        height: 20px;
        margin-top: -7px;
        /* Center on 6px track: (6 - 20) / 2 */
        background: white;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        opacity: 1;
    }

    /* Extras Row (Queue, Share, etc.) */
    .fullscreen-extras {
        display: flex !important;
        /* Force visible */
        width: 100%;
        justify-content: space-between;
        padding: 0 16px;
        gap: 0;
        margin-bottom: 24px;
        /* Space from bottom edge */
        margin-top: 0;
        /* Volume handles the push */
    }

    .fullscreen-quality-label {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-secondary);
        border: 1px solid var(--text-secondary);
        padding: 2px 4px;
        border-radius: 4px;
    }

    /* Mobile Quality Modal */
    .fullscreen-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 200;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        backdrop-filter: blur(4px);
    }

    .fullscreen-modal-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .fullscreen-modal-content {
        background: #1e1e1e;
        border-radius: 16px 16px 0 0;
        padding: 24px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

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

    .fullscreen-modal-content h3 {
        margin-top: 0;
        margin-bottom: 20px;
        text-align: center;
        font-size: 18px;
    }

    .quality-options-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .quality-option-mobile {
        background: #2a2a2a;
        border: 1px solid transparent;
        padding: 16px;
        border-radius: 12px;
        color: white;
        font-size: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .quality-option-mobile.active {
        background: #1DB954;
        color: white;
        font-weight: bold;
    }

    .quality-option-mobile span {
        font-size: 12px;
        opacity: 0.7;
    }

    .modal-close-btn {
        width: 100%;
        padding: 16px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 16px;
        font-weight: 600;
    }

    .fullscreen-extra-btn {
        width: 44px;
        /* Slightly larger tap target */
        height: 44px;
        background: rgba(255, 255, 255, 0.05);
        /* Subtle bg for visibility confirmation */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        border: none;
    }

    .fullscreen-extra-btn svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }
}