/* ==========================================================================
   GOSPEL NEWS - Design System & Modern Portal Styles
   Paleta: Navy Blue (#050B18), Crimson Red (#FF2A4D), Electric Blue (#00A8FF), Gold (#FFB800)
   Tipografia: Plus Jakarta Sans (Headings) & Inter (Body)
   ========================================================================== */

:root {
  /* Cores Principais inspiradas na Marca Gospel News */
  --bg-dark: #050B18;
  --bg-surface: #0A1329;
  --bg-sidebar: #070E20;
  --bg-card: rgba(13, 25, 52, 0.75);
  --bg-card-hover: rgba(18, 34, 70, 0.9);

  /* Acentos de Cor */
  --red-primary: #FF2A4D;
  --red-dark: #D0122D;
  --red-glow: rgba(255, 42, 77, 0.35);
  --red-gradient: linear-gradient(135deg, #FF2A4D 0%, #B80A24 100%);

  --blue-primary: #00A8FF;
  --blue-dark: #0066FF;
  --blue-glow: rgba(0, 168, 255, 0.35);
  --blue-gradient: linear-gradient(135deg, #00A8FF 0%, #0052D4 100%);

  --gold-accent: #FFB800;
  --gold-glow: rgba(255, 184, 0, 0.25);

  /* Texto */
  --text-white: #FFFFFF;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dark: #64748B;

  /* Bordas e Vidro */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 168, 255, 0.4);
  --border-hover: rgba(255, 42, 77, 0.4);

  /* Tipografia */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Efeitos */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Reset Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 168, 255, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(255, 42, 77, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Mobile Navigation Header
   -------------------------------------------------------------------------- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  z-index: 1100;
  backdrop-filter: blur(12px);
}

.mobile-logo-img {
  height: 36px;
  object-fit: contain;
}

.mobile-toggle {
  background: transparent;
  border: none;
  width: 38px;
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-white);
  border-radius: 2px;
  transition: var(--transition);
}

/* --------------------------------------------------------------------------
   Sidebar (Menu Lateral)
   -------------------------------------------------------------------------- */
aside {
  width: 300px;
  background-color: var(--bg-sidebar);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-glass);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-main);
}

.sidebar-brand {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.brand-logo-img {
  width: 100%;
  max-width: 210px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.brand-logo-img:hover {
  transform: scale(1.03);
}

.brand-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  background: rgba(255, 42, 77, 0.15);
  color: var(--red-primary);
  border: 1px solid rgba(255, 42, 77, 0.3);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--red-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-primary);
  animation: pulseDot 1.5s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--red-primary); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  line-height: 1.3;
}

.filter-section {
  margin-bottom: 2rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title h3 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  font-weight: 700;
}

.portal-count-badge {
  background: var(--blue-gradient);
  color: var(--text-white);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
}

.portal-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon {
  font-size: 0.95rem;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border-color: var(--border-active);
  transform: translateX(3px);
}

.filter-btn.active {
  background: linear-gradient(90deg, rgba(0, 168, 255, 0.15) 0%, rgba(255, 42, 77, 0.05) 100%);
  color: var(--text-white);
  border: 1px solid var(--blue-primary);
  box-shadow: 0 0 15px rgba(0, 168, 255, 0.15);
  font-weight: 600;
}

#dynamic-categories {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.75rem;
  color: var(--text-dark);
  text-align: center;
}

.sidebar-footer .curator {
  margin-top: 0.3rem;
  color: var(--text-muted);
}

.sidebar-footer strong {
  color: var(--blue-primary);
}

/* --------------------------------------------------------------------------
   Main Area
   -------------------------------------------------------------------------- */
main {
  flex: 1;
  margin-left: 300px;
  padding: 2.5rem 3rem;
  min-width: 0;
}

.main-header {
  margin-bottom: 2.5rem;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 168, 255, 0.1);
  color: var(--blue-primary);
  border: 1px solid rgba(0, 168, 255, 0.25);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 1rem;
}

