@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;900&display=swap');

:root {
    --bg-black: #000000;
    --bg-card: #121212;
    --bg-hover: #282828;
    --sp-green: #1db954;
    --text-muted: #b3b3b3;
    --text-light: #ffffff;
    --transition-default: all 0.2s ease-in-out;
    --shadow-card: 0 8px 24px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black); 
    color: var(--text-light);
    font-family: 'Figtree', sans-serif; 
    margin: 0; 
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#bgCover {
    position: fixed; 
    width: 100%; 
    height: 100%; 
    z-index: -2;
    background-size: cover; 
    background-position: center;
    filter: blur(80px) brightness(0.3); 
    transition: background-image 0.5s ease-in-out;
}

.spotify-wrapper { 
    display: flex; 
    height: calc(100vh - 90px); 
    padding: 8px; 
    gap: 8px; 
}

/* SIDEBAR */
.spotify-sidebar { 
    width: 300px; 
    display: flex; 
    flex-direction: column; 
    background: #000; 
    border-radius: 8px; 
}
.sidebar-box { 
    background-color: var(--bg-card); 
    border-radius: 8px; 
    padding: 12px; 
    margin-bottom: 8px; 
}
.beat-logo-container { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    cursor: pointer; 
    transition: var(--transition-default);
}
.beat-logo-container:hover {
    opacity: 0.8;
}
.beat-logo-img { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
}
.beat-logo-text { 
    font-size: 20px; 
    font-weight: 900; 
    letter-spacing: -0.5px; 
}

.sidebar-nav a {
    display: flex; 
    align-items: center; 
    gap: 16px; 
    color: var(--text-muted);
    text-decoration: none; 
    font-weight: 700; 
    height: 48px; 
    padding: 0 16px; 
    transition: var(--transition-default);
    border-radius: 4px;
}
.sidebar-nav a:hover { 
    color: #fff; 
    background: rgba(255,255,255,0.05); 
}
.sidebar-nav a.active { 
    color: #fff; 
    background: rgba(255,255,255,0.1); 
}

/* CONTENT MAIN */
.spotify-content { 
    flex-grow: 1; 
    background: #121212; 
    border-radius: 8px; 
    overflow-y: auto; 
    position: relative;
    background: linear-gradient(145deg, #202020 0%, #121212 100%);
}

.content-padding { 
    padding: 24px 32px; 
}

/* RADIO HERO */
.radio-hero { 
    display: flex; 
    align-items: flex-end; 
    padding: 80px 32px 32px; 
    gap: 24px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.8) 100%);
    position: relative; 
    min-height: 400px;
}
#artwork { 
    width: 232px; 
    height: 232px; 
    box-shadow: var(--shadow-card); 
    background-size: cover; 
    background-color: #333; 
    border-radius: 4px;
    transition: var(--transition-default);
}
.hero-text { 
    z-index: 2; 
    flex: 1; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}
.display-song { 
    font-size: clamp(2.5rem, 6vw, 4rem); 
    font-weight: 900; 
    margin: 10px 0; 
    line-height: 1.1; 
    letter-spacing: -0.02em;
}
.live-indicator { 
    background: #e91429; 
    color: #fff; 
    display: inline-block; 
    padding: 4px 8px; 
    font-size: 10px; 
    font-weight: 900; 
    border-radius: 4px; 
    letter-spacing: 0.5px; 
    text-transform: uppercase;
}

/* BUSQUEDA & CHIPS */
.sticky-search-bar { 
    position: sticky; 
    top: 0; 
    background: #121212; 
    z-index: 50; 
    padding-top: 20px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
}
.search-input-wrapper { 
    background: #2a2a2a; 
    border-radius: 500px; 
    padding: 12px 20px; 
    display: flex; 
    align-items: center; 
    width: 100%; 
    max-width: 400px; 
    transition: var(--transition-default);
}
.search-input-wrapper:focus-within { 
    background: #333; 
    box-shadow: 0 0 0 2px var(--text-light); 
}
.search-input-wrapper input { 
    background: transparent; 
    border: none; 
    outline: none; 
    margin-left: 10px; 
    width: 100%; 
    color: var(--text-light); 
    font-weight: 500; 
    font-size: 16px; 
}
.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
.search-input-wrapper i { 
    color: var(--text-muted); 
}
#clearSearch { 
    background: none; 
    border: none; 
    color: var(--text-light); 
    font-size: 24px; 
    cursor: pointer; 
    display: none; 
    line-height: 1;
    padding: 0 5px;
}

