/* ==========================================================================
   RESET PARA APP NATIVO ANDROID Legados & Modernos
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 🚨 NOVO: Camada física isolada para o Wallpaper rodar liso no hardware do celular */
#bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: -2; /* Fica atrás de tudo, inclusive do overlay */
}

/* Camada física de opacidade estável sobreposta ao body (Adaptativa para os Temas) */
#bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-overlay-color);
    transition: background-color 0.4s ease;
    pointer-events: none;
    z-index: -1; /* Fica na frente da imagem, mas atrás dos componentes */
}

body {
    background-color: var(--bg-body);
    /* 🚨 Removido os comandos de background daqui para evitar o conflito do WebView */
    color: var(--text-white);
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    transition: background-color 0.4s ease;
}

/* ==========================================================================
   CLASSES UTILITÁRIAS E POSICIONAMENTO GLOBAL DO MODELO SPA
   ========================================================================== */
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* Camadas de Profundidade Crítica (Z-Index Hierarchy Stack) */
.z-5 { z-index: 5; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-medium { z-index: 5000; }
.z-high { z-index: 8000; }
.z-top { z-index: 9999; }

/* Utilitários de Flexbox Estruturais Rápidos */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tipografia e Tokens Estáticos de Texto */
.text-yellow { color: var(--color-yellow); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: monospace; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.w-5 { width: 20px; }
.h-5 { height: 20px; }
.w-16 { width: 64px; }
.h-16 { height: 64px; }
.fill-current { fill: currentColor; }
.shadow-premium { box-shadow: 0 15px 35px rgba(0,0,0,0.4); }

/* Animações Core Nativas do Aplicativo */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes spinRing { to { transform: rotate(360deg); } }
@keyframes marqueeRun { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-100%,0,0); } }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.5; } }

/* ==========================================================================
   ESTRUTURA FIXA E COMPORTAMENTO DE ROLAGEM (MAIN APP SHELL)
   ========================================================================== */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 40;
    background-color: var(--bg-body);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background-color 0.4s ease;
}
.ticker-wrapper {
    width: 100%;
    background-color: var(--color-blue-alpha);
    border-bottom: 1px solid var(--color-blue-alpha);
    color: var(--color-blue);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 0;
    overflow: hidden;
    white-space: nowrap;
}
.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeRun 22s linear infinite;
}
.header-banner-viewport {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
}
.banner-img-render {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-body) 10%, rgba(4,6,10,0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-brand-text {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* Área Central de Rolagem Independente Contra Gargalo de Layout */
.main-scroller {
    width: 100%;
    max-width: 480px;
    height: 100%;
    margin: 0 auto;
    padding: 110px 16px 150px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.main-scroller::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   ALIGNMENT UTILS & GRID CONTAINERS SIZES
   ========================================================================== */
.ui-card-container, .news-section-wrapper {
    width: 100%;
    max-width: 340px;
    margin: 24px auto 0 auto;
}
.ui-section-title, .news-section-title, .section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-white);
    text-align: left;
    width: 100%;
}
.ui-list-vertical, .list-vertical, .news-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* ==========================================================================
   VISUAL DE COMPONENTES: GLASSMORPHISM DESFOQUE NATIVO (MULTI-TEMAS)
   ========================================================================== */
.ui-list-vertical > div, 
.list-vertical > div, 
.news-card-item, 
.channel-row-link, 
.ui-card {
    background-color: var(--bg-card-alpha); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--border-style);
    padding: 14px 16px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    transition: background-color 0.4s ease, border 0.4s ease;
}

.ui-card:hover, .news-card-item:hover {
    border: 1px solid var(--color-blue);
}

.ui-card, .settings-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ui-card-row, .settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    border-bottom: var(--border-style);
}

.ui-card-row:last-child, .settings-row:last-child {
    border-bottom: none;
}

.ui-card-label, .settings-label {
    color: var(--text-muted);
    font-size: 14px;
}

.badge-blue {
    background-color: var(--color-blue-alpha);
    color: var(--color-blue);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
}

/* ==========================================================================
   BLOCO DE COMPONENTES: HOME (FEED DE INFORMAÇÕES)
   ========================================================================== */
.news-card-item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 12px;
    border-radius: 12px;
}
.news-card-tag {
    font-size: 9px;
    font-weight: 800;
    color: var(--color-blue);
    text-transform: uppercase;
}
.news-card-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    margin: 4px 0;
}
.news-card-body {
    font-size: 12px;
    color: var(--text-muted);
}
.ui-grid-layout, .channels-grid {
    display: block;
    width: 100%;
}
.channel-row-link {
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-white);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 10px;
}
.channel-row-link span.btn-action-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-blue);
    text-transform: uppercase;
}

