/* dashboard.css - Universal Fab Dashboard Styles */
:root {
  --bg: #090E1A;
  --bg2: #0E1624;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --accent: #3D8BFF;
  --accent2: #7B5EFF;
  --gold: #F5B731;
  --success: #22C97A;
  --danger: #FF5B5B;
  --text: #E8EDF8;
  --muted: rgba(232,237,248,0.45);
  --font: 'Inter', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── NOISE OVERLAY ─── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* ─── AUTH SCREEN ─── */
#auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  background: radial-gradient(ellipse at 50% 0%, rgba(61,139,255,0.15) 0%, var(--bg) 70%);
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%; max-width: 420px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 36px;
}
.auth-logo .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.auth-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.form-group input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font-size: 15px; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 12px; border: none;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; width: 100%; margin-top: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(61,139,255,0.35); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-gold { background: linear-gradient(135deg, #F5B731, #E8853D); color: #000; font-weight: 700; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,183,49,0.35); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ─── MAIN DASHBOARD ─── */
#dashboard { display: none; min-height: 100vh; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(9,14,26,0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-size: 16px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; }
.nav-logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-user { font-size: 13px; color: var(--muted); }
.btn-sm { padding: 8px 16px; border-radius: 8px; font-size: 13px; width: auto; margin-top: 0; }

/* Hero stats */
.hero {
  background: linear-gradient(180deg, rgba(61,139,255,0.08) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
  padding: 48px 32px 40px;
}
.hero-label { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 24px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; max-width: 1000px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 24px;
  position: relative; overflow: hidden;
  transition: background 0.2s;
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(61,139,255,0.3), transparent);
}
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stat-value.blue { color: var(--accent); }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Main Content Layout */
.main { max-width: 1100px; margin: 0 auto; padding: 40px 32px; display: grid; gap: 32px; }

/* Section titles */
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.icon-gold { background: rgba(245,183,49,0.15); }
.icon-blue { background: rgba(61,139,255,0.15); }
.icon-purple { background: rgba(123,94,255,0.15); }
.icon-green { background: rgba(34,201,122,0.15); }
.section-title { font-size: 18px; font-weight: 700; }

/* Perks */
.perks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.perk-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px 24px;
  display: flex; gap: 16px; align-items: flex-start;
  opacity: 0.4; transition: all 0.3s;
  position: relative; overflow: hidden;
}
.perk-card.unlocked { opacity: 1; border-color: rgba(245,183,49,0.3); }
.perk-card.unlocked::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(245,183,49,0.06) 0%, transparent 60%);
}
.perk-icon { font-size: 28px; flex-shrink: 0; }
.perk-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.perk-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.perk-badge {
  display: inline-block; margin-top: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase;
}
.badge-locked { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-unlocked { background: rgba(245,183,49,0.2); color: var(--gold); }

/* Projects grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden; transition: all 0.3s;
}
.project-card:hover { border-color: rgba(61,139,255,0.4); transform: translateY(-2px); }
.project-img {
  height: 160px; background: linear-gradient(135deg, #0E1624 0%, #1a2744 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative; overflow: hidden;
}
.project-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--surface) 100%);
}
.project-badge {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  background: rgba(34,201,122,0.2); color: var(--success); border: 1px solid rgba(34,201,122,0.3);
}
.project-body { padding: 24px; }
.project-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.project-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.project-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.project-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.project-stat-val { font-size: 18px; font-weight: 700; }
.progress-bar { height: 4px; background: var(--border); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; transition: width 0.5s ease; }
.invest-row { display: flex; gap: 10px; align-items: center; }
.invest-input-wrap { flex: 1; position: relative; }
.invest-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 55px 12px 14px;
  color: var(--text); font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color 0.2s;
}
.invest-input:focus { border-color: var(--accent); }
.invest-currency { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }

/* Divident section */
.dividends-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px; }
@media (max-width: 700px) { .dividends-layout { grid-template-columns: 1fr; } }
.withdraw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
}
.balance-display { text-align: center; margin-bottom: 28px; }
.balance-amount { font-size: 42px; font-weight: 800; color: var(--gold); }
.balance-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.operator-select {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.op-btn {
  padding: 10px 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.2s;
}
.op-btn.active { border-color: var(--accent); background: rgba(61,139,255,0.1); color: var(--text); }

/* History table */
.history-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
}
.history-header { padding: 20px 24px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; text-align: left; padding: 12px 24px; border-bottom: 1px solid var(--border);
}
.history-table td { padding: 14px 24px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.history-table tr:last-child td { border-bottom: none; }
.status-pill {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
.pill-paid { background: rgba(34,201,122,0.15); color: var(--success); }
.pill-pending { background: rgba(245,183,49,0.15); color: var(--gold); }
.history-empty { text-align: center; padding: 48px 24px; color: var(--muted); font-size: 14px; }

/* Toast notifications */
#toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast-msg {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px;
  font-size: 14px; animation: slideIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: 320px;
}
.toast-msg.success { border-color: rgba(34,201,122,0.4); color: var(--success); }
.toast-msg.error { border-color: rgba(255,91,91,0.4); color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* Loading spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* My investments mini list */
.my-investments { display: flex; flex-direction: column; gap: 10px; }
.my-inv-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.my-inv-name { font-size: 14px; font-weight: 600; }
.my-inv-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.my-inv-shares { font-size: 20px; font-weight: 800; color: var(--accent); }
/* ─── MOBILE RESPONSIVENESS ─── */
@media (max-width: 600px) {
  .nav { padding: 12px 20px; }
  .nav-logo { font-size: 14px; }
  .nav-user { display: none; }
  
  .main { padding: 24px 16px; }
  
  .perks-grid { grid-template-columns: 1fr; }
  .perk-card { padding: 16px; align-items: center; text-align: center; flex-direction: column; }
  .perk-icon { margin-bottom: 8px; }
  
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { border-radius: 16px; }
  .project-img { height: 140px; }
  .project-body { padding: 16px; }
  .project-stats { grid-template-columns: 1fr; gap: 8px; }
  
  .history-table th:nth-child(3), .history-table td:nth-child(3) { display: none; }
  .history-table th, .history-table td { padding: 10px 12px; font-size: 12px; }
  
  .balance-amount { font-size: 32px; }
  
  .my-inv-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .my-inv-shares { font-size: 18px; align-self: flex-end; }
}

@media (max-width: 400px) {
  .auth-card { padding: 32px 24px; border-radius: 16px; }
  .auth-title { font-size: 22px; }
}
