/* ============================================================
   PALETA FINAL
   Tema Escuro : original intacto  (#1a1a2e / #2d2d44)
   Tema Claro  : tons mais escuros (#c8cdd3 / #dde1e6)
   Botão PWA   : dentro do header-center, centralizado, azul escuro com hover dourado
   ============================================================ */

:root {
  /* ── TEMA CLARO (tons mais escuros que o original) ────── */
  --background-color: #c8cdd3;
  --text-color: #0d1013;
  --primary-color: #5a9aee;
  --primary-strong-color: #3d7fd8;
  --secondary-color: #7ed68a;
  --card-bg: #dde1e6;
  --card-shadow: rgba(0, 0, 0, 0.15);
  --button-outline-color: #c0392b;
  --button-hover-text-color: #e6b800;
  --player-one-bg: #8b7eee;
  --player-two-bg: #ee8eee;
  --player-three-bg: #e8a85a;
  --player-four-bg: #ee7a7a;
  --player-five-bg: #5adaee;
  --border-color: #adb4bc;
  --table-header-bg: #c8cdd3;
  --table-stripe-color: #d3d8de;
  --img-border-color: #1a1a2e;
  --cor-moldura-fundo: #7a7aaa;
}

body.dark-mode {
  /* ── TEMA ESCURO original intacto ────────────────────── */
  --background-color: #1a1a2e;
  --text-color: #e0e0e0;
  --primary-color: #556080;
  --primary-strong-color: #6c7faf;
  --secondary-color: #7b9c9f;
  --card-bg: #2d2d44;
  --card-shadow: rgba(0, 0, 0, 0.25);
  --button-outline-color: #e74c3c;
  --button-hover-text-color: #FFD700;
  --player-one-bg: #4a4d6f;
  --player-two-bg: #6b4d6b;
  --player-three-bg: #7f6e4a;
  --player-four-bg: #804a4a;
  --player-five-bg: #4a6f7c;
  --border-color: #495057;
  --table-header-bg: #343a40;
  --table-stripe-color: #2c3034;
  --img-border-color: #e0e0e0;
  --cor-moldura-fundo: #656594;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 100px;
}

