/* =========================================================
   TECH HUB — Neural Design System v2
   Tema futurista neural com glassmorphism e neon glow
   Fonte: Inter (Google Fonts)
   ========================================================= */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Neural Dark (padrão) */
  --bg-void:        #04060f;
  --bg-primary:     #060c1a;
  --bg-secondary:   #080f20;
  --bg-tertiary:    #0d1730;
  --bg-card:        rgba(8, 14, 30, 0.88);
  --bg-card-hover:  rgba(10, 20, 42, 0.95);
  --bg-glass:       rgba(6, 11, 28, 0.7);

  --border:         rgba(0, 180, 255, 0.08);
  --border-subtle:  rgba(0, 180, 255, 0.04);
  --border-hover:   rgba(0, 229, 255, 0.25);
  --border-glow:    rgba(0, 229, 255, 0.5);

  --text-primary:   #e8f0fe;
  --text-secondary: #8ba3cc;
  --text-muted:     #4a6080;
  --text-nano:      #334a66;

  /* Accent neon */
  --neon-cyan:      #00e5ff;
  --neon-purple:    #bf5af2;
  --neon-pink:      #ff2d78;
  --neon-green:     #00ff94;
  --neon-orange:    #ff9f0a;

  /* Categoria */
  --cat-dc:         #00b4d8;
  --cat-dc-glow:    rgba(0, 180, 216, 0.35);
  --cat-dc-bg:      rgba(0, 180, 216, 0.1);
  --cat-sec:        #ff3366;
  --cat-sec-glow:   rgba(255, 51, 102, 0.35);
  --cat-sec-bg:     rgba(255, 51, 102, 0.1);
  --cat-ia:         #bf5af2;
  --cat-ia-glow:    rgba(191, 90, 242, 0.35);
  --cat-ia-bg:      rgba(191, 90, 242, 0.1);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-card:    0 4px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow:    0 0 24px rgba(0, 229, 255, 0.12);
}

[data-theme="light"] {
  --bg-void:        #edf2f7;
  --bg-primary:     #f0f5fb;
  --bg-secondary:   #ffffff;
  --bg-tertiary:    #e8eef8;
  --bg-card:        rgba(255, 255, 255, 0.95);
  --bg-card-hover:  rgba(240, 248, 255, 1);
  --bg-glass:       rgba(255, 255, 255, 0.85);
  --border:         rgba(0, 100, 200, 0.1);
  --border-subtle:  rgba(0, 100, 200, 0.05);
  --border-hover:   rgba(0, 180, 255, 0.3);
  --border-glow:    rgba(0, 180, 255, 0.5);
  --text-primary:   #0d1b2e;
  --text-secondary: #3a5070;
  --text-muted:     #7a95b5;
  --text-nano:      #a0b5cc;
  --shadow-card:    0 4px 20px rgba(0, 80, 180, 0.08);
  --shadow-glow:    0 0 20px rgba(0, 140, 255, 0.1);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,229,255,0.25) transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  position: relative;
  overflow-x: hidden;
}

/* Neural grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 180, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 90, 200, 0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* All content above background layers */
.header, .filters-section, .main-content, .footer { position: relative; z-index: 1; }

/* ---------- HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 6, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 1px 0 rgba(0, 180, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 rgba(0, 140, 255, 0.15), 0 4px 20px rgba(0, 60, 160, 0.06);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text-primary);
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
  color: #fff;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(0, 229, 255, 0.4); }
  50%       { box-shadow: 0 0 28px rgba(0, 229, 255, 0.7), 0 0 48px rgba(191, 90, 242, 0.3); }
}
.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.logo-text strong {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-badge {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
}

/* Centro */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(0, 255, 148, 0.4);
  animation: statusPulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
