/* ================================================
   Radio Confidencial - Final Premium Design
   With Animated Background & Better Splash
   ================================================ */

:root {
    --color-primary: #FF1E1E;
    --color-bg: #0F0F12;
    --color-text: #F5F5F7;
    --color-text-muted: #8E8E93;
    --bottom-nav-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: #0F0F12;
    color: var(--color-text);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* ================================================
   ANIMATED BACKGROUND with Particles
   ================================================ */
#app::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 30, 30, 0.12), transparent 40%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 30, 30, 0.08), transparent 40%),
        linear-gradient(135deg, #1a1a20 0%, #0F0F12 100%);
    z-index: -1;
    animation: bg-shift 15s ease-in-out infinite;
}

@keyframes bg-shift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-bottom: calc(var(--bottom-nav-h) + 120px);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 10;
}

.app-main.visible {
    opacity: 1;
}

/* ================================================
   SPLASH SCREEN - Premium Design
   ================================================ */
.splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #1a1520 0%, #0F0F12 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.6s, visibility 0.6s;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash__content {
    text-align: center;
    max-width: 400px;
}

.splash__logo {
    width: 180px;
    margin-bottom: 3rem;
    filter: drop-shadow(0 15px 40px rgba(255, 30, 30, 0.4));
    animation: float-logo 3s ease-in-out infinite;
}

@keyframes float-logo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.splash__title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #ddd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash__text {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 350px;
}

.splash__btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff4444 100%);
    color: white;
    border: none;
    padding: 20px 55px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(255, 30, 30, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.3s;
}

.splash__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 60px rgba(255, 30, 30, 0.6);
}

.splash__btn:active {
    transform: scale(0.97);
}

.splash__btn img {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
}

.splash__link {
    display: block;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding-bottom: 2px;
}

/* ================================================
   PLAYER
   ================================================ */
.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    margin-top: 10px;
}

.player__visual {
    position: relative;
    width: 75vw;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.player__artwork {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.08);
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s;
    margin-top: 30px;
}

.player.is-playing .player__artwork {
    transform: scale(1.04);
    box-shadow: 0 30px 80px rgba(255, 30, 30, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.12);
}

.player__artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player.is-playing .player__artwork img {
    animation: spin-disc 6s linear infinite;
}
@keyframes spin-disc {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Equalizer - REAL AUDIO VISUALIZATION STYLE */
.player__equalizer {
    display: flex;
    gap: 5px;
    height: 32px;
    align-items: flex-end;
    justify-content: center;
}

.player__equalizer span {
    width: 5px;
    background: linear-gradient(180deg, var(--color-primary), #ff6666);
    border-radius: 3px 3px 0 0;
    height: 6px;
    box-shadow: 0 0 10px rgba(255, 30, 30, 0.5);
    transform-origin: bottom;
}

.player.is-playing .player__equalizer span {
    animation: eq-bar 1.2s ease-in-out infinite;
}

/* CRITICAL: Different delays and durations for realistic effect */
.player__equalizer span:nth-child(1) { animation-delay: 0s; animation-duration: 0.9s; }
.player__equalizer span:nth-child(2) { animation-delay: 0.2s; animation-duration: 1.1s; }
.player__equalizer span:nth-child(3) { animation-delay: 0.4s; animation-duration: 0.8s; }
.player__equalizer span:nth-child(4) { animation-delay: 0.1s; animation-duration: 1.3s; }
.player__equalizer span:nth-child(5) { animation-delay: 0.3s; animation-duration: 1s; }

@keyframes eq-bar {
    0% { height: 6px; }
    15% { height: 28px; }
    30% { height: 12px; }
    50% { height: 32px; }
    70% { height: 18px; }
    85% { height: 25px; }
    100% { height: 6px; }
}

/* Player Info */
.player__info {
    text-align: center;
}

.player__station {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.player__song {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-bottom: 1rem;
    min-height: 1.5em;
}

/* Floating Badges */
.player__live-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 30, 30, 0.9);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 2px solid #0F0F12;
    transform: translate(-10%, -10%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 10;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

.player__listeners-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(30, 30, 35, 0.9);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #0F0F12;
    transform: translate(10%, -10%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 10;
}

.listener-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.player__listeners-badge span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Controls */
.player__controls {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}
@media (max-width: 420px) {
    .player__visual { width: 65vw; max-width: 220px; }
    .player__station { font-size: 1.5rem; margin-bottom: 0.25rem; display: none; }
    .player__song { font-size: 0.95rem; margin-bottom: 1.5rem; }
    .player__controls { gap: 1.5rem; }
    .player__btn--play { width: 72px; height: 72px; }
    .player__btn--play img { width: 32px; height: 32px; }
    .player__btn--secondary { width: 44px; height: 44px; }
    .player__btn--secondary img { width: 20px; height: 20px; }
    
    :root { --bottom-nav-h: 64px; }
    .bottom-nav { bottom: 16px; }
    .app-main { padding-bottom: calc(var(--bottom-nav-h) + 100px); }
    
    .player__volume-slider { bottom: 140px; }
}

.player__btn {
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.player__btn:active { transform: scale(0.92); }

.player__btn--secondary {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player__btn--secondary img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(0.7);
}

.player__btn--play {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 50px rgba(255, 30, 30, 0.5);
}
.player__btn--play::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 30, 30, 0.35);
    transform: scale(0.95);
    opacity: 0.7;
}
.player.is-playing .player__btn--play::after {
    animation: pulse-ring 1.4s ease-in-out infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 0.45; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* CRITICAL FIX: Hide inactive icon */
.player__btn--play img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
    position: absolute;
}

#pauseIcon {
    display: none;
}

.player.is-playing #playIcon {
    display: none;
}

