/* ============================================================
   BECA RADIO — Layout: canales + now playing + mini player
   ============================================================ */

body { padding-bottom: 100px; /* espacio para el mini player */ }

.radio-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.2rem;
    padding: 1rem 5% 3rem;
    max-width: 1500px;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 1024px) {
    .radio-container { grid-template-columns: 1fr; }
}

/* ─────────── PANEL DE CANALES (izquierda) ─────────── */
.channels-panel {
    background: var(--card-bg, rgba(20, 25, 45, 0.7));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.channels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.channels-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: white;
    letter-spacing: 2px;
    margin: 0;
    white-space: nowrap;
}

#channel-search {
    flex: 1;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    outline: none;
}

#channel-search:focus { border-color: var(--accent-gold, #c49b3a); }

.channels-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.channels-list::-webkit-scrollbar { width: 6px; }
.channels-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.channels-list::-webkit-scrollbar-thumb { background: rgba(196, 155, 58, 0.5); border-radius: 3px; }

/* ─────────── CANAL (acordeón) ─────────── */
.channel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.channel.open {
    border-color: rgba(196, 155, 58, 0.4);
    box-shadow: 0 0 20px rgba(196, 155, 58, 0.1);
}

.channel__header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.channel__header:hover { background: rgba(196, 155, 58, 0.06); }

.channel__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c49b3a, #FF8C42);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #050a14;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.channel__avatar--img {
    background: #0a1628 !important;
    border: 2px solid rgba(196, 155, 58, 0.5);
}

.channel__avatar--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.channel__info { flex: 1; min-width: 0; }

