  /* ===============================
   INTAKEE — STABLE BASELINE CSS
   =============================== */

:root {
  --bg: #000;
  --panel: #0f0f0f;
  --panel-2: #0a0a0a;
  --border: #1a1a1a;
  --text: #fff;
  --muted: #aaa;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  padding-bottom: 90px;
}

/* ================= HEADER ================= */

#mainHeader {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(#000, #0a0a0a);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;

  display: flex;
  align-items: center;
  gap: 16px;
}

.app-logo {
  height: 105px;
  width: auto;
}

.search-bar {
  flex: 1;
  max-width: 720px;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px 10px 38px;
  color: var(--text);
  font-size: 14px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

/* ================= TABS ================= */

.tab-section {
  display: none;
  padding: 24px;
}

.tab-section.active {
  display: block;
}

/* ================= HEADINGS ================= */

h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

/* ================= HOME ================= */

.home-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-login-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ================= FEED ================= */

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ================= UPLOAD ================= */

.tab-inner {
  max-width: 520px;
  margin: 0 auto;
}

.upload-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.upload-card label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  display: block;
}

.upload-card input,
.upload-card textarea,
.upload-card select {
  width: 100%;
  margin-top: 6px;
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.upload-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.upload-btn,
.live-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
/* ================= PROFILE PAGE ================= */
.profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ================= BANNER ================= */
.profile-banner {
  position: relative;
  height: 260px;
  background: linear-gradient(180deg, #111, #000);
  border-radius: 16px;
  overflow: visible;
}

/* ================= AVATAR ================= */
.profile-avatar {
  position: absolute;
  bottom: -70px;
  left: 40px;

  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #222;
  border: 4px solid #000;
  z-index: 10;
}

/* ================= HEADER ================= */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;

  padding: 90px 40px 24px;
}

/* ================= META ================= */
.profile-meta {
  max-width: 520px;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-handle {
  color: #aaa;
  margin-bottom: 8px;
}

.profile-bio {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 16px;
}

/* ================= STATS ================= */
.profile-stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.profile-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-stats strong {
  font-size: 16px;
}

/* ================= EDIT BUTTON ================= */
.edit-profile-btn {
  margin-left: auto;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

/* ================= SETTINGS ================= */

.settings-page {
  max-width: 720px;
  margin: 0 auto;
}

.settings-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}

.settings-group-title {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.settings-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-group.danger .settings-item {
  color: #ff4d4d;
}

/* ================= SWITCH ================= */

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 999px;
  cursor: pointer;
}

.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: #fff;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
  background: #000;
}

/* ================= BOTTOM NAV ================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
}

.bottom-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-nav a.active {
  color: var(--text);
}
/* ================= AUTH MODAL ================= */

dialog {
  display: none;
}

dialog[open] {
  display: block;
}

.auth-dialog {
  width: 420px;
  max-width: 92%;
  border: none;
  border-radius: 18px;
  padding: 26px;
  background: linear-gradient(180deg, #111, #000);
  color: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.85);
}

.auth-dialog::backdrop {
  background: rgba(0,0,0,0.75);
}

.auth-dialog h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.auth-dialog h3 {
  font-size: 14px;
  margin: 18px 0 8px;
  color: #ccc;
}

.auth-dialog input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid #222;
  background: #0c0c0c;
  color: #fff;
}

.auth-dialog button {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #000;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
}

.auth-dialog button.ghost {
  background: transparent;
  color: #aaa;
  border: 1px solid #222;
}

.age-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 10px 0;
}

.auth-dialog hr {
  border: none;
  height: 1px;
  background: #222;
  margin: 18px 0;
}
/* ===============================
   SEARCH BAR VISIBILITY (LOCKED)
================================ */

/* Hide search by default */
.search-bar {
  display: none !important;
}

/* Show search ONLY on content tabs */
body[data-tab="home"] .search-bar,
body[data-tab="videos"] .search-bar,
body[data-tab="podcasts"] .search-bar,
body[data-tab="clips"] .search-bar {
  display: flex !important;
}

/* Explicitly hide on these tabs */
body[data-tab="upload"] .search-bar,
body[data-tab="profile"] .search-bar,
body[data-tab="settings"] .search-bar {
  display: none !important;
}
/* ================= PROFILE — FINAL SINGLE SOURCE ================= */

.profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 120px;
}

