/* =========================================================
   ESTILO BRAND IDENTITY Y BASE ESCRITORIO
   ========================================================= */
:root {
    --player-height: 100px;
}

body {
    background-color: #26264c;
    background: radial-gradient(ellipse at center, #3a3a70 0%, #26264c 70%, #26264c 100%);
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    color: #fff;
    min-height: 100vh;
    transition: padding-top .38s cubic-bezier(.22, .61, .36, 1);
}

body.player-visible {
    padding-top: var(--player-height) !important;
}

#mainContainer {
    max-width: 1150px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================================
   CABECERA
   ========================================================= */
#navBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

#navBar .logo img {
    height: 60px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#topActions {
    display: flex;
    gap: 15px;
}

#searchInput {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    font-size: 15px;
    width: 220px;
    outline: none;
    transition: all 0.3s;
}

#searchInput::placeholder {
    color: #bbb;
}

#searchInput:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #fff;
}

#install-button {
    background: #E50914;
    color: #fff;
    font-family: 'Bebas Neue', cursive;
    font-size: 18px;
    letter-spacing: 1px;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#install-button:hover {
    background: #ff1f2c;
    transform: translateY(-2px);
}

/* =========================================================
   REPRODUCTOR SUPERIOR DESKTOP FIJO
   ========================================================= */
.desktop-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--player-height);
    margin: 0;
    padding: 0;
    z-index: 9999;
    background: #111126;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .38s cubic-bezier(.22, .61, .36, 1), opacity .25s ease;
}

body.player-visible .desktop-player {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#bgBlur {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(45px) brightness(0.48) saturate(1.35);
    transform: scale(1.10);
    z-index: 0;
    transition: background-image 0.8s ease;
}

#bgOverlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,10,24,0.72), rgba(10,10,20,0.42) 45%, rgba(10,10,24,0.72));
    z-index: 1;
}

#playerContainer {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.player-main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-width: 0;
}

/* CARDS LATERALES (RADIO Y CANCIÓN) */
.radioInfo, #trackInfoContainer {
    padding: 6px 12px;
    background: rgba(38, 38, 76, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    min-width: 0;
    height: 86px;
    box-sizing: border-box;
}

#radioLogo, #coverImage {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

#radioLogo { 
    margin-right: 14px; 
}

#coverImage { 
    margin-left: 14px; 
    object-fit: cover; 
    transition: opacity 0.3s ease; 
}

/* Contenedores con overflow hidden para que la animación de Marquee no desborde */
#radioText, #trackInfo {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#radioText { 
    text-align: left; 
}

#trackInfo { 
    text-align: right; 
}

/* =========================================================
   TEXTOS DE LA RADIO (CON SOPORTE DE MARQUEE)
   ========================================================= */
#radioName {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    margin-bottom: 3px;
    line-height: 1.2;
    will-change: transform;
}

#radioCity {
    display: block;
    font-size: 13px;
    opacity: 0.88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
    margin-bottom: 4px;
    line-height: 1.2;
}

#radioFrequency {
    display: inline-block;
    font-family: 'The Display St', sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ff4d4d;
    text-shadow: 0 0 9px rgba(255, 77, 77, 0.35);
    white-space: nowrap;
    line-height: 1;
    padding-left: 4px;
    box-sizing: border-box;
}

/* =========================================================
   TEXTOS DE LA CANCIÓN (CON SOPORTE DE MARQUEE)
   ========================================================= */
#trackArtist {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    align-self: flex-end;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.2;
    will-change: transform;
}

#trackTitle {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    align-self: flex-end;
    font-size: 13px;
    opacity: 0.88;
    white-space: nowrap;
    color: #ddd;
    line-height: 1.2;
    will-change: transform;
}

/* =========================================================
   CONTROLES CENTRALES (PREV | VOL | NEXT)
   ========================================================= */
.playback-controls {
    display: grid;
    grid-template-columns: 40px 144px 40px;
    grid-template-areas: 
        "prev volume next" 
        "pause status stop";
    align-items: center;
    justify-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    box-sizing: border-box;
}

#prevBtn        { grid-area: prev; }
.volume-control { grid-area: volume; }
#nextBtn        { grid-area: next; }
#playPauseBtn   { grid-area: pause; }
.stream-status  { grid-area: status; }
#stopBtn        { grid-area: stop; }

.player-btn {
    width: 40px;
    height: 40px;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(38, 38, 76, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    transition: background 0.18s ease, transform 0.18s ease;
    box-sizing: border-box;
}

.player-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-btn:hover { 
    background: rgba(255, 255, 255, 0.88); 
    transform: scale(1.06); 
}

.player-btn:active { 
    transform: scale(0.95); 
}

.player-btn:disabled { 
    opacity: 0.45; 
    cursor: wait; 
}

.stream-status {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(38, 38, 76, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fff;
    box-sizing: border-box;
}

.stream-status::after            { content: 'Detenido'; }
.stream-status.is-idle::after    { content: 'Detenido'; }
.stream-status.is-loading::after { content: 'Conectando...'; }
.stream-status.is-playing::after { content: 'En vivo'; }
.stream-status.is-error::after   { content: 'Error'; }

.stream-status.is-loading {
    animation: statusPulse 1.15s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.volume-control {
    --vol: 100%;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    background: rgba(38, 38, 76, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    box-sizing: border-box;
}

.volume-control::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: var(--vol);
    background: rgba(255, 77, 77, 0.55);
    transition: width 0.08s linear;
    z-index: 0;
}

.volume-icon, #volumePercentage {
    position: relative;
    z-index: 1;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.volume-icon { 
    font-size: 13px; 
}

#volumePercentage { 
    font-size: 12px; 
    font-weight: 700; 
}

#volumeSlider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    touch-action: none;
    z-index: 2;
}

#playerStatus {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

/* =========================================================
   NAVEGACIÓN DE REGIONES
   ========================================================= */
#regionWrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    width: 100%;
}

