:root {
    --rosa-mexicano: #E4007C;
    --rosa-mexicano-hover: #C20069;
    --bg-negro: #000000;
    --bg-elevado: #121212;
    --bg-tarjeta: #181818;
    --bg-tarjeta-hover: #282828;
    --texto-principal: #FFFFFF;
    --texto-secundario: #B3B3B3;
    --radio-redondo: 50%;
}

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

body {
    background-color: var(--bg-negro);
    color: var(--texto-principal);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-bottom: 150px;
    overflow-x: hidden;
}

.oculto { display: none !important; }
.text-rosa { color: var(--rosa-mexicano) !important; }
.text-center { text-align: center; }

/* Identidad circular de carátulas (Estilo Vinilo) */
.caratula-vinilo {
    border-radius: var(--radio-redondo);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tamaños dinámicos de portadas */
.cover-slide-visitante { width: 190px; height: 190px; margin: 0 auto; }
.cover-album-logueado { width: 75px; height: 75px; margin: 0 auto; }
.cover-miniatura-lista { width: 48px; height: 48px; min-width: 48px; }

/* Cabecera superior */
#top-bar {
    position: sticky;
    top: 0;
    height: 56px;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 90;
}

#header-logo { width: 36px; height: 36px; }

/* Botones de acción e íconos */
.btn-icon {
    background: none;
    border: none;
    color: var(--texto-principal);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.btn-rosa-sm {
    background-color: var(--rosa-mexicano);
    color: var(--texto-principal);
    border: none;
    border-radius: 500px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-rosa-lg {
    background-color: var(--rosa-mexicano);
    color: var(--texto-principal);
    border: none;
    border-radius: 500px;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
}

/* Banner promocional */
#promo-banner {
    background: linear-gradient(90deg, #240b1a 0%, var(--bg-elevado) 100%);
    border-left: 4px solid var(--rosa-mexicano);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 16px;
    border-radius: 8px;
}

.banner-content p { font-size: 13px; margin-bottom: 8px; }
.btn-close-banner { background: none; border: none; color: var(--texto-secundario); font-size: 16px; cursor: pointer; }

/* Contenedor principal de vistas */
#app-view { width: 100% !important; margin: 0 !important; padding: 0 !important; background: transparent !important; }

/* Carruseles y cuadrículas */
.grid-caratulas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin: 16px 0 32px 0;
}

.tarjeta-item {
    background-color: var(--bg-tarjeta);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.tarjeta-item:hover { background-color: var(--bg-tarjeta-hover); }
.tarjeta-item h4 { font-size: 14px; margin: 10px 0 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-item p { font-size: 12px; color: var(--texto-secundario); }

/* Listas detalladas de canciones */
.cancion-fila {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    gap: 12px;
}

.cancion-fila:hover { background-color: rgba(255, 255, 255, 0.08); }
.cancion-fila .meta { flex-grow: 1; overflow: hidden; }
.cancion-fila .meta .title { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cancion-fila .meta .artist { font-size: 12px; color: var(--texto-secundario); }

/* Mini-Reproductor persistente */
#mini-player {
    position: fixed;
    bottom: 60px;
    left: 8px;
    right: 8px;
    height: 56px;
    background: rgba(20, 20, 20, 0.65) !important; backdrop-filter: blur(14px) !important; -webkit-backdrop-filter: blur(14px) !important; border-radius: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 95;
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.06);
}

#player-track-cover { width: 40px; height: 40px; margin-right: 12px; cursor: pointer; }
.track-meta { flex-grow: 1; overflow: hidden; cursor: pointer; }
#player-track-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player-track-artist { display: block; font-size: 11px; color: var(--texto-secundario); white-space: nowrap; }

.player-controls { display: flex; align-items: center; gap: 4px; }
.btn-play { font-size: 22px; }

#playback-bar {
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

#playback-fill { width: 0%; height: 100%; background-color: var(--rosa-mexicano); }

/* Barra de navegación inferior */
#footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: rgba(0, 0, 0, 0.98);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 90;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--texto-secundario);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    cursor: pointer;
    flex: 1;
}

.nav-tab.active, .nav-tab:hover { color: var(--texto-principal); }

/* Modales y Drawer lateral */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-box {
    background: rgba(20, 20, 20, 0.65) !important; backdrop-filter: blur(14px) !important; -webkit-backdrop-filter: blur(14px) !important; border-radius: 12px;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.planes-grid { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.btn-plan {
    background-color: var(--bg-tarjeta);
    border: 1px solid var(--rosa-mexicano);
    color: var(--texto-principal);
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-plan:hover { background-color: var(--rosa-mexicano); }
.btn-link { background: none; border: none; color: var(--texto-secundario); margin-top: 14px; cursor: pointer; text-decoration: underline; font-size: 13px; }

.tarjetas-iconos { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.badge-card { background-color: var(--bg-tarjeta-hover); padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; }

/* Menú lateral (Engrane) */
.menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: rgba(20, 20, 20, 0.65) !important; backdrop-filter: blur(14px) !important; -webkit-backdrop-filter: blur(14px) !important; border-radius: 12px;
    z-index: 300;
    padding: 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.8);
}

.drawer-links { list-style: none; margin-top: 24px; }
.drawer-links li { margin: 18px 0; }
.drawer-links a { color: var(--texto-principal); text-decoration: none; font-size: 16px; font-weight: 600; display: block; }
.drawer-divider { border: none; height: 1px; background: rgba(255,255,255,0.1); margin: 20px 0; }

/* Barra roja modo offline */
#offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #B00020;
    color: white;
    text-align: center;
    font-size: 12px;
    padding: 6px;
    z-index: 500;
}

/* Optimización para Smart TVs (10-foot UI) */
@media (min-width: 1600px) {
    body { font-size: 18px; padding-bottom: 180px; }
    #mini-player { height: 75px; bottom: 80px; }
    #player-track-cover { width: 55px; height: 55px; }
    #footer-nav { height: 75px; }
    .grid-caratulas { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
}



/* AJUSTE VINILO ELEGANTE VIFU */
.grid-caratulas {
    display: grid !important;
    gap: 14px !important;
    padding: 0 4px !important;
}

@media (min-width: 600px) {
    .grid-caratulas {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 18px !important;
    }
}

.grid-caratulas .tarjeta-item {
    background-color: var(--bg-tarjeta) !important;
    border-radius: 12px !important;
    padding: 12px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Efecto de vinilo centrado y proporcionado */
.grid-caratulas .caratula-vinilo, 
.grid-caratulas .cover-slide-visitante {
    width: 99px !important;
    height: 99px !important;
    max-width: 85% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 4px auto 12px auto !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.grid-caratulas .tarjeta-item h4 {
    width: 100% !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 0 4px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    color: #fff !important;
}

.grid-caratulas .tarjeta-item p {
    width: 100% !important;
    font-size: 11px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    color: var(--texto-secundario) !important;
}

.seccion-carrusel{margin-bottom:26px}.seccion-carrusel h3{font-size:18px;font-weight:700;color:#fff;margin:0 0 12px 0;padding:0 4px}.carrusel-horizontal{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:14px;padding-bottom:8px;-webkit-overflow-scrolling:touch}.carrusel-horizontal::-webkit-scrollbar{display:none}.tarjeta-carrusel{flex:0 0 130px;scroll-snap-align:start;cursor:pointer}.tarjeta-carrusel img{width:130px;height:130px;object-fit:cover;border-radius:8px;display:block;box-shadow:0 4px 10px rgba(0,0,0,.6)}.tarjeta-carrusel.artista img{border-radius:50%!important}.tarjeta-carrusel h4{font-size:13px;margin:8px 0 2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}.tarjeta-carrusel p{font-size:11px;margin:0;color:var(--texto-secundario);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vista-detalle{padding:10px 4px 80px 4px}.cabecera-detalle{display:flex;flex-direction:column;align-items:center;text-align:center;margin-bottom:20px}.cabecera-detalle img{width:180px;height:180px;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.7);margin-bottom:14px}.cabecera-detalle h2{font-size:20px;margin:0 0 6px 0;color:#fff}.cabecera-detalle span{font-size:12px;color:var(--texto-secundario)}.acciones-detalle{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:14px;padding:0 8px}.btn-play-grande{background-color:var(--rosa-mexicano,#E4007C);border:none;width:48px;height:48px;border-radius:50%;color:#fff;font-size:20px;display:flex;align-items:center;justify-content:center;cursor:pointer}.fila-cancion-detalle{display:flex;align-items:center;justify-content:space-between;padding:10px 8px;border-radius:6px;cursor:pointer}.fila-cancion-detalle:hover{background:rgba(255,255,255,.06)}.fila-cancion-detalle .info-pista{overflow:hidden;padding-right:12px}.fila-cancion-detalle .info-pista .titulo{font-size:14px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fila-cancion-detalle .info-pista .artista{font-size:12px;color:var(--texto-secundario);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-corazon{background:0 0;border:none;color:var(--texto-secundario);font-size:16px;cursor:pointer;padding:6px}.btn-corazon.activo{color:var(--rosa-mexicano,#E4007C)}

.grid-caratulas .cover-album-logueado {
    width: 75px !important;
    height: 75px !important;
}

/* Estado activo del botón de favoritos */
#btn-fav.es-favorito {
    color: #ff007f !important; /* Rosa mexicano característico de VIFU */
    filter: drop-shadow(0 0 6px rgba(255, 0, 127, 0.7));
    transform: scale(1.15);
    transition: transform 0.2s ease, color 0.2s ease;
}

/* --- RIELES HORIZONTALES (8 FILAS CON DIRECCIÓN ALTERNADA) --- */
.vifu-seccion-fila {
    contain: content;
    content-visibility: auto;
}

.carrusel-horizontal-vifu {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 14px !important;
    padding: 6px 16px 14px 16px !important;
    scrollbar-width: none !important;
}

.carrusel-horizontal-vifu::-webkit-scrollbar {
    display: none !important;
}

/* Fila hacia la derecha */
.carrusel-horizontal-vifu.dir-ltr {
    direction: ltr !important;
}

/* Fila hacia la izquierda */
.carrusel-horizontal-vifu.dir-rtl {
    direction: rtl !important;
}

/* Las tarjetas dentro de la fila invertida mantienen orientación normal */
.carrusel-horizontal-vifu.dir-rtl .tarjeta-carrusel-vifu {
    direction: ltr !important;
}

/* Tamaño de las tarjetas individuales en cada riel */
.tarjeta-carrusel-vifu {
    flex: 0 0 120px !important;
    width: 120px !important;
    scroll-snap-align: start !important;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background 0.2s ease;
}

.tarjeta-carrusel-vifu:hover {
    transform: translateY(-3px) scale(1.03);
    background: rgba(255, 255, 255, 0.08);
}

.tarjeta-carrusel-vifu .caratula-vinilo {
    width: 86px !important;
    height: 86px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 2px auto 8px auto !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    border: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.tarjeta-carrusel-vifu h4 {
    font-size: 12px !important;
    font-weight: 600 !important;
    margin: 0 0 2px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #fff !important;
}

.tarjeta-carrusel-vifu p {
    font-size: 10px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--texto-secundario) !important;
}

/* ======================================================
   REPRODUCTOR VIFU: Morado oscuro medio transparente (Efecto Cristal)
   ====================================================== */
#reproductor, .reproductor, .player-bar, footer.player, #player-bar {
    background: transparent !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45) !important;
}

/* ======================================================
   REPRODUCTOR Y FOOTER VIFU: Cristal Morado Spotify
   ====================================================== */
#mini-player, #footer-nav {
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Barra de progreso con acento morado brillante */
#playback-fill {
    background: linear-gradient(90deg, #a855f7, #c084fc) !important;
}

/* ======================================================
   FONDO VIFU: Desvanecido Negro -> Morado -> Verde Oscuro
   ====================================================== */
html {
    min-height: 100% !important;
    background: linear-gradient(
        180deg,
        #000000 0%,
        #07020d 15%,
        #3b145e 48%,
        #240e3b 68%,
        #0b2319 88%,
        #04140e 100%
    ) no-repeat center center fixed !important;
    background-size: cover !important;
}

body {
    min-height: 100vh !important;
    background: transparent !important;
    color: #ffffff !important;
}

/* Transparencia total en contenedores para que el degradado respire */
#app, main, .main-container, .vifu-section, .vifu-carousel, section {
    background: transparent !important;
}

/* ======================================================
   ENMARCADO VIFU: Cristal Negro Desvanecido (Top y Bottom)
   ====================================================== */

/* Tapa superior (cabecera / nav superior) */
header, #main-header, #top-bar, .top-bar, .header {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(10, 10, 14, 0.55) 75%, transparent 100%) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

/* Base inferior (reproductor y navegación) */
#mini-player, #footer-nav {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(12, 10, 18, 0.65) 80%, rgba(20, 15, 28, 0.45) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6) !important;
}

/* Detalle de la barra de reproducción para resaltar sobre el negro ahumado */
#playback-fill {
    background: linear-gradient(90deg, #9333ea, #a855f7) !important;
}

/* ======================================================
   CABECERA SUPERIOR VIFU: Cristal Negro Más Oscuro y Traslúcido
   ====================================================== */
header, #main-header, #top-bar, .top-bar, .header, nav.top-nav {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.94) 0%, rgba(5, 5, 8, 0.82) 70%, rgba(10, 8, 14, 0.60) 100%) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65) !important;
}

