/*!
 * AppShell — estilos
 * Cascarón de navegación por pestañas para integrar varias secciones
 * (radio, iglesia, sermones, eventos, oración, donaciones, video en
 * vivo…) en una sola experiencia, mostrando una sección a la vez en
 * vez de saturar la pantalla con todo junto. Independiente.
 */

.hub {
  --hub-bg: #0a1020;
  --hub-bg-2: #10182b;
  --hub-card: #182342;
  --hub-accent: #e2a63b;
  --hub-accent-2: #f4c469;
  --hub-live: #ef4444;
  --hub-text: #ffffff;
  --hub-text-dim: #a9b3c9;
  --hub-border: rgba(255, 255, 255, 0.1);

  min-height: 100vh;
  background: radial-gradient(circle at top, var(--hub-bg-2) 0%, var(--hub-bg) 60%);
  color: var(--hub-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  /* Deja espacio abajo para la barra de radio persistente + la barra
     de pestañas en celular, para que nunca tapen el contenido. */
  padding-bottom: calc(64px + 74px + env(safe-area-inset-bottom, 0px));
}
.hub *, .hub *::before, .hub *::after { box-sizing: border-box; }

/* ---------- Encabezado ---------- */
.hub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hub-border);
}
.hub-brand { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.hub-brand-icon { font-size: 1.25rem; }

/* ---------- Navegación por pestañas ---------- */
.hub-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hub-border);
  scrollbar-width: none;
}
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--hub-border);
  background: var(--hub-card);
  color: var(--hub-text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.hub-tab.is-active { background: linear-gradient(155deg, var(--hub-accent-2), var(--hub-accent)); color: #161018; border-color: transparent; }
.hub-tab-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hub-live);
  display: none;
  animation: hub-pulse 1.4s ease-in-out infinite;
}
.hub-tab.has-live .hub-tab-live-dot { display: inline-block; }
@keyframes hub-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Paneles de sección ---------- */
.hub-panels { padding: 20px; max-width: 880px; margin: 0 auto; }
.hub-panel { display: none; }
.hub-panel.is-active { display: block; animation: hub-fade .18s ease; }
@keyframes hub-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hub-panel-title { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px; }
.hub-panel-subtitle { font-size: 0.84rem; color: var(--hub-text-dim); margin: 0 0 20px; }
.hub-section + .hub-section { margin-top: 30px; }
.hub-section-heading { font-size: 0.72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--hub-text-dim); margin-bottom: 10px; }

/* ---------- Inicio: tarjetas rápidas ---------- */
.hub-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.hub-quick-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px; border-radius: 14px;
  background: var(--hub-card); border: 1px solid var(--hub-border);
  cursor: pointer; text-align: left; color: var(--hub-text);
  font-family: inherit;
}
.hub-quick-card:hover { background: #1d2a4d; }
.hub-quick-icon { font-size: 1.3rem; }
.hub-quick-label { font-size: 0.86rem; font-weight: 700; }
.hub-quick-desc { font-size: 0.74rem; color: var(--hub-text-dim); }

.hub-live-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 18px;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.hub-live-banner.is-visible { display: flex; }
.hub-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hub-live); animation: hub-pulse 1.4s ease-in-out infinite; flex: none; }

/* ---------- Barra de radio persistente (siempre visible) ---------- */
.hub-radio-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(10, 16, 32, 0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--hub-border);
}

/* ---------- Barra de pestañas fija en celular (estilo app) ---------- */
@media (max-width: 720px) {
  .hub-tabs {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 39;
    background: rgba(10, 16, 32, 0.96);
    margin: 0;
    border-top: 1px solid var(--hub-border);
    border-bottom: none;
    justify-content: flex-start;
  }
  .hub-panels { padding: 16px; }
}