.player.is-playing #pauseIcon {
    display: block;
}

/* Volume Slider */
.player__volume-slider {
    position: absolute;
    bottom: 160px;
    background: rgba(30, 30, 35, 0.98);
    backdrop-filter: blur(30px);
    padding: 16px 26px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
    visibility: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 150;
}

.player__volume-slider.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.player__volume-slider input[type="range"] {
    width: 160px;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.player__volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 30, 30, 0.6);
}

/* ================================================
   BOTTOM NAV - Floating Island
   ================================================ */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    height: var(--bottom-nav-h);
    background: rgb(107 0 0);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7);
    z-index: 100;
}

.nav-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(0.5);
    transition: filter 0.3s, transform 0.3s;
}

.nav-btn.active {
    color: #ffffff;
}

.nav-btn.active img {
    filter: brightness(0) invert(1) sepia(1) saturate(10000%) hue-rotate(
327deg) brightness(1.1);
    transform: scale(1.15);
}

/* ================================================
   PANELS
   ================================================ */
.panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1c1c20 0%, #18181c 100%);
    border-radius: 32px 32px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -15px 60px rgba(0, 0, 0, 0.8);
}

.panel.open { transform: translateY(0); }

.panel__header {
    padding: 26px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel__title {
    font-weight: 800;
    font-size: 1.25rem;
}

.panel__close {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.panel__close:active {
    background: rgba(255, 255, 255, 0.1);
}

.panel__close img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    filter: brightness(0) invert(1);
}

.panel__content {
    padding: 26px;
    overflow-y: auto;
    flex: 1;
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 150;
}

.panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ================================================
   SOCIAL GRID - WITH BRAND COLORS
   ================================================ */
.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--social-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.social-card:active {
    transform: scale(0.96);
}

.social-card:active::before {
    opacity: 0.15;
}

/* CRITICAL: Show icons with their brand colors */
.social-icon {
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 1;
    filter: none !important;
    transition: transform 0.2s;
}

.social-card:active .social-icon {
    transform: scale(1.12);
}

.social-card span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    position: relative;
    z-index: 1;
}

/* Info Panel */
.info-section {
    margin-bottom: 2rem;
}

.info-about {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    text-align: center;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 1.5rem;
}

.info-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    color: var(--color-text);
}

.info-item span {
    font-size: 0.92rem;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
}

.history-item span {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* Dev Panel */
.more-section {
    margin-bottom: 2rem;
}

.more-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.dev-links {
    display: flex;
    gap: 14px;
    margin-top: 1.2rem;
}

.dev-link {
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background 0.2s, border-color 0.2s;
}

.dev-link:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
}

.more-section--version {
    text-align: center;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Animated musical notes background */
.bg-notes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.note {
    position: absolute;
    color: rgba(255,255,255,0.15);
    font-size: 16px;
    animation: rise 6s linear forwards;
    will-change: transform, opacity;
    bottom: -10vh;
}
.note__glyph {
    display: block;
    will-change: transform;
    animation: sway 3s ease-in-out infinite;
}
@keyframes rise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-120vh); opacity: 0; }
}
@keyframes sway {
    0% { transform: translateX(0); }
    50% { transform: translateX(15px); }
    100% { transform: translateX(0); }
}