/* ======================================================
   CABECERA SUPERIOR: #top-bar Cristal Negro Oscuro y Traslúcido
   ====================================================== */
header#top-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(5, 5, 8, 0.78) 75%, rgba(10, 8, 14, 0.55) 100%) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}

/* ======================================================
   CABECERA SUPERIOR: 20% más transparente
   ====================================================== */
header#top-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(5, 5, 8, 0.58) 75%, rgba(10, 8, 14, 0.35) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* BARRA_INFERIOR_BLINDADA */
body {
    background-color: #000000 !important;
}
.bottom-nav, nav, #mini-player, .reproductor-fijo {
    z-index: 99999 !important;
    position: fixed !important;
}
#app-view { position: relative !important; z-index: 1 !important; padding-bottom: 120px !important; }

/* === ENCUADRE MINIPLAYER FLOTANTE VIFU === */
#mini-player {
    height: 62px !important;
    
    backdrop-filter: blur(14px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7) !important;
    padding: 0 12px !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

#player-track-cover {
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

#view-content, .contenido-principal, body {
    padding-bottom: 140px !important;
}

@media (min-width: 768px) {
    #mini-player {
        bottom: 84px !important;
        height: 68px !important;
    }
    #player-track-cover {
        width: 48px !important;
        height: 48px !important;
    }
}
