/* Color Palette Inspired by git-scm.com */
:root {
  /* Backgrounds */
  --bg-main: #222222; /* The main page background - a dark, warm gray */
  --bg-card: #333333; /* Background for report cards, code boxes - slightly lighter */

  /* Texts */
  --text-main: #ffffff; /* Main body text - pure white */
  --text-muted: #a0a0a0; /* Secondary, less important text - medium gray */

  /* Accents & Active States */
  --accent: #f05032; /* The Git orange for titles, buttons, and links */

  /* UI Elements */
  --border: #444444; /* Subtle dividers, inputs borders, and section edges */
  --shadow: rgba(0, 0, 0, 0.3); /* Subtle shadow for depth on cards */
}

.hidden {
  display: none;
}

.cards-grid {
  display: grid;
  /* Isso cria colunas automáticas. Se tiver espaço, ficam lado a lado. Se for celular, ficam em uma coluna só. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: var(--bg-card); /* Fundo do card */
  box-shadow: 0 4px 8px 0 var(--shadow); /* Sombra transparente */
  border-radius: 8px;
  padding: 1.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border-left: 5px solid var(--border); /* Uma borda colorida lateral para dar estilo */
  color: var(--text-muted);
}

.card:hover {
  box-shadow: 0 8px 16px 0 var(--shadow);
  transform: translateY(-5px);
}

.card-title {
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.card-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: bold;
  color: var(
    --bg-main
  ); /* Texto escuro para contrastar com o fundo colorido da tag */
  margin-bottom: 1rem;
}

.status-secure {
  background-color: #2ea043;
} /* Verde */
.status-vulnerable {
  background-color: #f85149;
} /* Vermelho */
.status-missing {
  background-color: #d29922;
} /* Amarelo */

body {
  background-color: var(--bg-main);
  color: var(--text-muted); /* Main text gets a slightly muted gray */
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 2rem;
}

/* Use the accent color for all main headings, just like the Git site */
h1,
h2 {
  color: var(--accent);
}

/* The analyzer button uses the accent orange */
#analyzeBtn {
  background-color: var(--accent);
  color: var(--text-main);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* The input gets a clean dark border */
#urlInput {
  background-color: var(--text-main);
  border: 2px solid var(--border);
  padding: 0.5rem;
}

#filterContainer {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
}

#filterSpan {
  font-weight: bold;
  color: #555;
}

.checkbox-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Header layout and typographic improvements */
header {
  max-width: 900px;
  margin: 0 auto 2rem;
  text-align: center;
  padding: 1.5rem 1rem;
}

p {
  font-size: 1.2rem;
}

.navBar {
  display: flex;
  justify-content: center; /* Centraliza os botões */
  gap: 1rem;
  background-color: var(--bg-card); /* Fundo um pouco mais claro que o body */
  padding: 1rem 2rem 0 2rem; /* Sem padding embaixo para colar a borda */
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.nav-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 3px solid transparent; /* Espaço invisível para a linha de tab */
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
  border-radius: 6px 6px 0 0; /* Arredonda só em cima */
}

.nav-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05); /* Leve clareada no fundo */
}

.nav-btn.active {
  color: var(--accent); /* Texto fica Laranja */
  border-bottom: 3px solid var(--accent); /* Linha laranja embaixo */
  background-color: transparent;
}

/* =========================================
   CAIXA DE CÓDIGO (Para os valores dos cabeçalhos)
   ========================================= */

.value-box {
  background-color: var(--bg-main); /* Fundo escuro */
  color: var(--text-muted);
  font-family: "Courier New", Courier, monospace; /* Fonte de código */
  font-size: 0.85em;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-top: 5px;

  /* Impede que o texto empurre as paredes do card */
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap; /* Garante que espaços em branco sejam respeitados, mas com quebra */

  /* Limita a altura para não destruir o Grid de cards */
  max-height: 120px;
  overflow-y: auto;
}

/* Scrollbar customizada idêntica a do histórico */
.value-box::-webkit-scrollbar {
  width: 6px;
}
.value-box::-webkit-scrollbar-track {
  background: transparent;
}
.value-box::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}
.value-box::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent);
}

/* =========================================
   RANKING LEADERBOARD
   ========================================= */
.ranking-item {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.ranking-item:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}

.ranking-grade {
  font-size: 1.8em;
  font-weight: bold;
  width: 50px;
  text-align: center;
  margin-right: 20px;
}

.ranking-info {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-url {
  font-size: 1.2em;
  color: var(--text-main);
  font-weight: bold;
}

.ranking-date {
  color: var(--text-muted);
  font-size: 0.9em;
}