.status-dot.offline { background: var(--neon-pink); box-shadow: 0 0 10px var(--neon-pink); }
.status-dot.loading {
  background: var(--neon-orange);
  box-shadow: 0 0 10px var(--neon-orange);
  animation: statusSpin 1s linear infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
@keyframes statusSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.status-text { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.relogio {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

/* Ações do header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.refresh-info {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted);
}
.refresh-label { display: none; }
.refresh-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  min-width: 34px;
}

.btn-refresh, .btn-theme {
  background: rgba(0, 180, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 15px;
  backdrop-filter: blur(8px);
}
.btn-refresh:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3), inset 0 0 12px rgba(0, 229, 255, 0.05);
  background: rgba(0, 229, 255, 0.08);
}
.btn-theme:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 12px rgba(191, 90, 242, 0.3);
  background: rgba(191, 90, 242, 0.08);
}
.btn-refresh.spinning .icon-refresh { animation: spin 0.7s linear infinite; }
.icon-refresh { width: 15px; height: 15px; }

/* ---------- COTAÇÕES BAR ---------- */
.cotacoes-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 32px;
  padding: 0 28px;
  background: rgba(2, 4, 12, 0.7);
  border-top: 1px solid rgba(0, 180, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.cotacao-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.cotacao-icon {
  font-size: 11px;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.7);
  line-height: 1;
  width: 13px;
  text-align: center;
  flex-shrink: 0;
}
.cotacao-icon--eur { color: #a78bfa; text-shadow: 0 0 8px rgba(167, 139, 250, 0.7); }
.cotacao-icon--btc { color: var(--neon-orange); text-shadow: 0 0 8px rgba(255, 159, 10, 0.7); }

.cotacao-sigla {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.cotacao-valor {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.cotacao-var {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 54px;
}
.cotacao-var.up   { color: #00ff94; text-shadow: 0 0 8px rgba(0, 255, 148, 0.6); }
.cotacao-var.down { color: var(--neon-pink); text-shadow: 0 0 8px rgba(255, 45, 120, 0.6); }
.cotacao-var.neutral { color: var(--text-muted); }

.cotacao-sep {
  width: 1px;
  height: 14px;
  background: rgba(0, 180, 255, 0.15);
  margin: 0;
  flex-shrink: 0;
}

.cotacao-timer {
  position: absolute;
  right: 24px;
  font-size: 9px;
  color: var(--text-nano);
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cotacao-timer::before {
  content: '⏱';
  font-size: 9px;
  font-style: normal;
  opacity: 0.55;
}
.cotacao-timer-cd {
  font-variant-numeric: tabular-nums;
  font-style: normal;
  font-weight: 700;
  color: rgba(0, 229, 255, 0.55);
  letter-spacing: 0.4px;
  min-width: 24px;
  display: inline-block;
  text-align: left;
}

.cotacao-skeleton {
  display: inline-block;
  width: 52px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(0,100,200,0.08) 0%, rgba(0,229,255,0.12) 50%, rgba(0,100,200,0.08) 100%);
  background-size: 200% 100%;
  animation: neuralShimmer 1.8s ease-in-out infinite;
  vertical-align: middle;
}

[data-theme="light"] .cotacoes-bar {
  background: rgba(240, 248, 255, 0.9);
  border-top: 1px solid rgba(0, 100, 200, 0.08);
}
[data-theme="light"] .cotacao-sigla { color: var(--text-muted); }
[data-theme="light"] .cotacao-valor { color: var(--text-primary); }

@media (max-width: 480px) {
  .cotacoes-bar { padding: 0 12px; }
  .cotacao-item { padding: 0 8px; }
  .cotacao-timer { display: none; }
}

/* ---------- FILTERS ---------- */
.filters-section {
  background: rgba(6, 10, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 94px;
  z-index: 90;
}
[data-theme="light"] .filters-section {
  background: rgba(240, 248, 255, 0.9);
}

.filters-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-row-portais {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-row-portais::-webkit-scrollbar { display: none; }

.filter-row-resultado { padding-top: 2px; min-height: 18px; }
.resultado-info {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.filters-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-nano);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 58px;
}

.filter-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.filter-tabs-portais {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.filter-tabs-portais::-webkit-scrollbar { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(0, 140, 255, 0.04);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}
.filter-tab:hover {
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--text-primary);
  background: rgba(0, 229, 255, 0.06);
}
.filter-tab.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.5);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15), inset 0 0 10px rgba(0, 229, 255, 0.05);
}

.cat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.portal-badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.filter-count {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
  letter-spacing: 0;
}
.filter-tab.active .filter-count { background: rgba(0, 229, 255, 0.2); }

.update-info {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-nano);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 28px 60px;
}

/* Grid responsivo — 5 colunas para 40 cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* ---------- CARDS NEURAIS ---------- */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow var(--transition),
              border-color var(--transition),
              background var(--transition);
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 0.45s ease both;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Linha neon no topo do card */
.news-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
/* Brilho ambiente no fundo do card */
.news-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 80px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(20px);
  pointer-events: none;
}

/* Variantes de categoria */
.news-card[data-cat="data-center"]::before { background: linear-gradient(90deg, transparent, var(--cat-dc), transparent); }
.news-card[data-cat="seguranca"]::before   { background: linear-gradient(90deg, transparent, var(--cat-sec), transparent); }
.news-card[data-cat="ia"]::before           { background: linear-gradient(90deg, transparent, var(--cat-ia), transparent); }
.news-card[data-cat="data-center"]::after   { background: var(--cat-dc); }
.news-card[data-cat="seguranca"]::after     { background: var(--cat-sec); }
.news-card[data-cat="ia"]::after            { background: var(--cat-ia); }

/* Hover states */
.news-card:hover {
  transform: translateY(-5px) scale(1.01);
  background: var(--bg-card-hover);
}
.news-card:hover::before { opacity: 1; }
.news-card:hover::after  { opacity: 0.15; }

.news-card[data-cat="data-center"]:hover {
  border-color: rgba(0, 180, 216, 0.4);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px var(--cat-dc-glow);
}
.news-card[data-cat="seguranca"]:hover {
  border-color: rgba(255, 51, 102, 0.4);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px var(--cat-sec-glow);
}
.news-card[data-cat="ia"]:hover {
  border-color: rgba(191, 90, 242, 0.4);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px var(--cat-ia-glow);
}

/* ---------- CARD HEADER ---------- */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-xl);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.card-badge[data-cat="data-center"] {
  background: var(--cat-dc-bg);
  color: var(--cat-dc);
  border: 1px solid rgba(0, 180, 216, 0.3);
  text-shadow: 0 0 8px rgba(0, 180, 216, 0.8);
}
.card-badge[data-cat="seguranca"] {
  background: var(--cat-sec-bg);
  color: var(--cat-sec);
  border: 1px solid rgba(255, 51, 102, 0.3);
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.8);
}
.card-badge[data-cat="ia"] {
  background: var(--cat-ia-bg);
  color: var(--cat-ia);
  border: 1px solid rgba(191, 90, 242, 0.3);
  text-shadow: 0 0 8px rgba(191, 90, 242, 0.8);
}

.badge-nova {
  background: linear-gradient(135deg, rgba(0, 255, 148, 0.15), rgba(0, 229, 255, 0.1));
  color: var(--neon-green);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 255, 148, 0.3);
  text-shadow: 0 0 8px rgba(0, 255, 148, 0.8);
  animation: novaPulse 2.5s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes novaPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ---------- TÍTULO ---------- */
.card-titulo {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.1px;
}

/* ---------- RESUMO ---------- */
.card-resumo {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ---------- CARD FOOTER ---------- */
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.card-portal { display: flex; align-items: center; gap: 7px; min-width: 0; }

.portal-logo {
  width: 24px; height: 24px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.portal-nome {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-data {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.btn-leiamais {
  padding: 5px 11px;
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  flex-shrink: 0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}
.btn-leiamais:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}
.btn-leiamais svg { width: 11px; height: 11px; }

/* ---------- SKELETON LOADING ---------- */
.skeleton-card {
  background: rgba(8, 14, 30, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  backdrop-filter: blur(8px);
}

.skeleton {
  border-radius: 5px;
  background: linear-gradient(90deg,
    rgba(0, 100, 200, 0.06) 0%,
    rgba(0, 229, 255, 0.1) 40%,
    rgba(0, 100, 200, 0.06) 80%
  );
  background-size: 300% 100%;
  animation: neuralShimmer 2s ease-in-out infinite;
}
.s-badge  { height: 20px; width: 90px; border-radius: var(--radius-xl); }
.s-title  { height: 14px; width: 100%; }
.s-title.short { width: 68%; }
.s-text   { height: 11px; width: 100%; }
.s-text.short { width: 78%; }
.s-footer { height: 32px; width: 100%; border-radius: var(--radius-sm); margin-top: 6px; }

@keyframes neuralShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- ESTADOS VAZIOS/ERRO ---------- */
.estado-vazio, .estado-erro {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}
.vazio-icon, .erro-icon {
  font-size: 44px;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}
.estado-vazio h3, .estado-erro h3 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.estado-vazio p, .estado-erro p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.btn-tentar {
  margin-top: 20px;
  padding: 9px 22px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-tentar:hover {
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

/* ---------- FOOTER ---------- */
.footer {
  background: rgba(4, 6, 15, 0.95);
  border-top: 1px solid var(--border);
  padding: 36px 0 24px;
  margin-top: 16px;
}
[data-theme="light"] .footer { background: rgba(240, 248, 255, 0.95); }

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 28px;
}

.footer-portais { margin-bottom: 28px; }
.footer-titulo {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-nano);
  margin-bottom: 12px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 6px; }

.footer-link {
  padding: 4px 11px;
  background: rgba(0, 140, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}
.footer-link:hover {
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.06);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.footer-logo {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
}
.footer-logo strong {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-meta, .footer-copy {
  font-size: 11px;
  color: var(--text-nano);
}

/* ---------- ANIMAÇÕES ---------- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- RESPONSIVIDADE ---------- */
@media (max-width: 1500px) {
  .news-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .header-inner { padding: 0 18px; }
  .main-content { padding: 20px 18px 48px; }
  .filters-inner { padding: 8px 18px 6px; }
}
@media (max-width: 480px) {
  .news-grid { grid-template-columns: 1fr; gap: 10px; }
  .header-inner { padding: 0 14px; }
  .main-content { padding: 16px 14px 40px; }
  .filters-inner { padding: 8px 14px 6px; }
  .filters-title { display: none; }
  .update-info { display: none; }
  .footer-inner { padding: 0 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .logo-text { font-size: 16px; }
}

/* Stagger delay nos cards (até 40) */
.news-card:nth-child(1)  { animation-delay: 0.02s; }
.news-card:nth-child(2)  { animation-delay: 0.04s; }
.news-card:nth-child(3)  { animation-delay: 0.06s; }
.news-card:nth-child(4)  { animation-delay: 0.08s; }
.news-card:nth-child(5)  { animation-delay: 0.10s; }
.news-card:nth-child(6)  { animation-delay: 0.12s; }
.news-card:nth-child(7)  { animation-delay: 0.14s; }
.news-card:nth-child(8)  { animation-delay: 0.16s; }
.news-card:nth-child(9)  { animation-delay: 0.18s; }
.news-card:nth-child(10) { animation-delay: 0.20s; }
.news-card:nth-child(11) { animation-delay: 0.22s; }
.news-card:nth-child(12) { animation-delay: 0.24s; }
.news-card:nth-child(13) { animation-delay: 0.26s; }
.news-card:nth-child(14) { animation-delay: 0.28s; }
.news-card:nth-child(15) { animation-delay: 0.30s; }
.news-card:nth-child(16) { animation-delay: 0.32s; }
.news-card:nth-child(17) { animation-delay: 0.34s; }
.news-card:nth-child(18) { animation-delay: 0.36s; }
.news-card:nth-child(19) { animation-delay: 0.38s; }
.news-card:nth-child(20) { animation-delay: 0.40s; }
.news-card:nth-child(21) { animation-delay: 0.42s; }
.news-card:nth-child(22) { animation-delay: 0.44s; }
.news-card:nth-child(23) { animation-delay: 0.46s; }
.news-card:nth-child(24) { animation-delay: 0.48s; }
.news-card:nth-child(25) { animation-delay: 0.50s; }
.news-card:nth-child(26) { animation-delay: 0.52s; }
.news-card:nth-child(27) { animation-delay: 0.54s; }
.news-card:nth-child(28) { animation-delay: 0.56s; }
.news-card:nth-child(29) { animation-delay: 0.58s; }
.news-card:nth-child(30) { animation-delay: 0.60s; }
.news-card:nth-child(31) { animation-delay: 0.62s; }
.news-card:nth-child(32) { animation-delay: 0.64s; }
.news-card:nth-child(33) { animation-delay: 0.66s; }
.news-card:nth-child(34) { animation-delay: 0.68s; }
.news-card:nth-child(35) { animation-delay: 0.70s; }
.news-card:nth-child(36) { animation-delay: 0.72s; }
.news-card:nth-child(37) { animation-delay: 0.74s; }
.news-card:nth-child(38) { animation-delay: 0.76s; }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary, #0a0e1a);
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Particles background */
.loading-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.loading-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

/* Central body */
.loading-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

/* Logo ring wrapper */
.loading-logo-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: ringRotate linear infinite;
}
.loading-ring--outer {
  inset: 0;
  border-top-color: var(--neon-cyan, #00e5ff);
  border-right-color: var(--neon-cyan, #00e5ff);
  animation-duration: 1.4s;
  box-shadow: 0 0 12px rgba(0,229,255,.35);
}
.loading-ring--inner {
  inset: 12px;
  border-bottom-color: var(--neon-purple, #bf5af2);
  border-left-color: var(--neon-purple, #bf5af2);
  animation-duration: 1s;
  animation-direction: reverse;
  box-shadow: 0 0 10px rgba(191,90,242,.3);
}
.loading-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--neon-cyan, #00e5ff), var(--neon-purple, #bf5af2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 0 24px rgba(0,229,255,.5),
    0 0 48px rgba(191,90,242,.25);
  animation: iconPulse 2.5s ease-in-out infinite;
}

/* Brand text */
.loading-brand {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text-primary, #e8eaf6);
  text-transform: uppercase;
  animation: brandGlow 2.5s ease-in-out infinite alternate;
}
.loading-brand strong {
  background: linear-gradient(90deg, var(--neon-cyan, #00e5ff), var(--neon-purple, #bf5af2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  margin-top: -10px;
}

/* Loading message */
.loading-msg {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #a0a8c0);
  letter-spacing: 0.5px;
  min-height: 20px;
  transition: opacity 0.3s ease;
}

/* Progress bar */
.loading-bar-wrap {
  width: 220px;
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan, #00e5ff), var(--neon-purple, #bf5af2));
  border-radius: 99px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0,229,255,.6);
  animation: barIndeterminate 1.8s ease-in-out infinite;
}

/* Dot indicators */
.loading-dots {
  display: flex;
  gap: 7px;
  margin-top: 4px;
}
.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-cyan, #00e5ff);
  opacity: 0.2;
  animation: dotPop 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; background: var(--neon-purple, #bf5af2); }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* === Keyframes === */
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0,229,255,.5), 0 0 48px rgba(191,90,242,.25); }
  50%       { box-shadow: 0 0 36px rgba(0,229,255,.8), 0 0 72px rgba(191,90,242,.5); }
}
@keyframes brandGlow {
  from { text-shadow: none; }
  to   { text-shadow: 0 0 20px rgba(0,229,255,.3); }
}
@keyframes barIndeterminate {
  0%   { transform: translateX(-100%); width: 60%; }
  50%  { transform: translateX(100%);  width: 60%; }
  100% { transform: translateX(300%);  width: 60%; }
}
@keyframes dotPop {
  0%, 80%, 100% { opacity: 0.2; transform: scale(1); }
  40%            { opacity: 1;   transform: scale(1.35); }
}
@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}
.news-card:nth-child(39) { animation-delay: 0.78s; }
.news-card:nth-child(40) { animation-delay: 0.80s; }