.filters-container { 
    display: flex; 
    gap: 8px; 
    overflow-x: auto; 
    padding-bottom: 10px; 
    scrollbar-width: thin;
    scrollbar-color: #535353 #121212;
}
.filters-container::-webkit-scrollbar {
    height: 6px;
}
.filters-container::-webkit-scrollbar-track {
    background: #121212;
}
.filters-container::-webkit-scrollbar-thumb {
    background: #535353;
    border-radius: 6px;
}
.filter-chip { 
    background: #2a2a2a; 
    padding: 8px 16px; 
    border-radius: 20px; 
    font-size: 14px; 
    font-weight: 700; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: var(--transition-default);
    border: none;
    color: var(--text-light);
}
.filter-chip:hover { 
    background: #3a3a3a; 
    transform: scale(0.98);
}
.filter-chip.active { 
    background: var(--text-light); 
    color: #000; 
}

/* CARDS */
.category-card { 
    height: 160px; 
    border-radius: 8px; 
    padding: 20px; 
    font-size: 24px; 
    font-weight: 900; 
    cursor: pointer; 
    position: relative; 
    overflow: hidden; 
    transition: var(--transition-default);
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}
.category-card:hover { 
    transform: scale(1.02); 
    box-shadow: var(--shadow-card);
}
.c-news { background: linear-gradient(145deg, #e91429, #b01020); } 
.c-music { background: linear-gradient(145deg, #1e3264, #152547); } 
.c-tech { background: linear-gradient(145deg, #509bf5, #2a6bbf); } 
.c-edu { background: linear-gradient(145deg, #b02897, #7a1e68); }

.card-spotify { 
    background: #181818; 
    padding: 16px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: var(--transition-default); 
    height: 100%; 
}
.card-spotify:hover { 
    background: #282828; 
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}
.card-spotify img { 
    width: 100%; 
    aspect-ratio: 1/1; 
    object-fit: cover; 
    border-radius: 4px; 
    margin-bottom: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); 
}

/* HORIZONTAL SCROLL */
.horizontal-scroll { 
    display: flex; 
    gap: 24px; 
    overflow-x: auto; 
    padding-bottom: 20px; 
    scrollbar-width: thin;
    scrollbar-color: #535353 #121212;
}
.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}
.horizontal-scroll::-webkit-scrollbar-track {
    background: #121212;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
    background: #535353;
    border-radius: 8px;
}
.scroll-item { 
    min-width: 180px; 
    max-width: 180px; 
}

/* EPISODES LIST */
.btn-back { 
    background: rgba(255,255,255,0.1); 
    border: none; 
    color: var(--text-light); 
    padding: 8px 16px; 
    border-radius: 20px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition-default);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-back:hover { 
    background: rgba(255,255,255,0.2); 
}
.episode-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 16px; 
    border-radius: 4px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    cursor: pointer; 
    transition: var(--transition-default); 
}
.episode-row:hover { 
    background: rgba(255,255,255,0.05); 
}
.ep-meta { 
    font-size: 13px; 
    color: var(--text-muted); 
    margin-top: 4px; 
}
.ep-action i { 
    font-size: 32px; 
    color: var(--sp-green); 
    opacity: 0; 
    transition: var(--transition-default); 
}
.episode-row:hover .ep-action i { 
    opacity: 1; 
}
.limit-text { 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* PLAYER */
.spotify-footer { 
    height: 90px; 
    background: #000; 
    border-top: 1px solid #282828; 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
    z-index: 100; 
    position: relative;
}
.footer-left { 
    width: 30%; 
    display: flex; 
    align-items: center; 
}
.footer-left img { 
    width: 56px; 
    height: 56px; 
    border-radius: 4px; 
    margin-right: 15px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.footer-info {
    overflow: hidden;
}
.footer-center { 
    width: 40%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}
.player-controls { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    margin-bottom: 8px; 
}
.control-btn { 
    background: none; 
    border: none; 
    color: var(--text-muted); 
    font-size: 16px; 
    cursor: pointer;
    transition: var(--transition-default);
}
.control-btn:hover { 
    color: var(--text-light); 
    transform: scale(1.05);
}
.play-btn-footer { 
    width: 32px; 
    height: 32px; 
    background: var(--text-light); 
    border-radius: 50%; 
    border: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
    transition: var(--transition-default); 
    color: #000; 
    cursor: pointer;
}
.play-btn-footer:hover { 
    transform: scale(1.1); 
    background: var(--sp-green);
}
.play-btn-footer:hover i {
    color: #000;
}

.playback-bar { 
    width: 100%; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 11px; 
    color: var(--text-muted); 
}
.progress-bg { 
    flex: 1; 
    height: 4px; 
    background: #4d4d4d; 
    border-radius: 2px; 
    position: relative; 
    overflow: hidden; 
    cursor: pointer;
}
#fakeProgress { 
    height: 100%; 
    background: var(--text-light); 
    width: 0%; 
    border-radius: 2px; 
    transition: width 0.1s linear;
}

.footer-right { 
    width: 30%; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    gap: 10px;
}
.volume-slider { 
    width: 100px; 
    accent-color: var(--sp-green); 
    height: 4px; 
    cursor: pointer;
}

.btn-play-large { 
    width: 56px; 
    height: 56px; 
    border-radius: 50%; 
    background: var(--sp-green); 
    border: none; 
    font-size: 24px; 
    color: #000; 
    transition: var(--transition-default); 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-play-large:hover { 
    transform: scale(1.05); 
    background: #1ed760;
}
.btn-circle-alt { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    border: 1px solid #777; 
    background: transparent; 
    color: var(--text-light); 
    cursor: pointer;
    transition: var(--transition-default);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-circle-alt:hover { 
    border-color: var(--text-light); 
    transform: scale(1.1);
}

/* ===== NUEVOS ESTILOS PARA IPTV Y MÓVIL ===== */

/* Video player dentro del hero */
.radio-hero video {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
}

/* Grilla de canales TV */
.tv-channel-card {
    background: #181818;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-default);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.tv-channel-card:hover {
    background: #282828;
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}
.tv-channel-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
    background: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.tv-channel-card .channel-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-light);
}

/* Barra de navegación inferior para móvil */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #000;
    border-top: 1px solid #282828;
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    backdrop-filter: blur(10px);
    background: rgba(0,0,0,0.95);
}
.mobile-bottom-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition-default);
    padding: 8px 0;
    width: 25%;
}
.mobile-bottom-nav a i {
    font-size: 22px;
}
.mobile-bottom-nav a.active {
    color: var(--sp-green);
}
.mobile-bottom-nav a span {
    font-size: 11px;
    font-weight: 500;
}

/* Ajustes para móvil (pantallas < 768px) */
@media (max-width: 768px) {
    .spotify-sidebar {
        display: none !important;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .spotify-footer {
        margin-bottom: 65px;
        padding: 0 10px;
    }
    .spotify-wrapper {
        height: calc(100vh - 90px - 65px);
    }
    .radio-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 40px 16px;
        min-height: auto;
    }
    #artwork {
        width: 160px;
        height: 160px;
        margin-bottom: 20px;
    }
    .display-song {
        font-size: 2rem;
    }
    .footer-left .footer-info {
        max-width: 110px;
    }
    .footer-left img {
        width: 48px;
        height: 48px;
        margin-right: 10px;
    }
    .footer-right {
        display: none;
    }
    .footer-center {
        width: 100%;
    }
    .content-padding {
        padding: 16px;
    }
    .card-spotify {
        padding: 8px;
    }
    .card-spotify img {
        margin-bottom: 6px;
    }
    .category-card {
        height: 120px;
        font-size: 20px;
        padding: 16px;
    }
    .btn-play-large {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Ajuste para que el video no rompa el layout */
#videoPlayer, #youtubePlayer {
    max-width: 100%;
    border-radius: 8px;
    background: #000;
}

/* Utilidades */
.gap-3 { gap: 16px; }
.text-success { color: var(--sp-green) !important; }
.text-muted { color: var(--text-muted) !important; }
.border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }

/* Spinner mejorado */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

/* Mensajes de error/empty */
.text-center.text-muted {
    padding: 40px 0;
    color: var(--text-muted);
}
