/* ============================
   LAYOUT TIPO APP NATIVA (PREMIUM EDIT)
   ============================ */
:root {
    --bg-main: #06090e;
    --bg-panel: rgba(13, 20, 30, 0.75);
    --accent-neon: #00ffaa;
    --accent-glow: rgba(0, 255, 170, 0.25);
    --text-main: #e2e8f0;
    --text-muted: #64748b;
    --border-color: rgba(0, 255, 170, 0.12);
    --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at center, #0c1524 0%, #03060a 100%);
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

.app-container {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh; /* Asegura el ajuste dinámico ante barras de navegadores móviles */
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    position: relative;
    padding-bottom: env(safe-area-inset-bottom); /* Evita que el reproductor quede detrás de barras nativas */
    box-sizing: border-box;
}

.app-container::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 50%;
    background: radial-gradient(circle, rgba(0, 255, 170, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@media (min-width: 440px) {
    .app-container {
        height: 92vh;
        border-radius: 32px;
        border: 1px solid rgba(0, 255, 170, 0.2);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 255, 170, 0.1);
        padding-bottom: 0;
    }
}

/* ============================
    BARRA DE NAVEGACIÓN SUPERIOR
   ============================ */
.top-navigation {
    display: flex;
    background: rgba(10, 15, 26, 0.85);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    z-index: 10;
    padding-top: max(8px, env(safe-area-inset-top));
}

.nav-tab {
    flex: 1;
    padding: 16px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
    color: var(--accent-neon);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 3px;
    background: var(--accent-neon);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--accent-neon);
}

/* ============================
    VISTAS / PESTAÑAS INTERNAS SPA
   ============================ */
.views-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
}

.app-view.active {
    opacity: 1;
    pointer-events: auto;
}

/* VISTA DE RADIO */
.panel-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 20px 24px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-neon) rgba(0,0,0,0.2);
}

.panel-container::-webkit-scrollbar {
    width: 4px;
}

.panel-container::-webkit-scrollbar-thumb {
    background: var(--accent-neon);
    border-radius: 10px;
}

h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.search-box {
    width: 100%;
    padding: 15px 18px;
    box-sizing: border-box;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
    -webkit-appearance: none;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-neon);
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.15), inset 0 2px 4px rgba(0,0,0,0.4);
}

.station-item {
    padding: 16px;
    margin-bottom: 10px;
    background: var(--glass-gradient);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.station-item:hover {
    background: rgba(0, 255, 170, 0.05);
    border-color: rgba(0, 255, 170, 0.3);
    transform: translateY(-2px);
}

.station-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-align: left;
}

.station-item:hover .station-name {
    color: var(--accent-neon);
}

.station-country {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    margin-top: 24px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-neon);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 255, 170, 0.3), transparent);
}

.status-msg {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================
    VISTA DE INICIO (CONTENEDOR IFRAME)
   ============================ */
.muro-container {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-main);
}

/* ============================
    REPRODUCTOR INFERIOR (ESTÁTICO)
   ============================ */
.bottom-dock {
    width: 100%;
    background: rgba(10, 15, 26, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.player-bar {
    width: 100%;
    padding: 20px 24px 12px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.player-inner-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.visual-decor {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.visual-decor.playing {
    opacity: 0.8;
}

.visual-decor.buffering span {
    background: #ffaa00 !important;
    animation-duration: 0.3s !important;
}

.visual-decor span {
    display: block;
    width: 2px;
    background: var(--accent-neon);
    border-radius: 1px;
    height: 30%;
}

.visual-decor.playing span {
    animation: bounce 0.8s ease infinite alternate;
}

.visual-decor.playing span:nth-child(2) { height: 60%; animation-delay: 0.2s; }
.visual-decor.playing span:nth-child(3) { height: 100%; animation-delay: 0.4s; }
.visual-decor.playing span:nth-child(4) { height: 40%; animation-delay: 0.1s; }
 
@keyframes bounce { 
    0% { transform: scaleY(0.3); } 
    100% { transform: scaleY(1.1); } 
}

.station-info {
    flex: 1;
    min-width: 0;
}

.station-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-info p {
    margin: 0;
    font-size: 12px;
    color: var(--accent-neon);
    font-weight: 500;
    transition: color 0.3s ease;
}

.controls {
    display: grid;
    grid-template-columns: 42px 64px 42px;
    align-items: center;
    justify-items: center;
    gap: 12px;
}

.btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-neon);
}

.btn-play {
    width: 64px !important;
    min-width: 64px !important;
    height: 64px !important;
    min-height: 64px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #00ffaa 0%, #00b377 100%);
    border: none;
    box-shadow: 0 4px 20px var(--accent-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;          
    outline: none;                    
}

.btn-play svg {
    fill: #03060a;
    width: 22px;
    height: 22px;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 170, 0.4);
}

.app-footer {
    text-align: center;
    padding: 4px 10px 14px 10px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}