.pulse-dot-red {
  width: 8px;
  height: 8px;
  background-color: var(--blue-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--blue-primary);
  animation: pulseBlue 1.8s infinite;
}

@keyframes pulseBlue {
  0% { opacity: 0.4; }
  50% { opacity: 1; box-shadow: 0 0 14px var(--blue-primary); }
  100% { opacity: 0.4; }
}

.brand-heading {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}

.main-subtitle-h2,
.header-titles h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.5vw, 2.3rem);
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.35;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  max-width: 900px;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 650px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

#theme-search {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 0.95rem 2.8rem 0.95rem 3rem;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#theme-search:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 20px rgba(0, 168, 255, 0.25);
  background: rgba(13, 25, 52, 0.95);
}

.clear-search {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-primary);
  line-height: 1.2;
}

.stat-desc {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  font-weight: 600;
}

.refresh-action-btn {
  background: var(--red-gradient);
  color: var(--text-white);
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--red-glow);
}

.refresh-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 42, 77, 0.5);
}

.refresh-action-btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   News Grid & Cards
   -------------------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.75rem;
}

.news-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.6rem;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue-gradient);
  opacity: 0.7;
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 168, 255, 0.15);
}

.news-card:hover::before {
  height: 4px;
  background: var(--red-gradient);
  opacity: 1;
}

.card-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-tag {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  background: rgba(0, 168, 255, 0.12);
  color: var(--blue-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 168, 255, 0.25);
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 500;
}

.news-card h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.8rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  margin-top: auto;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--red-primary);
  font-size: 0.78rem;
}

.read-more-link {
  color: var(--blue-primary);
  font-weight: 600;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.news-card:hover .read-more-link {
  color: var(--text-white);
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Modal de Leitura
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-content {
  background: var(--bg-surface);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
  padding: 2.5rem;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 168, 255, 0.1);
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.close-modal:hover {
  background: var(--red-primary);
  color: var(--text-white);
  border-color: var(--red-primary);
}

.modal-header-meta {
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.35;
  margin-top: 0.6rem;
  margin-bottom: 1rem;
}

.modal-meta-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.modal-portal-name {
  color: var(--red-primary);
  font-weight: 700;
}

.modal-external-link {
  color: var(--blue-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.modal-external-link:hover {
  text-decoration: underline;
}

.analysis-section {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analysis-item {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 14px;
  border-left: 3px solid var(--blue-primary);
}

.analysis-item h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--blue-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.analysis-item p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-main);
}

.content-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.idea-chip {
  background: rgba(255, 42, 77, 0.12);
  color: var(--red-primary);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 42, 77, 0.25);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.news-card {
  animation: fadeInUp 0.4s ease forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue-primary);
}

/* --------------------------------------------------------------------------
   Responsive Design & Mobile Optimization
   -------------------------------------------------------------------------- */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(6px);
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
  aside {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    width: 290px;
  }

  aside.active {
    transform: translateX(0);
  }

  .mobile-nav {
    display: flex;
  }

  main {
    margin-left: 0;
    padding: 5.5rem 1.5rem 2.5rem;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .search-box {
    max-width: 100%;
  }

  .stats-bar {
    justify-content: space-between;
    width: 100%;
  }

  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  main {
    padding: 5rem 1rem 2rem;
  }

  .header-titles h2 {
    font-size: 1.75rem;
  }

  .header-titles p {
    font-size: 0.9rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card {
    padding: 1.25rem;
    border-radius: 14px;
  }

  .news-card h2 {
    font-size: 1.05rem;
  }

  .stats-bar {
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.5rem 1rem;
  }

  .refresh-action-btn {
    padding: 0.7rem 1.1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 380px) {
  .header-titles h2 {
    font-size: 1.5rem;
  }

  #theme-search {
    font-size: 0.85rem;
    padding-left: 2.5rem;
  }
}
