/* Vibeats Premium Styling System */
:root {
    --bg-base: #060f1c;
    --bg-surface: #0a1526;
    --bg-surface-hover: #12223a;
    --bg-elevated: #162a45;
    --bg-glass: rgba(8, 21, 38, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    --primary-color: #00d2ff;
    --primary-hover: #3a86ff;
    --primary-glow: rgba(207, 234, 253, 0.35);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0ab;
    --text-muted: #6b6b76;
    
    --sidebar-width: 240px;
    --player-height: 120px;
    --panel-right-width: 320px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    padding-bottom: var(--player-height);
    background: radial-gradient(circle at 50% 0%, rgba(207, 234, 253, 0.05) 0%, rgba(6, 15, 28, 0) 70%);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    z-index: 10;
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.icon-brand {
    color: white;
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #ffffff, #d4d4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(255, 59, 48, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.15);
}

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

.badge {
    margin-left: auto;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.warp-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.status-dot.online {
    background-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}
.status-dot.offline {
    background-color: #f44336; /* Rojo para indicar que no hay conexión, aunque el usuario dijo verde y verde, asumo que rojo es mejor para offline */
    box-shadow: 0 0 8px #f44336;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bg-base);
    position: relative;
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(20px);
    z-index: 5;
}

.search-bar-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

#searchInput {
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 16px 12px 48px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: var(--transition-fast);
}

#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
    background-color: var(--bg-surface-hover);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Tabs Content Container */
.tab-content {
    padding: 40px;
    flex-grow: 1;
    animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.15) 0%, rgba(20, 20, 25, 0.5) 100%);
    border: 1px solid rgba(255, 59, 48, 0.15);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
}

/* Generic Section Styles */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.section-container {
    margin-bottom: 40px;
}

/* Horizontal carousel row */
.carousel-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    scrollbar-width: none;
}
.carousel-row::-webkit-scrollbar { display: none; }

/* Each card in the carousel */
.carousel-card {
    flex: 0 0 calc(50% - 8px); /* 2 cards visible on mobile */
    max-width: 220px;
    scroll-snap-align: start;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    min-width: 140px;
}

.carousel-card:hover {
    transform: translateY(-4px) scale(1.02);
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.carousel-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.carousel-card .card-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.carousel-card .card-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playlist badge overlay */
.carousel-card .playlist-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    text-transform: uppercase;
}

