/* ======================================================================
   FutiaSpace · layout.css
   App shell: header, bottom nav, drawer, main content, auth pages
   ====================================================================== */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

/* =====================================================================
   Top header
   ===================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: none; /* shown when authenticated via JS */
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

body.user-authenticated .app-header { display: flex; }

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger-btn,
.search-icon-btn,
.chat-icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  position: relative;
  transition: background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.hamburger-btn:hover,
.search-icon-btn:hover,
.chat-icon-btn:hover {
  background: var(--bg-elevated);
}
.hamburger-btn:active,
.search-icon-btn:active,
.chat-icon-btn:active { transform: scale(0.94); }

.hamburger-btn [data-lucide],
.search-icon-btn [data-lucide],
.chat-icon-btn [data-lucide],
.hamburger-btn svg.lucide,
.search-icon-btn svg.lucide,
.chat-icon-btn svg.lucide {
  width: 22px; height: 22px;
}

.logo-container {
  width: 32px; height: 32px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}
.logo-container img { width: 70%; height: 70%; object-fit: contain; }

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#chatBadge,
#notificationBadge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-danger);
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* =====================================================================
   Main content
   ===================================================================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 0 calc(var(--nav-h) + var(--safe-bottom));
  scroll-behavior: smooth;
}

body:not(.user-authenticated) .main-content {
  padding-bottom: 0;
}

/* =====================================================================
   Bottom navigation
   ===================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: none;
  width: calc(100% - 24px);
  max-width: 520px;
  height: var(--nav-h);
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  transition: transform var(--t-base) var(--ease);
  margin-bottom: var(--safe-bottom);
}
body.user-authenticated .bottom-nav { display: flex; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-pill);
  position: relative;
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.nav-item [data-lucide],
.nav-item svg.lucide { width: 22px; height: 22px; }

.nav-item:hover { color: var(--text-secondary); }
.nav-item:active { transform: scale(0.94); }

.nav-item.active {
  color: var(--text-on-primary);
  background: var(--gradient-brand);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}
.nav-item.active span { color: var(--text-on-primary); }

#notificationBadge:not([style*="display:none"]) {
  position: absolute;
  top: 6px;
  right: 22%;
  border: 2px solid var(--bg-surface);
}

/* =====================================================================
   Drawer (side menu)
   ===================================================================== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: min(82%, 320px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--t-slow) var(--ease);
  padding: calc(var(--safe-top) + 20px) 14px 20px;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.drawer-item [data-lucide],
.drawer-item svg.lucide { width: 20px; height: 20px; color: var(--violet-400); }
body.light-mode .drawer-item [data-lucide],
body.light-mode .drawer-item svg.lucide { color: var(--violet-600); }

.drawer-item:hover {
  background: var(--bg-elevated);
}
.drawer-item:active { transform: scale(0.98); }

/* =====================================================================
   Dev banner
   ===================================================================== */
.dev-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(90deg, var(--violet-600), var(--amber-500));
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.dev-banner button {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.dev-banner button:hover { background: rgba(255,255,255,0.32); }

/* =====================================================================
   Auth & Landing pages
   ===================================================================== */
.auth-container,
.landing-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeIn var(--t-slow) var(--ease);
}

.auth-logo,
.landing-logo {
  width: 72px; height: 72px;
  margin: 24px auto 18px;
  border-radius: 22px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.45);
}
.auth-logo img,
.landing-logo img { width: 60%; height: 60%; }

.auth-title,
.landing-title {
  text-align: center;
  font-size: 1.9rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.landing-title {
  font-size: 2.4rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-subtitle,
.landing-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  margin-bottom: 28px;
}

.landing-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: 1.55;
  max-width: 320px;
  margin: 0 auto 32px;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 24px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.auth-link a {
  color: var(--violet-400);
  font-weight: 600;
}
body.light-mode .auth-link a { color: var(--violet-600); }

.auth-footer {
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Step indicator (signup) */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: width var(--t-base) var(--ease),
              background-color var(--t-base) var(--ease);
}
.step-dot.active {
  width: 22px;
  border-radius: 999px;
  background: var(--gradient-brand);
}

.step-content { animation: fadeIn var(--t-base) var(--ease); }

.step-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.step-buttons .btn { flex: 1; }

/* Avatar upload (signup / settings) */
.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.avatar-placeholder-large,
.avatar-img-large {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gradient-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

/* Welcome onboarding */
.welcome-overlay {
  position: fixed; inset: 0;
  background: var(--bg-base);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.welcome-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--t-slow) var(--ease);
}
.welcome-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}
.welcome-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: width var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
.welcome-dot.active {
  width: 22px;
  background: var(--gradient-brand);
}
.welcome-slide {
  display: none;
  text-align: center;
  animation: fadeIn var(--t-base) var(--ease);
}
.welcome-slide.active { display: block; }
.welcome-slide h2 {
  font-size: 1.4rem;
  margin: 16px 0 10px;
}
.welcome-slide p {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: 1.55;
}
.welcome-illustration {
  display: flex; align-items: center; justify-content: center;
  width: 110px; height: 110px;
  border-radius: 28px;
  background: var(--color-primary-soft);
  margin: 0 auto 8px;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.welcome-actions .btn { flex: 1; }


/* Header icon buttons with labels */
.header-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  min-width: 38px;
  height: auto;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast);
  position: relative;
}
.header-icon-btn:hover {
  color: var(--violet-300);
}
.header-icon-btn i,
.header-icon-btn svg {
  width: 20px;
  height: 20px;
}
.header-btn-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: inherit;
  white-space: nowrap;
}
/* ── Instagram‑style text logo ──────────────────────────── */
.logo-text {
  font-family: 'Pacifico', 'Dancing Script', 'Brush Script MT', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--gradient-story);   /* green → orange gradient */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 6px rgba(0,0,0,0.2);
  user-select: none;
  line-height: 1;
  margin-left: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo-text:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}