/* css/style.css */

/* ===== VARIABLES ===== */
:root {
    --bg-deep: #0a0e27;
    --bg-primary: #131836;
    --bg-secondary: #1a1f3a;
    --bg-card: #232849;
    --bg-card-hover: #2a3055;
    --bg-elevated: #1e2444;
    
    --accent: #5b8def;
    --accent-light: #7ba3ff;
    --accent-dark: #3d6fd0;
    --accent-glow: rgba(91, 141, 239, 0.4);
    
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-red: linear-gradient(135deg, #fa8072 0%, #ff4757 100%);
    --gradient-cyan: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    --gradient-violet: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    
    --text-primary: #ffffff;
    --text-secondary: #b8bfd9;
    --text-muted: #6e7596;
    
    --border: rgba(255, 255, 255, 0.06);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-hover: rgba(255, 255, 255, 0.08);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 8px 32px var(--accent-glow);
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== ICONOS SVG ===== */
.icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }

/* ===== APP LAYOUT ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
}

/* En PC: vista más amplia */
@media (min-width: 1024px) {
    .app {
        max-width: 100%;
        flex-direction: row;
    }
}

/* ===== STATUS BAR (Top) ===== */
.status-bar {
    padding: calc(16px + var(--safe-top)) 24px 8px;
    flex-shrink: 0;
}

/* ===== TOP HEADER ===== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    flex-shrink: 0;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.header-btn:hover {
    background: var(--glass-hover);
    transform: scale(1.05);
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
}

/* ===== MAIN CONTENT (Scrollable) ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 120px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.main-content::-webkit-scrollbar { display: none; }

/* ===== SCREENS / VIEWS ===== */
.screen {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SEARCH BAR ===== */
.search-wrapper {
    padding: 0 24px 16px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.search-icon-wrap {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== FEATURED CARD (Hero) ===== */
.featured-section {
    padding: 8px 24px 24px;
}

.featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/10;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.featured-card:active {
    transform: scale(0.98);
}

.featured-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-red);
}

.featured-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.featured-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.featured-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
    line-height: 1.1;
    margin-bottom: 4px;
}

.featured-artist {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.featured-play-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ===== SECTION HEADERS ===== */
.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.section-link {
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: var(--transition-fast);
}

.section-link:hover {
    color: var(--text-primary);
}

/* ===== ALBUMS CAROUSEL ===== */
.albums-scroll {
    display: flex;
    gap: 14px;
    padding: 0 24px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.albums-scroll::-webkit-scrollbar { display: none; }

.album-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: var(--transition);
}

.album-card:active {
    transform: scale(0.95);
}

.album-cover {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
}

.album-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.album-meta {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== PLAYLISTS GRID ===== */
.playlists-scroll {
    display: flex;
    gap: 12px;
    padding: 0 24px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.playlists-scroll::-webkit-scrollbar { display: none; }

.playlist-pill {
    flex: 0 0 auto;
    min-width: 110px;
    height: 60px;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: white;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: var(--shadow-sm);
}

.playlist-pill:active {
    transform: scale(0.95);
}

.playlist-pill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.05);
    opacity: 0;
    transition: opacity 0.3s;
}

.playlist-pill:hover::after {
    opacity: 1;
}

/* ===== SONG LIST (in playlists or search) ===== */
.song-list {
    padding: 0 16px;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.song-item:active {
    background: var(--glass-hover);
}

.song-item.playing {
    background: var(--bg-card);
}

.song-number {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.song-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    flex-shrink: 0;
    position: relative;
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.song-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item.playing .song-title {
    color: var(--accent-light);
}

.song-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
}

.badge-hot {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.song-artist {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.song-action {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.song-action:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.song-action.favorited {
    color: #ff4757;
}

/* ===== NOW PLAYING SCREEN ===== */
.now-playing {
    position: fixed;
    inset: 0;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-deep);
}

.now-playing.open {
    transform: translateY(0);
}

.np-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.np-background img {
    width: 110%;
    height: 110%;
    object-fit: cover;
    position: absolute;
    top: -5%;
    left: -5%;
    filter: blur(80px) saturate(180%) brightness(0.6);
    transform: scale(1.3);
    transition: opacity 0.5s;
}

.np-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(10, 14, 39, 0.3) 0%, 
        rgba(10, 14, 39, 0.5) 50%, 
        rgba(10, 14, 39, 0.85) 100%);
    z-index: 1;
}

.np-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + var(--safe-top)) 20px 16px;
    z-index: 10;
    position: relative;
}

.np-header .header-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.15);
}

.np-title-wrap {
    text-align: center;
    flex: 1;
}

.np-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
}

.np-subtitle {
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.np-cover-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 32px;
    position: relative;
    z-index: 5;
}

.np-cover-wrap {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
}

/* Ring decorativo (opcional) */
.np-cover-ring {
    display: none;
}

.np-cover {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s ease;
}

.np-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.np-cover.playing {
    animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.01); }
}