/* Play overlay on hover */
.carousel-card .play-overlay {
    position: absolute;
    bottom: 52px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.carousel-card:hover .play-overlay {
    opacity: 1;
    transform: translateY(0);
}
.carousel-card .play-overlay svg {
    color: white;
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* Keep old grid for backward compat (used nowhere now but safe) */
.recommended-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    scrollbar-width: none;
}
.recommended-grid::-webkit-scrollbar { display: none; }

/* Old .song-card kept for search-result card if any */
.song-card {
    flex: 0 0 calc(50% - 8px);
    max-width: 220px;
    min-width: 140px;
    scroll-snap-align: start;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.song-card:hover {
    transform: translateY(-6px);
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.song-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.song-card .song-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.song-card .song-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* On desktop show 3-4 cards wide */
@media (min-width: 860px) {
    .carousel-card { flex: 0 0 180px; }
    .song-card     { flex: 0 0 180px; }
}

/* Home loader */
.home-loader-wrapper {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

/* Search results list styling */
.search-results-container {
    display: flex;
    flex-direction: column;
}

.search-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* Song List Item Row Style */
.song-item-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 16px;
    position: relative;
}

.song-item-row:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
}

.btn-download-song {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-download-song:hover {
    color: var(--primary-color);
    background: rgba(255,255,255,0.05);
}
.btn-download-song.downloaded {
    color: var(--primary-color);
}

.library-export-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    transition: background 0.2s;
}
.library-export-btn:hover {
    background: var(--border-color-hover);
}
.library-export-btn i {
    width: 14px;
    height: 14px;
}

.song-item-row img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.song-item-info {
    flex-grow: 1;
    min-width: 0; /* allows text truncation */
}

.song-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

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

.btn-clear-queue {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-clear-queue:hover {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.queue-list, .panel-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Panel Right (Collapsible lyrics / queue panel) */
.panel-right {
    width: var(--panel-right-width);
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    transition: transform var(--transition-normal);
    z-index: 8;
}

.panel-right.collapsed {
    transform: translateX(100%);
    position: absolute;
    right: 0;
    height: calc(100vh - var(--player-height));
}

.panel-header {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    gap: 8px;
}

.panel-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.panel-tab.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.close-panel-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.close-panel-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.panel-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
}

.panel-section {
    animation: fadeIn var(--transition-fast);
}

/* Empty State component */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    stroke-width: 1.5px;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.5;
}

/* Loader animation */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Player Bar Bottom Controls */
.player-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 900px;
    height: 80px; /* Slightly taller for pill */
    background-color: rgba(20, 20, 25, 0.75);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px; /* Pill shape */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden; /* For progress bar clipping */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* Left side of player: Song metadata */
.track-display {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 240px;
    gap: 16px;
}

.track-display img {
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Make thumbnail round for pill aesthetic */
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.track-details {
    min-width: 0; /* lets text marquee/truncate work */
    margin-right: 8px;
}

.track-details h4 {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-primary); /* Changed to primary for better visibility */
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon i {
    width: 20px;
    height: 20px;
}

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

.btn-like.liked i {
    fill: var(--primary-color);
}

/* Center of player: Playback controls */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 40%;
}

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

.btn-play-pause {
    background-color: var(--text-primary);
    color: var(--bg-base);
    width: 42px;
    height: 42px;
}

.btn-play-pause:hover {
    background-color: #ffffff;
    color: var(--bg-base);
    transform: scale(1.05);
}

.btn-play-pause i {
    width: 22px;
    height: 22px;
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    gap: 4px;
}

/* Right of player: Extra utils */
.utility-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    min-width: 240px;
    gap: 8px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.volume-slider-wrapper {
    width: 80px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-bar {
    height: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
}

.volume-handle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-primary);
    position: absolute;
    top: -3px;
    margin-left: -5px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.volume-slider-wrapper:hover .volume-handle {
    opacity: 1;
}

.volume-slider-wrapper:hover .volume-bar {
    background-color: var(--primary-color);
}

.volume-slider-wrapper:hover .volume-handle {
    background-color: var(--primary-color);
}

/* Seek / Progress Bar (Floating above bottom bar) */
.progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px; /* Slightly thicker */
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    z-index: 10;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    position: relative;
    box-shadow: 0 0 10px var(--primary-color);
}

.progress-bar-container:hover {
    height: 6px;
    top: -6px;
}

.progress-bar-hover-zone {
    position: absolute;
    top: -10px;
    height: 25px;
    width: 100%;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--text-secondary);
    position: absolute;
    top: 0;
    left: 0;
    transition: background-color var(--transition-fast);
}

.progress-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    opacity: 0;
    box-shadow: 0 0 6px var(--primary-glow);
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.progress-bar-container:hover .progress-bar {
    background-color: var(--primary-color);
}

.progress-bar-container:hover .progress-handle {
    opacity: 1;
}

/* Active buttons in utilities */
.utility-controls .btn-icon.active {
    color: var(--primary-color);
    background-color: rgba(255, 59, 48, 0.1);
}

/* Letras Panel Styles */
.lyrics-body {
    padding: 20px 0;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 500;
}

.panel-lyrics-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 500;
}

.lyric-line {
    margin-bottom: 12px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.lyric-line:hover {
    color: var(--text-primary);
}

.lyric-line.active {
    color: var(--primary-color);
    font-weight: 700;
    transform: scale(1.02);
}

/* Hide tab content utility classes */
.tab-content[style*="display: none"] {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 100;
        background: var(--bg-surface);
        align-items: center;
    }
    
    .logo-container, .sidebar-footer {
        display: none;
    }
    
    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        gap: 0;
    }
    
    .nav-item {
        flex-direction: column;
        width: 25%;
        border-radius: 0;
        padding: 8px 0;
        gap: 4px;
    }

    .nav-item i {
        margin: 0;
    }

    .nav-item span {
        display: block !important;
        font-size: 0.65rem;
    }
    
    .nav-item .badge {
        position: absolute;
        top: 2px;
        right: 20px;
        margin-left: 0;
        padding: 1px 4px;
        font-size: 0.65rem;
    }
    
    .app-wrapper {
        --sidebar-width: 0px;
        padding-bottom: calc(var(--player-height) + 60px);
    }
    
    .player-bar {
        bottom: 60px;
    }
    
    .top-nav {
        padding: 16px 20px;
    }
    
    .tab-content {
        padding: 24px 20px;
    }
    
    .panel-right {
        display: none !important; /* hide side panel on mobile/tablet */
    }
}

/* ═══════════════════════════════════════════════════
   FULLSCREEN PLAYER (estilo monochrome.tf)
═══════════════════════════════════════════════════ */
.fp-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.fp-overlay.open {
    transform: translateY(0);
    pointer-events: all;
}

/* Blurred album-art background */
.fp-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-base);
    z-index: 0;
    transition: background-image 0.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