/* Banner */
.profile-banner {
  position: relative;
  height: 260px;
  background: linear-gradient(180deg, #111, #000);
  border-radius: 16px;
}

/* Avatar overlaps banner */
.profile-avatar {
  position: absolute;
  bottom: -70px;
  left: 40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #222;
  border: 4px solid #000;
  z-index: 20;
}

/* Header */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 90px 40px 24px;
}

/* Meta */
.profile-meta {
  max-width: 520px;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
}

.profile-handle {
  color: #aaa;
  margin-bottom: 6px;
}

.profile-bio {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 14px;
}

/* Stats */
.profile-stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.profile-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-stats strong {
  font-size: 16px;
}

/* Edit button */
.edit-profile-btn {
  margin-left: auto;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Tabs */
.profile-tabs {
  display: flex;
  gap: 12px;
  padding: 16px 40px;
  border-top: 1px solid #222;
  flex-wrap: wrap;
}

.profile-tabs button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #333;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.profile-tabs button.active {
  background: #fff;
  color: #000;
}
/* ================= TRENDING FILTERS (HOME ONLY) ================= */

.trending-filters {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.trending-filters button {
  background: transparent;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.trending-filters button.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}
/* ================= HOME FILTERS ================= */

.home-filters {
  display: flex;
  gap: 10px;
  margin: 10px 0 20px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}
/* ================= UNIFIED FEED CARD ================= */

.feed-card {
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.feed-card:hover {
  background: #151515;
  transform: translateY(-2px);
}

/* Thumbnail */
.feed-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
}

/* Info */
.feed-info {
  padding: 12px 14px;
}

.feed-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #aaa;
}

.feed-creator {
  color: #bbb;
}

.dot {
  opacity: 0.5;
}
/* ================= HOME FEED ================= */

.home-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.feed-card {
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.feed-card:hover {
  transform: translateY(-4px);
}

.feed-thumb {
  height: 140px;
  background: linear-gradient(135deg, #222, #000);
}

.feed-info {
  padding: 12px;
}

.feed-info h4 {
  font-size: 14px;
  margin-bottom: 6px;
}

.feed-info p {
  font-size: 12px;
  color: #aaa;
}
/* ================= HOME ================= */

.home-filters {
  display: flex;
  gap: 10px;
  margin: 10px 0 20px;
  overflow-x: auto;
}

.filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn.active {
  background: #fff;
  color: #000;
}

/* ================= FEED ================= */

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.feed-card {
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}

.feed-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
}

.feed-info {
  padding: 12px;
}

.feed-info h4 {
  font-size: 14px;
  margin-bottom: 6px;
}

.feed-info p {
  font-size: 12px;
  color: #aaa;
}

/* ================= PROFILE ================= */

.profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.profile-banner {
  position: relative;
  height: 260px;
  background: linear-gradient(180deg, #111, #000);
  border-radius: 16px;
}

.profile-avatar {
  position: absolute;
  bottom: -70px;
  left: 40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #222;
  border: 4px solid #000;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 90px 40px 24px;
}
/* Hide search by default */
.search-bar {
  display: none !important;
}
body[data-tab="home"] .search-bar,
body[data-tab="videos"] .search-bar,
body[data-tab="podcasts"] .search-bar,
body[data-tab="clips"] .search-bar {
  display: flex !important;
}
/* ================= SETTINGS VISIBILITY FIX ================= */
 
/* Make sure settings page is not collapsed */
body[data-tab="settings"] .settings-page {
  display: block;
  opacity: 1;
}
body[data-tab="settings"] #mainHeader {
  border-bottom: 1px solid #222;
}
/* ================= HOME FILTERS — HARD LOCK ================= */

.home-filters {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.home-filters .filter-btn {
  background: transparent !important;
  border: 1px solid #333 !important;
  color: #fff !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  cursor: pointer !important;
}

.home-filters .filter-btn.active {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}
/* ================= HEADER USERNAME ================= */
.header-username {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: none;
}
/* ===== AUTH SPINNER ===== */
.auth-spinner {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-spinner.hidden {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #333;
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
}
body.auth-checking {
  pointer-events: none;
  opacity: 0.98;
}
/* ================= FINAL TAB VISIBILITY FIX ================= */
.tab-section.active {
  display: block !important;
  min-height: calc(100vh - 200px);
  padding-bottom: 120px;
  visibility: visible;
  opacity: 1;
}