.np-cover-center {
    display: none;
}

.np-info {
    padding: 16px 32px 8px;
    text-align: center;
    z-index: 5;
    position: relative;
}

.np-song-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.np-song-artist {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* ===== PROGRESS BAR ===== */
.np-progress {
    padding: 16px 32px 8px;
    z-index: 5;
    position: relative;
}

.progress-bar-wrap {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s;
}

.progress-bar-wrap:hover {
    height: 6px;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
    width: 0%;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.progress-bar-wrap:hover .progress-bar::after {
    transform: translate(50%, -50%) scale(1);
}

.progress-times {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ===== PLAYER CONTROLS (Now Playing) ===== */
.np-controls {
    padding: 16px 24px calc(32px + var(--safe-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    position: relative;
}

.np-btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.np-btn:active {
    transform: scale(0.9);
}

.np-btn.secondary {
    color: rgba(255, 255, 255, 0.6);
    width: 44px;
    height: 44px;
}

.np-btn.secondary.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.np-btn-play {
    width: 72px;
    height: 72px;
    background: white;
    color: var(--bg-deep);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.25);
}

.np-btn-play:hover {
    transform: scale(1.05);
}

/* ===== MINI PLAYER (Bottom) ===== */
.mini-player {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    max-width: 456px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    transform: translateY(150%);
    opacity: 0;
    overflow: hidden;
}

.mini-player.show {
    transform: translateY(0);
    opacity: 1;
}

.mini-player:active {
    transform: scale(0.98);
}

.mp-cover {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-elevated);
    position: relative;
}

.mp-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mp-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    line-height: 1.3;
}

.mp-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    line-height: 1.3;
}

.mp-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.mp-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.mp-btn:hover {
    background: var(--glass-hover);
}

.mp-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.mp-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(19, 24, 54, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 16px calc(12px + var(--safe-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 80;
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-btn.active {
    color: var(--accent-light);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
}

.nav-btn-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== EMPTY STATE ===== */
.empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-icon {
    margin: 0 auto 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 13px;
    line-height: 1.5;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinAnim 0.8s linear infinite;
}

@keyframes spinAnim {
    to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: calc(20px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    backdrop-filter: blur(20px);
    pointer-events: auto;
}

.toast.success { border-left: 3px solid #43e97b; }
.toast.error { border-left: 3px solid #ff4757; }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    to { transform: translateY(-20px); opacity: 0; }
}

.toast-icon {
    flex-shrink: 0;
}

.toast.success .toast-icon { color: #43e97b; }
.toast.error .toast-icon { color: #ff4757; }
.toast.info .toast-icon { color: var(--accent); }

.toast-msg {
    font-size: 13px;
    font-weight: 500;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== ACTION SHEET ITEMS ===== */
.action-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    background: none;
    color: var(--text-primary);
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.action-item:hover {
    background: var(--glass-hover);
}

.action-item.danger {
    color: #ff4757;
}

.action-icon {
    color: var(--text-secondary);
}

.action-item.danger .action-icon {
    color: #ff4757;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn {
    padding: 14px 24px;
    border-radius: var(--radius-full);
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--glass-hover);
}

.btn-full {
    width: 100%;
}

/* ===== DESKTOP RESPONSIVE ===== */
@media (min-width: 1024px) {
    .app {
        max-width: 100%;
        flex-direction: row;
    }
    
    .desktop-sidebar {
        width: 280px;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border);
        padding: 24px;
        flex-shrink: 0;
        overflow-y: auto;
    }
    
    .main-content {
        max-width: 1000px;
        margin: 0 auto;
        padding-bottom: 100px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .mini-player {
        bottom: 16px;
        max-width: 600px;
    }
    
    .now-playing {
        max-width: 480px;
        margin: 0 auto;
        right: 0;
        left: 0;
    }
    
    .featured-section,
    .section-row,
    .search-wrapper {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .albums-scroll,
    .playlists-scroll {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* ===== ADMIN PAGE ===== */
.admin-screen {
    min-height: 100vh;
    background: var(--bg-deep);
    overflow-y: auto;
    padding-bottom: 40px;
}

.admin-header {
    padding: calc(16px + var(--safe-top)) 24px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.admin-content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--glass);
    margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(91, 141, 239, 0.05);
}

.upload-icon {
    color: var(--accent);
    margin-bottom: 16px;
}

.upload-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), #43e97b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upload Form */
.upload-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: none;
}

.upload-form.show {
    display: block;
    animation: fadeInUp 0.4s;
}

.cover-upload {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    color: var(--text-muted);
    transition: var(--transition);
}

.cover-upload:hover {
    border-color: var(--accent);
}

.cover-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.progress-track {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #43e97b);
    width: 0%;
    transition: width 0.3s;
}

/* Admin song list */
.admin-song {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.admin-song-info {
    flex: 1;
    min-width: 0;
}

.admin-song-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-song-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.admin-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.admin-btn:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.admin-btn.danger:hover {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border-color: #ff4757;
}

/* Equalizer animation */
.eq-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.eq-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 1px;
    animation: eqAnim 1s ease-in-out infinite;
}

.eq-bar:nth-child(1) { animation-delay: 0s; height: 60%; }
.eq-bar:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.eq-bar:nth-child(3) { animation-delay: 0.4s; height: 40%; }

@keyframes eqAnim {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* ===== FIX: ADMIN PAGE SCROLL ===== */
body.admin-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body.admin-page .admin-screen {
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

html.admin-page {
    overflow-y: auto !important;
    height: auto;
}


/* ===== FONDO BOKEH ANIMADO ===== */
.bokeh-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatBokeh 20s ease-in-out infinite;
}

.bokeh-1 {
    width: 400px;
    height: 400px;
    background: #667eea;
    top: -100px;
    left: -100px;
    animation-duration: 25s;
}

.bokeh-2 {
    width: 300px;
    height: 300px;
    background: #f093fb;
    top: 20%;
    right: -80px;
    animation-duration: 30s;
    animation-delay: -5s;
}

.bokeh-3 {
    width: 350px;
    height: 350px;
    background: #4facfe;
    bottom: 20%;
    left: -100px;
    animation-duration: 22s;
    animation-delay: -10s;
}

.bokeh-4 {
    width: 280px;
    height: 280px;
    background: #fa709a;
    bottom: -80px;
    right: -50px;
    animation-duration: 28s;
    animation-delay: -7s;
}

.bokeh-5 {
    width: 320px;
    height: 320px;
    background: #43e97b;
    top: 50%;
    left: 30%;
    animation-duration: 35s;
    animation-delay: -12s;
    opacity: 0.25;
}

.bokeh-6 {
    width: 250px;
    height: 250px;
    background: #fa8072;
    top: 30%;
    right: 20%;
    animation-duration: 26s;
    animation-delay: -15s;
    opacity: 0.3;
}

@keyframes floatBokeh {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(60px, -40px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 50px) scale(0.95);
    }
    75% {
        transform: translate(40px, 30px) scale(1.05);
    }
}

/* Ajuste del fondo para que el bokeh se vea */
body {
    background: var(--bg-deep);
    position: relative;
}

.app {
    background: transparent !important;
    position: relative;
    z-index: 1;
}

/* Hacer cards más transparentes para que se vea el bokeh */
.song-item {
    background: rgba(35, 40, 73, 0.5);
    backdrop-filter: blur(10px);
    margin-bottom: 6px;
}

.song-item:hover,
.song-item:active {
    background: rgba(42, 48, 85, 0.7);
}

.album-cover {
    backdrop-filter: blur(10px);
}

/* Headers más transparentes */
.top-header {
    backdrop-filter: blur(20px);
    background: rgba(10, 14, 39, 0.4);
}

.bottom-nav {
    background: rgba(19, 24, 54, 0.7);
    backdrop-filter: blur(30px);
}

.header-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

/* Featured card más bonita */
.featured-card {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.featured-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

/* Mini player con glassmorphism */
.mini-player {
    background: rgba(35, 40, 73, 0.85) !important;
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Playlists pills con efecto */
.playlist-pill {
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Reducir bokeh en móvil para mejor rendimiento */
@media (max-width: 768px) {
    .bokeh {
        filter: blur(60px);
        opacity: 0.3;
    }
    .bokeh-5, .bokeh-6 {
        display: none;
    }
}

/* ===== SIGUIENTE CANCIÓN ===== */
.np-next-up {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.4s ease;
}

.np-next-up span span {
    color: white;
    font-weight: 600;
    margin-left: 2px;
}

.np-next-up svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* ===== PORTADA SWIPEABLE ===== */
.np-cover {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    will-change: transform;
}

.np-cover:active {
    cursor: grabbing;
}

.np-cover.swiping {
    transition: none !important;
}

.np-cover.swipe-out-left {
    animation: swipeOutLeft 0.3s ease forwards;
}

.np-cover.swipe-out-right {
    animation: swipeOutRight 0.3s ease forwards;
}

.np-cover.swipe-in {
    animation: swipeIn 0.3s ease;
}

@keyframes swipeOutLeft {
    to {
        transform: translateX(-120%) rotate(-10deg);
        opacity: 0;
    }
}

@keyframes swipeOutRight {
    to {
        transform: translateX(120%) rotate(10deg);
        opacity: 0;
    }
}

@keyframes swipeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Indicadores de swipe (flechas que aparecen al deslizar) */
.np-cover-wrap::before,
.np-cover-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
}

.np-cover-wrap::before {
    left: -10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='19 20 9 12 19 4 19 20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
}

.np-cover-wrap::after {
    right: -10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='5 4 15 12 5 20 5 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
}

.np-cover-wrap.show-prev::before { opacity: 1; }
.np-cover-wrap.show-next::after { opacity: 1; }