.fp-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.65);
    backdrop-filter: blur(60px) saturate(1.5);
    -webkit-backdrop-filter: blur(60px) saturate(1.5);
}

/* Close chevron */
.fp-close-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    transform: none;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fp-close-btn:hover { 
    color: var(--text-primary); 
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Two-column container */
.fp-container {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 100px;
    flex: 1;
    padding: 64px 60px 80px;
    overflow: hidden;
}

/* LEFT column */
.fp-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 380px;
    flex-shrink: 0;
}

/* Album art - Spinning Record */
.fp-art-container {
    position: relative;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    overflow: hidden;
}

.fp-art-container::after {
    /* The vinyl hole/label effect */
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: #111;
    border-radius: 50%;
    border: 4px solid #222;
    z-index: 2;
    box-shadow: 0 0 10px rgba(0,0,0,0.5) inset;
}

.fp-art {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: spin-record 20s linear infinite;
    animation-play-state: paused; /* Will be toggled by JS */
}

@keyframes spin-record {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fp-art.playing {
    animation-play-state: running;
}

/* Track info row */
.fp-track-meta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.fp-song-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.fp-song-artist {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.fp-like-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}
.fp-like-btn:hover { color: var(--primary-color); transform: scale(1.15); }
.fp-like-btn.liked { color: var(--primary-color); }
.fp-like-btn.liked svg { fill: var(--primary-color); }

/* Progress area */
.fp-progress-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fp-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}
.fp-progress-bar-container:hover { height: 6px; }

.fp-progress-bar {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: background 0.2s;
}

.fp-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 8px rgba(255,59,48,0.5);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.fp-progress-bar-container:hover .fp-progress-handle { opacity: 1; }

.fp-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Controls */
.fp-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.fp-ctrl-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s, transform 0.15s;
}
.fp-ctrl-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.fp-play-btn {
    width: 64px;
    height: 64px;
    background: white !important;
    color: var(--bg-base) !important;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(255,59,48,0.3);
}
.fp-play-btn:hover { transform: scale(1.06) !important; box-shadow: 0 6px 28px rgba(255,59,48,0.45) !important; }

/* RIGHT column — Lyrics */
.fp-right {
    flex: 1;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fp-lyrics-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fp-lyrics-source {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    opacity: 0.6;
}

.fp-lyrics-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 88%, transparent 100%);
    padding: 16px 0;
}

.fp-lyrics-scroll::-webkit-scrollbar { width: 4px; }
.fp-lyrics-scroll::-webkit-scrollbar-track { background: transparent; }
.fp-lyrics-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.fp-lyric-line {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.18);
    margin-bottom: 18px;
    line-height: 1.4;
    transition: color 0.3s, font-size 0.2s, transform 0.15s;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.fp-lyric-line:hover {
    color: rgba(255,255,255,0.55);
    transform: scale(1.02);
}

.fp-lyric-line.active {
    color: var(--text-primary);
    font-size: 1.65rem;
}

.fp-lyric-line.active:hover {
    color: var(--text-primary);
}

.fp-lyric-line.near-active {
    color: rgba(255,255,255,0.45);
}

.fp-lyrics-empty {
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
    margin-top: 60px;
}

/* Make album art in mini player clickable */
.track-display img {
    cursor: pointer;
}
.track-display img:hover {
    opacity: 0.85;
}

/* Responsive fullscreen player */
/* Fullscreen Lyrics Mode */
.fp-overlay.lyrics-fullscreen-mode .fp-left {
    display: none;
}
.fp-overlay.lyrics-fullscreen-mode .fp-right {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}
.fp-overlay.lyrics-fullscreen-mode .fp-lyric-line {
    text-align: center;
    font-size: 2rem;
    padding: 12px 24px;
}
.fp-overlay.lyrics-fullscreen-mode .fp-lyric-line.active {
    font-size: 2.3rem;
}
.fp-overlay.lyrics-fullscreen-mode .fp-lyrics-header {
    justify-content: center;
}

@media (max-width: 860px) {
    .fp-container {
        flex-direction: column;
        padding: 40px 20px 100px;
        gap: 24px;
        height: 100dvh;
        overflow-y: auto;
    }
    .fp-left { width: 100%; align-items: center; gap: 16px; }
    .fp-art-container { width: 200px; height: 200px; }
    .fp-track-meta { padding: 12px; }
    .fp-song-title { font-size: 1.3rem; }
    .fp-controls { gap: 16px; }
    .fp-play-btn { width: 54px; height: 54px; }
    
    .fp-right { 
        max-width: 100%; 
        flex: 1; 
        min-height: 0;
        margin-top: 10px;
    }
    .fp-lyric-line { font-size: 1.15rem; }
    .fp-lyric-line.active { font-size: 1.3rem; }
    
    .fp-overlay.lyrics-fullscreen-mode .fp-lyric-line {
        font-size: 1.5rem;
    }
    .fp-overlay.lyrics-fullscreen-mode .fp-lyric-line.active {
        font-size: 1.7rem;
    }
}