main { padding: 2rem 0; }
h1, h2, h3, h4 {
  color: var(--text-color);
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.content-section,
.player-card,
header,
.nav-links,
.nav-links a {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

blockquote {
  border-left: 5px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
}
blockquote footer {
  background: none;
  padding: 0;
  min-height: auto;
  text-align: right;
  font-weight: bold;
  color: var(--text-color);
  margin-top: 0.5rem;
}

/* ============================================================
   TOGGLE DE TEMA
   ============================================================ */
.theme-switch-wrapper { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.theme-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e74c3c; transition: .4s; border-radius: 34px;
}
.slider:before {
  position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
  background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider:before { transform: translateX(22px); }

/* ============================================================
   HEADER
   ============================================================ */
header {
  padding: 1.5rem 5%;
  background-color: var(--card-bg);
  box-shadow: 0 4px 12px var(--card-shadow);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;          /* espaçamento compacto entre logo, data e botão */
}
.header-logo { border-radius: 12px; object-fit: contain; }
.header-logo.side { max-width: 100px; max-height: 100px; }
.header-logo.main { max-width: 200px; max-height: 120px; }

/* ============================================================
   BOTÃO PWA — dentro do header-center
   Azul escuro com texto branco; hover dourado
   Compacto para não pesar no cabeçalho
   ============================================================ */
.btn-install-app {
  display: none;                  /* exibido via JS quando disponível */
  background-color: #1a3a5c;     /* azul escuro */
  color: #ffffff;
  padding: 6px 18px;             /* compacto verticalmente */
  border: 2px solid #1a3a5c;
  border-radius: 20px;           /* pílula arredondada */
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  font-family: inherit;
  transition: background-color 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, transform 0.2s ease;
  /* Fica centralizado dentro do flex do header-center */
  align-self: center;
  margin-top: 0;                 /* gap do flex já cuida do espaço */
}
.btn-install-app:hover,
.btn-install-app:focus {
  background-color: transparent;
  color: #c8a400;                /* dourado no hover */
  border-color: #c8a400;
  transform: scale(1.04);
  outline: none;
}

/* Tema escuro: azul um pouco mais claro para contrastar com o fundo escuro */
body.dark-mode .btn-install-app {
  background-color: #1e4976;
  border-color: #1e4976;
  color: #ffffff;
}
body.dark-mode .btn-install-app:hover,
body.dark-mode .btn-install-app:focus {
  background-color: transparent;
  color: #FFD700;
  border-color: #FFD700;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 5%;
  position: relative;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  gap: 1rem;
}
.nav-links a {
  display: block;
  padding: 0.6rem 1.2rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 2px solid var(--primary-strong-color);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 400;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--card-bg);
  background-color: var(--primary-strong-color);
  border-color: var(--primary-strong-color);
  transform: scale(1.05);
}

#hamburger-btn { display: none; }

/* ============================================================
   SEÇÕES DE CONTEÚDO
   ============================================================ */
.content-section {
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: 0 8px 16px var(--card-shadow);
  padding: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
}
.content-section p { margin-bottom: 1rem; }
.content-section p:last-child { margin-bottom: 0; }
.content-section p a, .content-section ul a, .content-section ol a {
  color: #0056b3; text-decoration: none; font-weight: 500;
}
.content-section p a:hover, .content-section ul a:hover, .content-section ol a:hover {
  text-decoration: underline;
}
body.dark-mode .content-section p a,
body.dark-mode .content-section ul a,
body.dark-mode .content-section ol a {
  color: var(--button-hover-text-color);
}

.texto-destaque { text-align: center; font-size: 1.1rem; }
.texto-citacao { font-style: italic; font-weight: 300; }

/* ============================================================
   PLAYER FIXO (sticky)
   ============================================================ */
.sticky-player-container {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background-color: var(--card-bg);
  box-shadow: 0 -2px 10px var(--card-shadow);
  padding: 1rem; z-index: 1500; text-align: center;
}
.sticky-player-container audio { width: 80%; max-width: 800px; }

/* ============================================================
   SEÇÃO DE RÁDIOS / PLAYERS
   ============================================================ */
.radio-players-section { padding: 2rem 5%; max-width: 1200px; margin: 0 auto; }
.radio-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem;
}
.player-card {
  background-color: var(--card-bg); border-radius: 12px; padding: 1.5rem;
  text-align: center; box-shadow: 0 8px 16px var(--card-shadow);
}
.player-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px var(--card-shadow); }
.player-card iframe { width: 100%; height: 120px; border: none; border-radius: 10px; }
.player-principal { max-width: 800px; margin: 0 auto; border-top: 5px solid var(--secondary-color); }
.player-one   { border-top: 5px solid var(--player-one-bg); }
.player-two   { border-top: 5px solid var(--player-two-bg); }
.player-three { border-top: 5px solid var(--player-three-bg); }
.player-four  { border-top: 5px solid var(--player-four-bg); }
.player-five  { border-top: 5px solid var(--player-five-bg); }

/* ============================================================
   LOGOS / PARCEIROS
   ============================================================ */
.logo-section, .post-footer-partners { padding: 2rem 5%; max-width: 1200px; margin: 0 auto; }
.logo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.2rem;
}
.logo-grid a {
  display: block;
  background-color: var(--cor-moldura-fundo);
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.logo-grid a:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  background-color: #5a5a88;
}
.logo-grid img {
  width: 100%;
  height: 120px;
  object-fit: fill;
  border: 2px solid var(--img-border-color);
  border-radius: 4px;
  display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 2rem 5%; background-color: var(--primary-color); color: #fff;
  position: relative; min-height: 100px; display: flex; align-items: center; justify-content: center;
}
.footer-container p { font-weight: 600; text-align: center; }
.ssl-badge { position: absolute; bottom: 10px; right: 20px; max-width: 100px; height: auto; }

/* ============================================================
   ANIMAÇÃO HAMBÚRGUER
   ============================================================ */
@keyframes pulse-menu {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0    rgba(231, 76, 60, 0.7); }
  70%  { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0    rgba(231, 76, 60, 0); }
}

/* ============================================================
   RESPONSIVO (≤ 992px)
   ============================================================ */