.channel__name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel__count {
    font-size: 0.7rem;
    color: var(--accent-gold, #c49b3a);
    letter-spacing: 1px;
    margin-top: 0.15rem;
}

.channel__toggle {
    font-size: 0.85rem;
    color: var(--accent-gold, #c49b3a);
    transition: transform 0.3s;
}

.channel.open .channel__toggle { transform: rotate(180deg); }

.channel__episodes {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(0, 0, 0, 0.15);
}

.channel.open .channel__episodes { max-height: 2000px; }

.channel__episodes-inner {
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.episode-item {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    align-items: center;
}

.episode-item:hover {
    background: rgba(196, 155, 58, 0.1);
    border-left-color: var(--accent-gold, #c49b3a);
}

.episode-item.active {
    background: rgba(196, 155, 58, 0.18);
    border-left-color: var(--accent-gold-bright, #FFD966);
}

.episode-item__num {
    font-size: 0.72rem;
    color: var(--accent-gold, #c49b3a);
    font-weight: 900;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
}

.episode-item__info { min-width: 0; }

.episode-item__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    color: white;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.episode-item__meta {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 0.15rem;
    font-family: monospace;
}

.episode-item__play {
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.episode-item:hover .episode-item__play { opacity: 1; }

/* ─────────── PANEL "REPRODUCIENDO AHORA" (derecha) ─────────── */
.now-playing-panel {
    background: var(--card-bg, rgba(20, 25, 45, 0.7));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    position: sticky;
    top: 8rem;
}

.now-playing__label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    color: var(--accent-gold, #c49b3a);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
}

.now-playing__cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #0a1628;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(196, 155, 58, 0.25);
    position: relative;
}

.now-playing__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.now-playing__cover:hover img { transform: scale(1.03); }

.now-playing__channel {
    font-size: 0.62rem;
    color: var(--accent-gold, #c49b3a);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
}

.now-playing__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.now-playing__tags {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.now-playing__tags span {
    background: rgba(196, 155, 58, 0.15);
    border: 1px solid rgba(196, 155, 58, 0.4);
    color: var(--accent-gold, #c49b3a);
    font-size: 0.55rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
}

.now-playing__description {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.4;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-style: italic;
    max-height: 80px;
    overflow-y: auto;
    text-align: center;
}

/* ─────────── MINI PLAYER FIJO ABAJO ─────────── */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(196, 155, 58, 0.3);
    padding: 0.6rem 5%;
    display: grid;
    grid-template-columns: auto 1fr auto 2fr auto;
    gap: 1rem;
    align-items: center;
    z-index: 200;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(110%);
    transition: transform 0.35s ease;
}

.mini-player.visible {
    transform: translateY(0);
}

.mini-player__cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #0a1628;
    border: 2px solid rgba(196, 155, 58, 0.3);
    flex-shrink: 0;
}

.mini-player__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-player__info {
    min-width: 0;
    max-width: 250px;
}

.mini-player__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-player__channel {
    font-size: 0.65rem;
    color: var(--accent-gold, #c49b3a);
    letter-spacing: 1px;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-player__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.player-btn:hover {
    border-color: var(--accent-gold, #c49b3a);
    background: rgba(196, 155, 58, 0.15);
    transform: scale(1.05);
}

.player-btn--main {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #FFD966, #FF8C42);
    border: none;
    color: #050a14;
    box-shadow: 0 4px 20px rgba(255, 140, 66, 0.5);
}

.player-btn--main:hover {
    box-shadow: 0 6px 30px rgba(255, 140, 66, 0.8);
    transform: scale(1.08);
}

.mini-player__progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.player-time {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    font-family: monospace;
    min-width: 40px;
    text-align: center;
}

.player-bar {
    flex: 1;
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 80px;
}

.player-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #c49b3a, #FFD966);
    width: 0%;
    border-radius: 3px;
    transition: width 0.2s linear;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.player-volume input[type="range"] {
    width: 70px;
    accent-color: var(--accent-gold, #c49b3a);
    cursor: pointer;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 1024px) {
    .now-playing-panel { position: relative; top: 0; }
}

@media (max-width: 768px) {
    .radio-container { padding: 1rem 3% 3rem; }
    .channels-header { flex-direction: column; align-items: flex-start; }
    #channel-search { max-width: 100%; width: 100%; }
    .mini-player {
        grid-template-columns: auto 1fr auto;
        gap: 0.6rem;
        padding: 0.5rem 3%;
    }
    .mini-player__info { max-width: none; }
    .mini-player__progress { grid-column: 1 / -1; order: 10; }
    .player-volume { display: none; }
}

.episodes-loading, .episodes-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted, #94a3b8);
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
}

/* ============================================================
   CABECERA COMPACTA + INPUT MÁS PEQUEÑO
   ============================================================ */

/* Cabecera más pequeña */
.radio-header {
    padding: 0.5rem 5% 0.3rem !important;
}

.radio-title {
    font-size: 1.6rem !important;
    letter-spacing: 3px !important;
}

.radio-subtitle {
    font-size: 0.72rem !important;
    margin-top: 0.15rem !important;
    letter-spacing: 1px !important;
}

/* Input bar más pequeño */
.radio-input-bar {
    margin-top: 0.6rem !important;
    gap: 0.4rem !important;
    max-width: 700px !important;
}

.radio-input-bar input {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
}

.radio-input-bar__btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
}

.radio-input-bar__hint {
    font-size: 0.65rem !important;
    margin-top: 0.25rem !important;
}

/* Contenedor: menos espacio arriba */
.radio-container {
    padding: 0.5rem 5% 3rem !important;
    gap: 1rem !important;
}

/* Los paneles suben */
.channels-panel,
.now-playing-panel {
    margin-top: 0 !important;
}

/* "Reproduciendo ahora" empieza alineado con la parte superior */
.now-playing-panel {
    top: 7rem !important;
}

/* Reducir el espacio entre la cabecera y el grid */
body > .radio-header + .radio-container {
    margin-top: -0.5rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .radio-title { font-size: 1.3rem !important; }
    .radio-input-bar input { font-size: 0.72rem !important; }
}

/* ============================================================
   FIX: IMAGEN DEL PANEL "REPRODUCIENDO AHORA" SIN RECORTES
   ============================================================ */

/* Cambiar de cuadrado (1:1) a formato YouTube (16:9) */
.now-playing__cover {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    height: auto !important;
}

.now-playing__cover img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Fix: mini-player siempre visible */
.mini-player {
    transform: translateY(0) !important;
}

body {
    padding-bottom: 110px !important;
}
