/* ============================================================
   SYSTEM TGF — index.css
   Landing page: grid de produtos, animações, modal de auth.
   Depende de base.css.
   ============================================================ */

/* ---------- Body override (centralizado e com overflow controlado) ---------- */
body {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px; /* espaço para a status-bar fixa */
}

/* ---------- Wrapper principal ---------- */
.main-wrapper {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header da landing ---------- */
.terminal-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  width: 100%;
  text-align: center;
}

.ascii-art {
  color: #01eb01;
  font-size: 9px;
  white-space: pre;
  margin-bottom: 20px;
  line-height: 1;
  text-align: left;
  overflow-x: auto;
}

.prompt {
  color: var(--green);
  margin-bottom: 20px;
  width: auto;
  text-align: left;
  padding: 0;
  display: flex;
  align-items: baseline;
}

.prompt::before {
  content: "> ";
}

/* ---------- Grid de produtos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 30px;
  width: 100%;
}

/* ---------- Card de produto ---------- */
.box {
  border: 1px solid var(--border);
  padding: 15px;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  text-align: center;
  cursor: pointer;
}

.box:hover {
  border-color: var(--text);
}

.box.featured {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

.box.coming-soon:hover {
  border-color: var(--border);
}

.box-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text);
  opacity: 0.7;
}

.box-title {
  color: var(--green);
  font-size: 18px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.box.featured .box-title {
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.box-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.box-price {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--yellow);
}

/* ---------- Botão GPT da landing (override do base) ---------- */
.btn-gpt {
  margin-top: auto;
}

/* ---------- Botão "Em breve" ---------- */
.btn-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-size: 12px;
  text-transform: uppercase;
  font-family: var(--font);
  cursor: pointer;
  background: transparent;
  margin-top: auto;
  border-radius: 4px;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-soon:hover {
  background: var(--yellow);
  color: var(--bg);
}

/* ---------- Badges (LIVE / OFFLINE) ---------- */
.badge-live {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--green);
  color: var(--bg);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: bold;
  border-radius: 2px;
  animation: pulse 2s infinite;
}

.badge-offline {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--yellow);
  color: var(--bg);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: bold;
  border-radius: 2px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ---------- Animação typing ---------- */
.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 0.15em solid var(--green);
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--green);
  }
}

/* ---------- Footer da landing ---------- */
.footer {
  margin-top: 50px;
  text-align: center;
  font-size: 12px;
  color: var(--text);
  opacity: 0.5;
  width: 100%;
  border-top: 0;
  padding-top: 0;
}

/* ---------- Modal de autenticação (Google) ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background-color: var(--bg);
  border: 2px solid var(--green);
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  position: relative;
}

.modal-content h2 {
  color: var(--green);
  font-size: 24px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.modal-content p {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 30px;
  line-height: 1.6;
  opacity: 0.8;
}

.modal-content .auth-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 15px;
  min-height: 18px;
}

#gsi-button-container {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  color: var(--text);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.close-modal:hover {
  color: var(--green);
}

.modal-loading {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.modal-loading.show {
  display: block;
}

.spinner {
  border: 2px solid var(--border);
  border-top: 2px solid var(--green);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.modal-loading p {
  color: var(--green);
  font-size: 12px;
}

/* ---------- Status bar fixa no rodapé ---------- */
#status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 20px;
  background: rgba(12, 12, 12, 0.9);
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--border);
  display: flex;
  gap: 20px;
  z-index: 50;
}

#status-bar span {
  color: var(--green);
}

/* ============================================================
   MOBILE
   ============================================================ */

/* Tablet: 2 colunas no grid */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 coluna — um produto por linha */
@media (max-width: 768px) {
  .main-wrapper {
    padding: 0 8px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 20px;
  }

  .box {
    min-height: auto;
    padding: 14px;
  }

  .box-img {
    height: 340px;
  }

  .box-title {
    font-size: 16px;
  }

  .ascii-art {
    font-size: 8px;
  }

  .terminal-header {
    font-size: 12px;
  }

  .modal-content {
    padding: 28px 18px;
  }

  .modal-content h2 {
    font-size: 18px;
  }

  /* Status bar fica menor e com menos gap */
  #status-bar {
    padding: 4px 10px;
    gap: 10px;
    font-size: 9px;
    flex-wrap: wrap;
  }

  /* O footer da landing zera o padding-bottom adicionado no body desktop */
  .footer {
    margin-top: 30px;
    margin-bottom: 40px;
  }
}

/* Telas muito pequenas */
@media (max-width: 380px) {
  .ascii-art {
    font-size: 7px;
  }

  .box-img {
    height: 180px;
  }
}
