:root {
  --bg: #191a21;
  --bg-elevated: #1e1f29;
  --bg-soft: #343746;
  --border-color: #44475a;
  --accent: #bd93f9;
  --accent-soft: rgba(189, 147, 249, 0.18);
  --accent-strong: #ff79c6;
  --text-primary: #f8f8f2;
  --text-muted: #a4accd;
  --danger: #ff5555;
  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg); /* fundo uniforme */
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

body {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.page {
  width: 100%;
  max-width: 1240px;
  background: var(--bg); /* igual ao body */
  border-radius: 24px;
  padding: 20px 20px 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: calc(100vh - 40px); /* evita “faixa” diferente ao scroll */
}

/* Header - centered & compact */
.site-header {
  margin-bottom: 14px;
  text-align: center;
}

.site-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #50fa7b;
 /*  background: #ff5555; */
  margin-right: 6px;
  /* box-shadow: 0 0 8px rgba(255, 85, 85, 0.9); */
  box-shadow: 0 0 8px rgba(88, 255, 85, 0.9);

}

.site-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.site-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 720px;
  text-align: center;
}

/* Minimal top-right navbar */
.minimal-navbar {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 50;
}

.minimal-nav-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: 0.15s ease;
}

.minimal-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Minimal Navbar Dropdown */
.minimal-navbar {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
}

.minimal-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 22px;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 6px 0;
  min-width: 150px;
  display: none;
  flex-direction: column;
  z-index: 200;
}

.dropdown-menu a {
  padding: 6px 12px;
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
}

.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

/* Hover activation */
.minimal-dropdown:hover .dropdown-menu {
  display: flex;
}

/* Preserve existing nav-link styling */
.minimal-nav-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: 0.15s ease;
}

.minimal-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Footer */
.site-footer {
  margin-top: 30px;
  padding: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer p {
  margin: 0;
  line-height: 1.4;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-top: 14px;
  align-items: flex-start; /* não estica sidebar */
}

/* Sidebar */
.sidebar {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 14px 14px 16px;
  border: 1px solid var(--border-color);
  align-self: flex-start; /* altura só do conteúdo */
}

.sidebar-section + .sidebar-section {
  margin-top: 18px;
}

.sidebar-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.sidebar-help {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: rgba(52, 55, 70, 0.85);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
}

.pill:hover {
  border-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.pill-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Main / Filters bar */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filters-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  border: 1px solid var(--border-color);
}

.filters-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.filters-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.search-input-wrapper {
  display: flex;
  gap: 8px;
}

.filter-input {
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-primary);
  font-size: 13px;
  padding: 6px 10px;
  min-width: 180px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.btn-primary {
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: #191a21;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition:
    background 0.15s ease,
    transform 0.05s ease,
    box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
}

.status-title {
  font-size: 13px;
  font-weight: 600;
}

.status-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.status-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-right {
  font-size: 11px;
  color: var(--text-muted);
}

/* Loading */
.loading {
  margin-top: 10px;
  padding: 14px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* News list & cards */
.news-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 14px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-source {
  font-size: 12px;
  color: var(--text-muted);
}

.card-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-category {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent);
}

.card-date {
  font-size: 11px;
  color: var(--text-muted);
}

.card-title {
  margin: 0 0 4px;
  font-size: 16px;
}

.card-body {
  margin-bottom: 8px;
}

.card-body-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}

.card-title-link {
  color: var(--text-primary);
  text-decoration: none;
}

.card-title-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* Opcional: Dar uma leve ênfase no botão Curated */
button.pill[data-type="curated"] {
  font-weight: 600;
}

/* Smart groups badges */
.smart-groups {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.smart-group-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(80, 250, 123, 0.08);
  border: 1px solid rgba(80, 250, 123, 0.8);
  color: #50fa7b;
}

/* Card footer */
.card-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 0;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Evita que algum conteúdo interno estoure a largura do board */
.layout,
.main-content,
.news-list {
  max-width: 100%;
  overflow-x: hidden;
}
.card {
  min-width: 0;
}

/* Garante quebra de linha em títulos/resumos/fontes muito longos */
.card,
.card-title,
.card-body-text,
.card-source,
.smart-group-badge {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}


/* Responsive */
@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .page {
    padding: 18px 16px 22px;
  }

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

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-right {
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .filters-bar {
    padding: 10px;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .status-right {
    align-self: flex-start;
  }

  .site-subtitle {
    padding: 0 4px;
  }
}
      /* Modern rounded pill buttons */
      .btn-pill {
        padding: 7px 16px;
        border-radius: 999px;
        border: 1px solid var(--accent);
        background: linear-gradient(
          145deg,
          rgba(189, 147, 249, 0.28),
          rgba(189, 147, 249, 0.08)
        );
        color: var(--accent);
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .btn-pill:hover {
        color: #191a21;
        background: var(--accent);
        box-shadow: 0 4px 12px rgba(189, 147, 249, 0.45);
        transform: translateY(-1px);
      }

      .btn-pill:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(189, 147, 249, 0.25);
      }

      /* Secondary pill (for print button) */
      .btn-pill-secondary {
        border-color: rgba(248, 248, 242, 0.4);
        background: rgba(248, 248, 242, 0.04);
        color: var(--text-primary);
      }

      .btn-pill-secondary:hover {
        background: rgba(248, 248, 242, 0.15);
        color: var(--background);
      }

      /* Markdown styling */
      .markdown-body h1,
      .markdown-body h2,
      .markdown-body h3 {
        color: var(--accent);
        margin-top: 20px;
      }

      .markdown-body p,
      .markdown-body li {
        font-size: 14px;
        line-height: 1.55;
        color: var(--text-primary);
      }

      .markdown-body ul {
        padding-left: 22px;
      }

      .markdown-body li::marker {
        color: var(--accent);
        font-weight: bold;
      }

      .markdown-body code {
        background: rgba(52, 55, 70, 0.6);
        padding: 2px 6px;
        border-radius: 6px;
        font-size: 12px;
      }