/* ─────────────────────────────────────────────
   Splash Screen
   ───────────────────────────────────────────── */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-base);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: splashFloat 2s ease-in-out infinite;
}
.splash-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transform: scale(1.5);
}
.splash-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}
.splash-loader {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}
.splash-loader::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50%;
    background: var(--primary-color);
    animation: splashLoad 1s infinite ease-in-out;
    border-radius: 2px;
}
@keyframes splashLoad {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
@keyframes splashFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ─────────────────────────────────────────────
   Mobile Player Bar (Miniplayer)
   ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .player-bar {
        height: 140px;
        bottom: 80px;
        width: 95%;
        border-radius: 24px;
        padding: 10px 0;
    }
    .player-inner {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 0 16px;
    }
    .track-display {
        width: 100%;
        justify-content: space-between;
    }
    .track-details { flex: 1; }
    .player-controls { width: 100%; color: white; }
    .utility-controls { display: none; }
    .progress-bar-container { top: -6px; }
}

/* ─────────────────────────────────────────────
   Shuffle / Repeat mode buttons
   ───────────────────────────────────────────── */
.btn-mode {
    opacity: 0.45;
    transition: opacity 0.2s, color 0.2s;
}
.btn-mode-active {
    opacity: 1 !important;
    color: var(--primary-color) !important;
}
.btn-mode-one {
    position: relative;
}
.btn-mode-one::after {
    content: '1';
    position: absolute;
    font-size: 9px;
    bottom: 2px;
    right: 2px;
    color: var(--primary-color);
    font-weight: 700;
}

/* ─────────────────────────────────────────────
   Controls row top (shuffle/repeat/queue/add)
   ───────────────────────────────────────────── */
.controls-row-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}
.controls-row-top .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}
.controls-row-top .btn-icon svg,
.controls-row-top .btn-icon i {
    width: 14px;
    height: 14px;
}

/* ─────────────────────────────────────────────
   Fullscreen: fp-actions-row + fp-main-controls
   ───────────────────────────────────────────── */
.fp-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}
.fp-actions-row .fp-ctrl-btn {
    opacity: 0.55;
    font-size: 0;
}
.fp-actions-row .fp-ctrl-btn:hover { opacity: 1; }
.fp-actions-row .fp-ctrl-btn.fp-mode-btn.btn-mode-active { color: var(--primary-color); opacity: 1; }

.fp-main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.fp-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─────────────────────────────────────────────
   Playlists Tab
   ───────────────────────────────────────────── */
.playlists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.btn-create-playlist {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-create-playlist:hover { opacity: 0.85; }
.btn-create-playlist svg, .btn-create-playlist i {
    width: 16px; height: 16px;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}
.playlist-card {
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.2s, background 0.2s;
    padding-bottom: 14px;
}
.playlist-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.08);
}
.playlist-card-art {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.liked-gradient {
    background: linear-gradient(135deg, #ff4757 0%, #c0392b 100%);
}
.user-playlist-art {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a86ff 100%);
}
.playlist-card-art i, .playlist-card-art svg {
    width: 48px; height: 48px; color: rgba(255,255,255,0.9);
}
.playlist-card-info {
    padding: 12px 14px 0;
}
.playlist-card-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-card-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Playlist detail header */
.playlist-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.playlist-detail-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────
   Ajustes / Settings Modal
   ───────────────────────────────────────────── */
.settings-body {
    padding-top: 10px;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.setting-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.setting-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.setting-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}
.setting-select {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.setting-btn-danger {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.setting-btn-danger:hover {
    background: rgba(255, 71, 87, 0.2);
}

/* ─────────────────────────────────────────────
   Portadas Dinámicas
   ───────────────────────────────────────────── */
.playlist-card-art.dynamic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    padding: 0;
}
.playlist-card-art.dynamic-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Si solo hay 1 canción, la imagen ocupa todo el contenedor usando solo object-fit (handled in JS) */
/* Si hay 2 canciones, grid 2x1 o 1x2 */
.playlist-card-art.dynamic-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}
.playlist-card-art.dynamic-grid.grid-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.playlist-card-art.dynamic-grid.grid-3 img:first-child {
    grid-row: span 2; /* La primera imagen ocupa la mitad izquierda entera */
}