@media (max-width: 992px) {
  .header-logo.side { display: none; }
  .header-container { justify-content: center; }
  #hamburger-btn {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    position: fixed; top: 20px; left: 20px; z-index: 1100; cursor: pointer;
    background-color: var(--card-bg); border: 2px solid var(--button-outline-color);
    border-radius: 50%; width: 45px; height: 45px; padding: 0; animation: pulse-menu 2s infinite;
  }
  #hamburger-btn.menu-aberto { animation: none; transform: scale(1); }
  #hamburger-btn .bar {
    display: block; width: 20px; height: 3px; margin: 3px auto;
    transition: all 0.3s ease-in-out; background-color: var(--button-outline-color);
  }
  .navbar { justify-content: center; }
  .nav-links {
    position: fixed; left: 0; top: 0; height: 100vh; width: 250px;
    background-color: var(--card-bg); flex-direction: column; justify-content: flex-start;
    align-items: stretch; padding: 80px 20px 20px 20px; gap: 0.5rem;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2); z-index: 1050; transform: translateX(-100%);
    visibility: hidden; transition: transform 0.3s ease-in-out, visibility 0s 0.3s;
  }
  .nav-links.nav-open { transform: translateX(0); visibility: visible; transition: transform 0.3s ease-in-out; }
  .nav-links a { text-align: center; }

  /* No responsivo o botão fica ligeiramente maior para toque fácil */
  .btn-install-app {
    font-size: 0.85rem;
    padding: 7px 20px;
  }
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-container { margin: 2.5rem 0; border-radius: 8px; box-shadow: 0 2px 8px var(--card-shadow); border: 1px solid var(--border-color, #e0e0e0); overflow: hidden; }
main table { width: 100%; border-collapse: collapse; }
main th, main td { padding: 12px 15px; border-bottom: 1px solid var(--border-color, #e0e0e0); text-align: left; vertical-align: middle; }
main tbody tr:last-child td { border-bottom: none; }
main th { background-color: var(--table-header-bg, #f2f2f2); color: var(--text-color); font-weight: 600; font-size: 1.1em; text-align: center; }
body.dark-mode main th { color: var(--button-hover-text-color); }
main td h3 { text-align: left; margin-bottom: 0; }
main tbody tr:nth-child(even) { background-color: var(--table-stripe-color, #f9f9f5); }
main td[style*="background-color"] { background-color: inherit !important; }
main table ul { list-style: none; padding: 0; margin: 0; }
main table li { margin-bottom: 0.5rem; }
main table li:last-child { margin-bottom: 0; }
main table a { color: #0056b3; text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
body.dark-mode main table a { color: #bdc1c6; }
main table a:hover, body.dark-mode main table a:hover { color: var(--button-hover-text-color); }

/* ============================================================
   RESPONSIVO — TABELAS (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  .logo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
  .footer-container { justify-content: center; }
  .ssl-badge { position: static; margin-top: 1rem; }
  footer { flex-direction: column; }
  .table-container { box-shadow: none; border: none; overflow-x: hidden; }
  main table { min-width: 100%; }
  main table, main thead, main tbody, main th, main td, main tr { display: block; }
  main thead tr { display: none; }
  main tbody tr { border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 1.5rem; box-shadow: 0 2px 8px var(--card-shadow); overflow: hidden; }
  main td { border: none; border-bottom: 1px solid var(--border-color); position: relative; padding: 15px; }
  main tr td:last-child { border-bottom: 0; }
  main td:first-child { background-color: var(--table-header-bg); font-weight: bold; text-align: center; }
}

/* ============================================================
   GRID DE LIVROS
   ============================================================ */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.5rem; margin-top: 2rem; }

.book-item {
  background-color: var(--cor-moldura-fundo);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  background-color: #5a5a88;
}
.book-item img {
  width: 90px;
  height: 130px;
  object-fit: fill;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border: 2px solid var(--img-border-color);
}
.book-item p { font-size: 0.9rem; font-weight: 500; line-height: 1.3; }

/* ============================================================
   VÍDEOS / CALENDÁRIO
   ============================================================ */
.calendar-container { width: 100%; margin-bottom: 2rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 4px 8px var(--card-shadow); }
.calendar-container iframe { width: 100%; min-height: 200px; border: none; }

.video-responsive-container { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; margin: 1.5rem 0; border-radius: 12px; }
.video-responsive-container iframe { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; border: none; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
main ol { padding-left: 2rem; }
main ol li { margin-bottom: 1rem; }
.content-section audio { width: 100%; max-width: 500px; }

/* ============================================================
   BOTÃO VOLTAR AO TOPO
   ============================================================ */
#backToTopBtn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 100px; right: 30px; z-index: 1600;
  border: none; outline: none;
  background-color: var(--button-outline-color);
  color: white; cursor: pointer; padding: 0;
  border-radius: 50%; width: 50px; height: 50px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s, opacity 0.3s, visibility 0.3s;
  opacity: 0;
  visibility: hidden;
}
#backToTopBtn:hover { background-color: #a93226; }
#backToTopBtn svg { width: 24px; height: 24px; stroke: white; stroke-width: 3; }
#backToTopBtn.show { opacity: 1; visibility: visible; }
