/* ============================================================
   BrainTest 3.2.1 — UI Base (SEM CORES FIXAS)
   Este arquivo controla apenas LAYOUT.
   TODAS as cores vêm do ui-theme.css.
   ============================================================ */

/* ===============================
   🔹 Reset
   =============================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: 100%;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Fundo e texto sempre puxam do tema */
body {
  background: var(--color-bg);
  color: var(--color-text);
  transition: var(--transition-theme);
}

/* ===============================
   🔹 Layout principal
   =============================== */

.main-container {
  display: flex;
  min-height: 100vh;
}

.content {
  flex: 1;
  margin-left: 250px; /* sidebar desktop */
  padding: 2rem;
  box-sizing: border-box;
}

section {
  max-width: 1120px;
}

/* ===============================
   🔹 SIDEBAR (versão desktop)
   =============================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: var(--color-card);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.sidebar-logo img {
  width: 28px;
  height: 28px;
}

.sidebar-logo span {
  font-weight: 600;
  font-size: 1rem;
}

/* Wallet */
.wallet-box {
  margin: 1rem;
  padding: 1rem 0.8rem;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.wallet-box:hover {
  transform: translateY(-2px);
}

.wallet-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.wallet-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.4rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.25s ease, color 0.25s ease;
}

.menu-item img {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.menu-item:hover {
  background: var(--hover-soft);
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-primary);
}

/* Footer da sidebar */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-btn {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.footer-btn:hover {
  background: var(--hover-soft);
}

.footer-btn-primary {
  background: #ef4444;
  border: none;
  color: #fff;
}

/* ===============================
   🔹 TOGGLE da sidebar (não usado)
   =============================== */

.sidebar-toggle {
  display: none !important;
}

/* ===============================
   🔹 HEADER MOBILE
   =============================== */

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  box-sizing: border-box;
}

.mobile-logo {
  width: 30px;
}

.mobile-center span {
  font-weight: 600;
}

.mobile-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn img {
  width: 23px;
}

/* ===============================
   🔹 MENU MOBILE
   =============================== */

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  color: var(--color-text);
  flex-direction: column;
  padding: 1.4rem;
  z-index: 110;
  box-sizing: border-box;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-menu-logo img {
  width: 28px;
}

.mobile-menu-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text);
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}

.mobile-menu-content a {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  font-size: 1rem;
}

.mobile-menu-btn-row {
  margin-top: 1rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 0.9rem;
}

.mobile-menu-btn-primary {
  margin-top: 0.6rem;
  background: #ef4444;
  border: none;
  color: #fff;
}

/* ===============================
   🔹 Inputs (fallback)
   =============================== */

input,
select,
textarea {
  background: var(--color-input-bg);
  color: var(--color-text);
  border: 1px solid var(--color-input-border);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-input-placeholder);
}

/* ===============================
   🔹 RESPONSIVIDADE
   =============================== */

@media (max-width: 991px) {
  /* Esconde sidebar fixa e usa header mobile */
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .main-container {
    display: block;
    width: 100%;
    min-height: 100vh;
  }

  .content {
    margin: 0;
    margin-top: 64px; /* espaço do header fixo */
    padding: 1.5rem 1.25rem 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  section,
  .page-container,
  .dashboard-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .card,
  .history-card,
  .test-card,
  .wallet-balance,
  .wallet-card,
  .benefit-card {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .content {
    padding: 1.2rem 1rem 2rem;
  }
}
