/* styles.css */
/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  :root {
    --bg: #f5f5f5;
    --text: #333;
    --primary: #007bff;
    --radius: 8px;
    --social-radius: 10px;
    --card-radius: 12px;
    --banner-bg: #ffffff;
    --banner-text: #555555;
  }
  
  body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 16px;
  }
  
  h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
  }
  
  /* Barra de Pesquisa */
  .search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px;
  }
  
  .search-container input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    font-size: 16px;
    outline: none;
  }
  
  .search-container input:focus {
    border-color: var(--primary);
  }
  
  .search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    pointer-events: none;
  }

  /* Resultado da busca */
  #searchResultCount {
    display: block;
    text-align: center;
    font-size: 16px;
    color: #555;
    margin: 0 auto 20px; /* sem margem em cima, 20px embaixo */
  }
  
  /* Opcional: esconder quando estiver vazio */
  #searchResultCount:empty {
    display: none;
  }
  
  
  /* Social Cards */
  .social-cards {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px auto;
    flex-wrap: wrap;
  }
  
  .social-card {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: var(--social-radius);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  .social-card:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  
  .social-card img {
    width: 24px;
    height: 24px;
  }
  
  /* Grid de Cards */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 20px auto 0;
  }
  
  @media (min-width: 480px) {
    .grid {
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
  }
  
  @media (min-width: 768px) {
    .grid {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
  }
  
  /* Card */
  a.card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 4/5;
    display: block;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards;
  }
  
  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  a.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  }
  
  .card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block;
  }
  
  a.card:hover img {
    transform: scale(1.05);
  }
  
  .card-content {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top,
      rgba(0,0,0,0.7), rgba(0,0,0,0));
    color: #fff;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
  }
  
  .card-title {
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 8px;
  }
  
  .card-more {
    background: var(--primary);
    padding: 5px 10px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 16px;
    color: #fff;
    opacity: 0.95;
  }
  
  .card-more .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0; /* não deixa o ícone encolher */
  }
  
  
  .load-more-container {
    text-align: center;
    margin-top: 20px;
  }
  
  #loadMoreButton {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
  }
  
  #scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #555;
    color: #fff;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s, background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #scrollToTopBtn svg {
    width: 24px;
    height: 24px;
  }
  
  #scrollToTopBtn:hover {
    background-color: #333;
  }
  
  #scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
  }
  
  @media (min-width: 768px) {
    .grid:has(.card) {
      grid-template-columns: repeat(auto-fit,
        minmax(220px, 1fr));
      justify-content: center;
    }
  }

  /* === tema escuro === */
body.dark-theme {
  --bg: #1e1e1e;
  --text: #eee;
  --primary: #4da6ff;
  --banner-bg: rgba(255, 255, 255, 0.1);
  --banner-text: #cccccc;
}

/* Se quiser reforçar só no tema escuro, pode fazer assim */
body.dark-theme a {
  /* —primary no dark theme já é #4da6ff, bem mais legível em fundo escuro */
  color: var(--primary);
}

/* reaplique nas regras já existentes */
body {
  background: var(--bg);
  color: var(--text);
}

#themeToggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.floating-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--text);
  z-index: 100;
}
.floating-toggle:focus-visible {
  outline: 2px solid var(--primary);
}

/* Cabecalho, tema escuro e titulo */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto 30px;
  padding: 0 16px;
}

.header h1 {
  margin: 0;
}

#themeToggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--text);
}

#themeToggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Dentro do seu styles.css */

.logo img {
  max-width: 200px;   /* ajuste conforme o design */
  height: auto;
  display: block;
  margin: 0;          /* no need to auto-center, flex-header já faz isso */
}

.social-card.discord {
  color: #5865F2;
}

/* Garante que todo o .social-card.telegram use predefinidamente preto */
.social-card.telegram {
  color: #000;          /* para o texto e ícones que herdam currentColor */
}

/* Como o nosso SVG do Telegram não usa currentColor, só precisamos
   garantir que o <span> fique preto */
.social-card.telegram .social-text {
  color: #000;
}

/* === Onboarding Overlay Profissional === */

/* 1) Base do overlay, sempre presente mas invisível */
#onboardingOverlay {
  position: fixed;
  inset: 0;                                 /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0, 0, 0, 0.75);          /* backdrop mais escuro */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;                             /* acima de tudo */
}

/* 2) Quando remover .hidden, mostrar com fade */
#onboardingOverlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

/* 3) Caixa branca central */
#onboardingOverlay .overlay-content {
  background: var(--bg);
  color: var(--text);
  
  max-width: 400px;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: translateY(-20px);
  opacity: 0;
  animation: slideDown 0.4s ease-out forwards;
}

/* 4) Animação slide-down */
@keyframes slideDown {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 5) Estilização interna */
#onboardingOverlay .overlay-content h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

#onboardingOverlay .overlay-content ol {
  list-style: decimal inside;
  text-align: left;
  margin: 1rem 0;
  color: var(--text-secondary, #666);
}

#onboardingOverlay .overlay-content ol li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 1rem;
}

#onboardingOverlay .overlay-content label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
}

#onboardingOverlay .overlay-content input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

#onboardingOverlay .overlay-content button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#onboardingOverlay .overlay-content button:hover {
  background: #0058b3;       /* tom mais escuro de var(--primary) */
  transform: translateY(-1px);
}

#onboardingOverlay .overlay-content button:active {
  transform: translateY(0);
}

/* 6) Ajuste responsivo */
@media (min-width: 768px) {
  #onboardingOverlay .overlay-content {
    max-width: 500px;
    padding: 2.5rem;
  }
}

/* 7) Manter oculto quando tiver a classe .hidden */
#onboardingOverlay.hidden {
  display: none !important;
}

/*Banner dentro site com o tutorial*/
.quickstart-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  background: var(--banner-bg);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 auto 1.5rem;
  max-width: 600px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.quickstart-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--banner-text);
}

.quickstart-step .qs-icon {
  font-size: 1.2rem;
  line-height: 1;
}


/* Modal Tutorial Video container, invisível com .hidden */
.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

/* Backdrop: sits underneath the content */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1;               /* <— add */
}

/* Content box: above the backdrop */
.modal-content {
  position: relative;
  z-index: 2;               /* <— add */
  margin: auto;
  top: 5%;
  max-width: 90%;
  width: 560px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Close button: above everything in the content */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  z-index: 3;               /* <— add */
}

/* Responsive iframe */
.modal-content iframe {
  display: block;
  width: 100%;
  height: calc(100vw * 9 / 16); /* 16:9 ratio */
  max-height: 80vh;
}

.modal-content video {
  max-height: 80vh;
  object-fit: contain;
}
