/* ============================================================
   BoostGrid — React App Specific Styles
   Extends main.css with React-component-specific overrides
   ============================================================ */

/* ── Root mount ─────────────────────────────────────────────── */
#root {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Page active override (React controls visibility) ─────── */
/* In React app, pages are always "active" — visibility is React's job */
.page {
  display: block !important;
  animation: none; /* React handles transitions */
}

/* ── Admin tabs ─────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--fg3);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
  position: relative;
  bottom: -1px;
}

.admin-tab:hover { color: var(--fg2); background: var(--surface2); }

.admin-tab.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--fg);
}

.admin-tab.active i { color: var(--accent); }

.admin-tab i { font-size: .76rem; }

/* ── Admin section ──────────────────────────────────────────── */
.admin-section {
  display: none;
  padding-top: 4px;
}

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

/* ── Stats admin grid ───────────────────────────────────────── */
.stats-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Profile grid ───────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Sidebar open state (mobile) ────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 300;
    transition: transform .2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle-btn {
    display: flex !important;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-tab {
    font-size: .75rem;
    padding: 7px 10px;
  }
}

/* ── Smooth page content ────────────────────────────────────── */
.pages {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

/* ── Toast container (React renders this) ───────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

/* ── Topbar sidebar toggle — always show in React ───────────── */
.sidebar-toggle-btn {
  display: flex;
  background: none;
  border: none;
  color: var(--fg3);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: .9rem;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.sidebar-toggle-btn:hover {
  color: var(--fg);
  background: var(--surface2);
}

/* ── React modal (portal rendered in body) ──────────────────── */
.modal-overlay {
  animation: pageFade .15s ease;
}

/* ── Campaign card progress bar animation ───────────────────── */
@keyframes progressFill {
  from { width: 0; }
}

/* ── Skeleton pulse ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--surface3) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 5px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Balance chip cyan color ─────────────────────────────────── */
:root {
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  --primary: var(--accent);
  --bg2: var(--surface2);
  --bg3: var(--surface3);
  --bg4: #2e2e2e;
  --fg1: var(--fg);
}

/* ── Button ghost variant ───────────────────────────────────── */
.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--fg3);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--fg2);
}

/* ── Form row responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Table responsive ─────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Scrollbar in modal ──────────────────────────────────────── */
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Active nav indicator line ───────────────────────────────── */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

/* ── Card hover lift ─────────────────────────────────────────── */
.stat-card {
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover {
  transform: translateY(-1px);
}