/* ==========================================================================
   BLOCO DE DESIGN: LOGO VETORIAL EM CSS PURA (HOME SHELL)
   ========================================================================== */
.logo-album-frame {
    width: 200px;
    height: 200px;
    background-color: var(--bg-logo-frame);
    border-radius: 28px;
    position: relative;
    margin: 0 auto 16px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    transition: background-color 0.4s ease;
}
.gospel-lettering {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--color-blue);
    text-shadow: 0 0 10px rgba(61,154,243,0.4);
    line-height: 1.1;
}
.flow-lettering-container {
    position: relative;
    margin-top: -6px;
}
.flow-lettering {
    font-family: 'Great Vibes', cursive;
    font-size: 44px;
    color: var(--color-yellow);
    text-shadow: 0 2px 8px rgba(254,225,40,0.3);
}
.pontilhados {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130%;
    height: 130%;
    transform: translate(-50%, -50%);
    background-image: radial-gradient(var(--color-yellow) 1.5px, transparent 1.5px), radial-gradient(#66d9e8 1.5px, transparent 1.5px);
    background-size: 14px 14px;
    background-position: 0 0, 7px 7px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}
.decor-item {
    position: absolute;
    font-weight: bold;
    opacity: 0.8;
    font-size: 18px;
}
.decor-item.nota-amarela { top: 15px; right: 15px; color: var(--color-yellow); transform: rotate(12deg); }
.decor-item.nota-azul { bottom: 15px; left: 15px; color: var(--color-blue); transform: rotate(-15deg); }
.decor-item.x-icon { top: 20px; left: 20px; color: var(--color-blue); font-size: 16px; }

.fade-shadow-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(15,28,63,0.9), transparent);
    pointer-events: none;
    z-index: 25;
}
.live-status-pill {
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px auto 0 auto;
}
.live-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
    animation: pulseDot 1.5s infinite;
}
.live-text {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

/* ==========================================================================
   CARROSSEL ANIMAÇÃO: SLIDER COMPONENT (AGENDA)
   ========================================================================== */
.schedule-slider-wrapper {
    width: 100%;
    height: 130px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 24px auto;
    border: 1px solid var(--border-style);
}
.schedule-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
}
.schedule-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 16px;
}
.schedule-overlay-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
}

/* ==========================================================================
   MODAIS DINÂMICOS (SESSÃO DE ACESSO CRÍTICO)
   ========================================================================== */
.modal-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-modal {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 24px;
    width: 280px;
    text-align: center;
}
.btn-primary {
    display: block;
    width: 100%;
    background-color: var(--color-blue);
    color: #000000;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    padding: 12px;
    border-radius: 14px;
    text-align: center;
    text-transform: uppercase;
    border: none;
}
.card-startup {
    position: relative;
    width: 280px;
    border-radius: 24px;
    overflow: hidden;
    background-color: var(--bg-card);
}
.img-fluid-cover {
    width: 100%;
    height: auto;
    display: block;
}
.btn-close-startup {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    border: none;
    padding: 8px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 50;
}

/* ==========================================================================
   BARRA DE CONTROLE AUDIO PLAYER DESTAQUE (EVOLUÇÃO PREMIUM LOUNGE)
   ========================================================================== */
.sticky-player {
    position: fixed;
    bottom: 75px;
    height: 84px;
    left: 16px;
    right: 16px;
    /* Glassmorphism de nível internacional */
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    padding: 0 20px;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    
    /* Transições suaves para a injeção do Glow Dinâmico */
    transition: background-color 0.4s ease, border 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
}

/* 🚨 CLASSE INJETADA PELO JS: Quando der play, o app projeta o Neon do respectivo tema ativo */
.sticky-player.player-active {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--color-blue-alpha);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.player-left-block {
    display: flex;
    align-items: center;
    width: 75%;
    gap: 14px;
}

.album-avatar-thumb {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
}

#music-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px !important;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efeito micro-interativo na logo quando o som estiver ativo */
.player-active #music-placeholder {
    transform: scale(1.05);
}

.live-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.live-dot-led {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.live-dot-led.online {
    background-color: #22c55e;
    box-shadow: 0 0 10px #22c55e, 0 0 4px #22c55e;
}

/* Linha de progresso acústico ultrafina estilo iOS */
.audio-progress-bar {
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-blue), var(--color-yellow));
    box-shadow: 0 0 8px var(--color-blue);
    transition: width 0.1s linear;
}

