/* TruthBear Layout — Sidebar + Content Area + Responsive */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tb-font);
  background: var(--tb-bg);
  color: var(--tb-text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--tb-interactive); text-decoration: none; }
a:hover { color: var(--tb-interactive-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== APP SHELL ===== */
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--tb-sidebar-w);
  background: var(--tb-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 16px 0;
  transition: transform 0.2s;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--tb-primary-light);
  margin-bottom: 8px;
  color: var(--tb-sidebar-text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.sidebar-logo svg { flex-shrink: 0; }
.sidebar-logo span { color: inherit; }

/* Nav items */
.nav-group { padding: 2px 0; }
.nav-divider { height: 1px; background: var(--tb-primary-light); margin: 6px 14px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--tb-sidebar-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: var(--tb-sidebar-text); }
.nav-item.active {
  color: var(--tb-sidebar-text);
  background: var(--tb-primary-light);
  border-left-color: var(--tb-accent);
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }

/* Sidebar bottom */
.sidebar-bottom { margin-top: auto; padding: 12px; }
.sidebar-user {
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--tb-sidebar-muted);
  border-top: 1px solid var(--tb-primary-light);
  padding-top: 12px;
}
.sidebar-user strong { color: var(--tb-sidebar-text); font-weight: 600; }
.btn-new-belief {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--tb-accent);
  color: white;
  border: none;
  border-radius: var(--tb-card-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-new-belief:hover { background: var(--tb-accent-hover); color: white; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--tb-sidebar-w);
  flex: 1;
  min-height: 100vh;
  min-width: 0;
}
.page { padding: 24px 28px; max-width: var(--tb-content-max); }

/* ===== MOBILE HAMBURGER ===== */
.hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: 40px; height: 40px;
  background: var(--tb-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ===== LOGGED-OUT LAYOUT ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--tb-bg);
}
.auth-card {
  background: var(--tb-card);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-card-radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--tb-shadow);
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-card .subtitle {
  font-size: 14px;
  color: var(--tb-text-secondary);
  margin-bottom: 24px;
}
.auth-card .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--tb-primary);
}

/* ===== RESPONSIVE ===== */

/* Tablet: sidebar collapses to hamburger */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger {
    display: flex;
  }
  .mobile-overlay.open {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .page {
    padding: 60px 20px 24px;
  }
}

/* Mobile: single column */
@media (max-width: 767px) {
  .page {
    padding: 56px 16px 20px;
  }
}