#regionNav {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.navLinks {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 5px;
    row-gap: 1px;
}

.navLinks a {
    flex: 0 0 auto;
    color: #cfcfe8;
    text-decoration: none;
    font-family: 'Bebas Neue';
    font-size: 19px;
    letter-spacing: 0.6px;
    padding: 5px 7px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.2s;
}

.navLinks a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.navLinks a.active-region {
    background: #fff;
    color: #26264c;
}

/* =========================================================
   ACCESOS SOCIALES / SOPORTE
   ========================================================= */
#socialBar {
    width: 100%;
    margin: 24px auto 34px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    box-sizing: border-box;
}

.social-item {
    min-width: 0;
    height: 74px;
    background: linear-gradient(135deg, rgba(74, 74, 145, .58), rgba(28, 28, 67, .78));
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.social-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(86, 86, 166, .72), rgba(35, 35, 82, .92));
    border-color: rgba(255, 255, 255, .32);
}

.social-item > a, .social-item > button {
    width: 100%;
    height: 100%;
    padding: 0 17px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 0;
    background: transparent;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.social-item img {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    object-fit: contain;
}

.social-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.social-name {
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    line-height: 1;
    letter-spacing: .5px;
}

.social-description {
    margin-top: 6px;
    color: rgba(255, 255, 255, .62);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
}

.social-item.support {
    border-color: rgba(255, 77, 77, .45);
    background: linear-gradient(135deg, rgba(105, 46, 72, .55), rgba(42, 27, 61, .82));
}

.social-item.support .social-name {
    color: #ff7474;
}

.social-support-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    font-size: 25px;
}

/* =========================================================
   TÍTULOS DE SECCIÓN
   ========================================================= */
#topNavBar, #featuredNavBar {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #fff;
    margin: 40px 0 25px;
    padding: 10px 25px;
    font-family: 'Bebas Neue';
    font-size: 28px;
    letter-spacing: 1.5px;
    text-align: left;
    display: block;
    border-bottom: 3px solid #E50914;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   GRILLA DE RADIOS
   ========================================================= */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding-bottom: 120px;
}

.grid.fade-out { opacity: 0; }
.grid.fade-in { opacity: 1; }

.station {
    width: 120px;
    height: 120px;
    background: #26264c;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.station:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #fff;
    background: #2e2e5c;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.station.active,
.is-active-station {
    border: 2px solid #ffffff !important;
    background: #323266 !important;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
    z-index: 10;
}

.station img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 12px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.favorite-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    z-index: 20;
    transition: color 0.2s;
}

.station:hover .favorite-icon { color: #fff; }

.is-favorite {
    border: 2px solid #ffcc00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
}

.is-favorite .favorite-icon { color: #ffcc00; }

.modal-option:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-3px);
    border-color: #fff !important;
}

/* =========================================================
   RADIOS DESTACADAS
   ========================================================= */
#featuredSection {
    width: 100%;
    margin: 5px auto 15px;
}

#featuredList {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    margin: 0 auto 10px;
}

.featured-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 215px;
    padding: 10px 16px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform .2s ease, background .2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    text-decoration: none;
    box-sizing: border-box;
}

.featured-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.35);
}

.featured-card img {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    object-fit: contain;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.12);
}

.featured-card-name {
    display: block;
    min-width: 0;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    line-height: 1.05;
    letter-spacing: .6px;
}

#featuredModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(10px);
}

#featuredModal.is-open { display: flex; }

#featuredModalBox {
    position: relative;
    width: min(1160px, 96vw);
    height: min(820px, 92vh);
    overflow: hidden;
    background: #171832;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .65);
}

#featuredClose {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 50%;
    background: rgba(10, 10, 25, .72);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

#featuredFrame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}


/* =========================================================
   REPETIDORAS - MISRADIOS DESKTOP
   ========================================================= */

#trackArtist:has(.repeater-item) {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
    max-width: 100%;
    gap: 3px;
    margin-bottom: 0;
    overflow: visible;
    white-space: normal;
}

.repeater-item {
    display: block;
    width: max-content;
    max-width: 100%;
    line-height: 1.15;
    white-space: nowrap;
}

.repeater-city {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #ddd;
}

.repeater-frequency {
    display: inline-block;
    margin-left: 6px;
    font-family: 'The Display St', sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

#trackTitle:empty {
    display: none;
}