/* Botão Flutuante Hidrodinâmico */
.play-btn-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play-trigger {
    width: 46px;
    height: 46px;
    background: var(--text-white); /* Cor padrão limpa */
    color: #000000;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

/* Quando estiver tocando, o botão absorve a cor de destaque do tema ativo */
.player-active .btn-play-trigger {
    background: var(--color-active);
    color: #ffffff;
    box-shadow: 0 6px 16px var(--color-blue-alpha);
}

.btn-play-trigger:active {
    transform: scale(0.92);
}

/* Spinner Orbitador Holográfico */
.spinner-ring {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--color-blue);
    border-bottom-color: var(--color-yellow);
    animation: spinRing 1s cubic-bezier(0.55, 0.085, 0.68, 0.53) infinite;
    z-index: 1;
}

/* ==========================================================================
   BARRA DE NAVEGAÇÃO INFERIOR DOCK BAR (ATUALIZADA)
   ========================================================================== */
.dock-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-dock);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    transition: background-color 0.4s ease;
}
.dock-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    /* 🚨 Cor inativa controlada pela variável do tema ativo */
    color: var(--color-inactive);
    font-size: 10px;
    font-weight: 700;
    width: 25%;
    transition: color 0.3s ease;
}
.dock-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}
/* 🚨 Estado ativo herda dinamicamente o tom destaque (azul, roxo, ciano) */
.dock-btn.active {
    color: var(--color-active) !important;
}
.dock-btn.active svg {
    stroke: var(--color-active) !important;
}



/* ==========================================================================
   ESTRUTURA DEDICADA: CENTRAL DE NOTIFICAÇÕES (CORREÇÃO DE LAYOUT)
   ========================================================================== */
.card-notifications {
    background-color: var(--bg-card-color, var(--bg-card));
    border: var(--border-style);
    border-radius: 24px;
    padding: 20px 18px;
    width: 100%;
    max-width: 320px;
    height: 380px; /* Altura física fixa ideal para não achatar no Android */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* Força os balões de avisos injetados a ocuparem 100% da largura alinhados à esquerda */
#notifications-container > div {
    flex-shrink: 0; /* Impede o motor do WebView de esmagar o balão individual */
    text-align: left !important;
}

/* Oculta barras de rolagem nativas feias do Android mantendo a função de scroll ativa */
#notifications-container::-webkit-scrollbar {
    display: none !important;
}

/* ==========================================================================
   ELEMENTOS DE COMPONENTES AVANÇADOS (FOTOS DE GRADE & CARROSSEL DE MARCAS)
   ========================================================================== */

/* Moldura redonda para os Locutores da Grade */
.schedule-profile-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: var(--border-style);
    background-color: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Mecanismo de Carrossel Horizontal Invisível para Patrocinadores */
.sponsors-scroller {
    width: 100%;
    overflow-x: auto;
    padding: 6px 4px 10px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Oculta no Firefox */
}
.sponsors-scroller::-webkit-scrollbar {
    display: none !important; /* Oculta no Chrome/WebView Android */
}

/* Estilização individual das bolinhas de patrocínio */
.sponsor-circle-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: var(--border-style);
    background-color: var(--bg-card-alpha);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    padding: 3px;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.sponsor-circle-btn:active {
    transform: scale(0.92);
    border-color: var(--color-blue);
}

/* 🚨 NOVO: Alinhamento perfeito do botão X no topo direito da Caixa */
.sponsor-close-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: -10px; /* Puxa levemente para cima equilibrando o topo */
}

/* 🚨 NOVO: Otimização Estrutural do Modal de Patrocinadores (Respiro Premium) */
#sponsor-detail-modal .card-modal {
    width: 310px; /* Aumentado sutilmente para os textos respirarem */
    max-height: 85vh;
    padding: 24px 22px 28px 22px; /* Mais espaçamento interno */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* Espaçamentos dinâmicos internos da caixa do Patrocinador */
#sponsor-modal-name {
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.3;
}

#sponsor-modal-city {
    margin-bottom: 16px;
    letter-spacing: 1px;
}

#sponsor-modal-desc {
    margin-bottom: 24px; /* Dá espaço antes da linha divisória */
    line-height: 1.6;
    text-align: center;
}

/* Rodapé do Modal (Telefone + Botão de Visita) */
#sponsor-detail-modal .flex-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Aumenta a distância interna entre o telefone e o botão */
}