/* ============================================
   ELON SHARES — White Theme
   ============================================ */
:root {
  --bg:       #ffffff;
  --bg-card:  #f8f9fb;
  --bg-hover: #f0f1f5;
  --border:   #e5e7eb;
  --gold:     #f0b429;
  --gold-d:   #d4a00e;
  --text:     #111827;
  --text-m:   #6b7280;
  --text-s:   #9ca3af;
  --green:    #10b981;
  --red:      #ef4444;
  --blue:     #3b82f6;
  --radius:   14px;
  --radius-sm: 10px;
  --shadow:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --font:     'Inter', sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:var(--font); background:var(--bg); color:var(--text); min-height:100vh; }
.hidden { display:none !important; }

/* ===== AUTH ===== */
.auth-screen {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  padding:20px;
}
.auth-card {
  background:var(--bg); border-radius:var(--radius);
  padding:36px 28px; width:100%; max-width:400px;
  box-shadow:0 4px 24px rgba(0,0,0,0.08);
}
.auth-header { text-align:center; margin-bottom:28px; }
.brand { display:flex; align-items:center; gap:8px; justify-content:center; }
.brand-sm .brand-text { font-size:15px; }
.brand-text { font-size:22px; font-weight:800; letter-spacing:1px; color:var(--text); }
.brand-accent { color:var(--gold); }
.brand-sub { color:var(--text-m); font-size:13px; margin-top:4px; }

.auth-tabs { display:flex; background:var(--bg-card); border-radius:var(--radius-sm); padding:4px; margin-bottom:20px; }
.auth-tabs .tab {
  flex:1; padding:10px; border:none; border-radius:8px;
  background:transparent; color:var(--text-m); font-weight:500;
  font-size:14px; cursor:pointer; transition:0.2s;
}
.auth-tabs .tab.active { background:var(--text); color:#fff; }

.auth-form { display:flex; flex-direction:column; gap:12px; }
.auth-form input {
  padding:12px 16px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:14px; font-family:var(--font); outline:none; transition:0.2s;
}
.auth-form input:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(240,180,41,0.15); }

.btn-main {
  padding:14px; background:var(--text); color:#fff; border:none;
  border-radius:var(--radius-sm); font-size:15px; font-weight:600;
  cursor:pointer; transition:0.2s; font-family:var(--font);
}
.btn-main:hover { background:#1f2937; transform:translateY(-1px); }
.btn-outline {
  padding:10px 18px; background:transparent; color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:14px; font-weight:500; cursor:pointer; transition:0.2s;
}
.btn-outline:hover { background:var(--bg-hover); }

.msg-box {
  margin-top:12px; padding:10px 14px; border-radius:8px;
  font-size:13px; font-weight:500; text-align:center;
}
.msg-box.success { background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
.msg-box.error   { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }

/* ===== DASHBOARD ===== */
.dashboard { min-height:100vh; display:flex; flex-direction:column; padding-bottom:80px; }

.topbar {
  position:sticky; top:0; z-index:50; background:var(--bg);
  padding:12px 16px; display:flex; align-items:center;
  justify-content:space-between; border-bottom:1px solid var(--border);
}
.profile-btn { display:flex; align-items:center; gap:8px; background:none; border:none; cursor:pointer; position:relative; }
.avatar {
  width:34px; height:34px; border-radius:50%;
  background:var(--gold); color:#fff; display:flex;
  align-items:center; justify-content:center; font-weight:700; font-size:14px;
}
.profile-menu {
  position:absolute; top:48px; right:0; background:var(--bg);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  box-shadow:0 8px 24px rgba(0,0,0,0.1); padding:8px; min-width:150px;
  display:flex; flex-direction:column; gap:4px;
}
.profile-menu button {
  padding:10px 14px; border:none; background:none; text-align:left;
  font-size:13px; cursor:pointer; border-radius:6px; color:var(--text);
  font-family:var(--font);
}
.profile-menu button:hover { background:var(--bg-hover); }
.profile-menu button.danger { color:var(--red); }

.main { flex:1; padding:16px; overflow-y:auto; }

/* ===== BANNER ===== */
.banner-scroll {
  width:100%; height:160px; border-radius:var(--radius);
  overflow:hidden; position:relative; margin-bottom:16px;
}
.banner-scroll .slides {
  display:flex; height:100%; animation:slideBanner 20s infinite;
}
.banner-scroll .slides img {
  min-width:100%; height:100%; object-fit:cover; flex-shrink:0;
}
@keyframes slideBanner {
  0%,20% { transform:translateX(0); }
  25%,45% { transform:translateX(-100%); }
  50%,70% { transform:translateX(-200%); }
  75%,95% { transform:translateX(-300%); }
  100% { transform:translateX(-400%); }
}

/* ===== STAT CARDS ===== */
.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.stat-card {
  background:var(--bg-card); border-radius:var(--radius-sm);
  padding:14px; text-align:center; border:1px solid var(--border);
}
.stat-card .stat-val { font-size:20px; font-weight:700; color:var(--text); }
.stat-card .stat-lbl { font-size:11px; color:var(--text-m); margin-top:2px; }
.stat-card.gold .stat-val { color:var(--gold-d); }

/* ===== NOTIFICATIONS ===== */
.notif-feed {
  background:var(--bg-card); border-radius:var(--radius-sm);
  padding:14px; border:1px solid var(--border); margin-bottom:16px;
  max-height:200px; overflow-y:auto;
}
.notif-feed h3 { font-size:13px; color:var(--text-m); margin-bottom:10px; }
.notif-item {
  display:flex; align-items:center; gap:8px;
  padding:8px 0; border-bottom:1px solid var(--border);
  font-size:12px; animation:fadeIn 0.5s;
}
.notif-item:last-child { border-bottom:none; }
.notif-dot { width:8px; height:8px; border-radius:50%; background:var(--green); flex-shrink:0; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ===== PLANS ===== */
.plans-list { display:flex; flex-direction:column; gap:14px; }
.plan-item {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); overflow:hidden;
  transition:0.2s;
}
.plan-item img { width:100%; height:140px; object-fit:cover; }
.plan-info { padding:14px; }
.plan-info h3 { font-size:16px; margin-bottom:4px; }
.plan-info p { font-size:13px; color:var(--text-m); margin-bottom:8px; }
.plan-info .plan-return { font-weight:600; color:var(--gold-d); font-size:14px; }
.plan-info .btn-main { width:100%; margin-top:10px; padding:12px; }

/* ===== DEPOSIT ===== */
.deposit-card {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px; text-align:center;
}
.deposit-card h3 { margin-bottom:12px; }
.deposit-card input {
  width:100%; padding:14px; border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:18px; text-align:center;
  font-family:var(--font); outline:none; margin-bottom:12px;
}
.deposit-card input:focus { border-color:var(--gold); }

/* ===== FRIENDS ===== */
.copy-link {
  display:flex; gap:8px; margin-bottom:16px;
}
.copy-link input {
  flex:1; padding:12px; border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:13px; font-family:var(--font);
  background:var(--bg-card); color:var(--text);
}
.copy-link button {
  padding:12px 16px; background:var(--text); color:#fff;
  border:none; border-radius:var(--radius-sm); cursor:pointer;
  font-weight:600; white-space:nowrap;
}
.ref-bonus { font-size:14px; color:var(--gold-d); font-weight:600; margin-bottom:16px; }

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; padding:10px 8px; color:var(--text-m); font-weight:600; border-bottom:2px solid var(--border); font-size:11px; text-transform:uppercase; }
td { padding:10px 8px; border-bottom:1px solid var(--border); }

/* ===== WITHDRAW ===== */
.withdraw-card {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px;
}
.withdraw-card h3 { margin-bottom:14px; }
.withdraw-card input {
  width:100%; padding:12px; border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:14px; font-family:var(--font);
  outline:none; margin-bottom:10px;
}
.withdraw-card input:focus { border-color:var(--gold); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position:fixed; bottom:0; left:0; right:0; z-index:50;
  background:var(--bg); border-top:1px solid var(--border);
  display:flex; padding:6px 8px 8px;
}
.bottom-nav .nav-btn {
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap:2px; padding:6px 4px; border:none; background:none;
  color:var(--text-s); font-size:10px; font-weight:500; cursor:pointer;
  font-family:var(--font); transition:0.2s;
}
.bottom-nav .nav-btn.active { color:var(--text); font-weight:600; }
.bottom-nav .nav-btn svg { transition:0.2s; }
.bottom-nav .nav-btn.active svg { stroke:var(--text); }

/* ===== RESPONSIVE ===== */
@media (min-width:768px) {
  .stats-row { grid-template-columns:repeat(3,1fr); max-width:600px; margin-left:auto; margin-right:auto; }
  .main { max-width:600px; margin:0 auto; }
  .bottom-nav { max-width:600px; left:50%; transform:translateX(-50%); border-radius:var(--radius) var(--radius) 0 0; }
}
/* Active Plan View */
.active-plan-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.plan-header-card {
  padding: 24px 20px;
  text-align: center;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  border-bottom: 1px solid var(--border);
}

.plan-header-card .plan-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.plan-header-card .plan-amount {
  font-size: 14px;
  color: var(--text-m);
  margin-bottom: 16px;
}

.earnings-display {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 0 20px 20px;
}

.earnings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.earnings-label {
  font-size: 12px;
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.earnings-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-d);
  font-family: 'Inter', sans-serif;
}

.earnings-value.pulse {
  animation: pulseGold 0.3s ease;
}

@keyframes pulseGold {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: #22c55e; }
  100% { transform: scale(1); }
}

.progress-bar-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #22c55e);
  border-radius: 20px;
  transition: width 1s linear;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-m);
}

.chart-container {
  padding: 20px;
  height: 200px;
  position: relative;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

.payout-countdown {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--text-m);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.payout-countdown strong {
  color: var(--text);
  font-size: 16px;
}
/* Mission & Vision */
.mission-vision {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.mission-vision .mv-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mission-vision .mv-text {
  font-size: 13px;
  color: var(--text-m);
  line-height: 1.7;
  margin-bottom: 14px;
}

.mission-vision .mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mission-vision .mv-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.mission-vision .mv-card .mv-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.mission-vision .mv-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.mission-vision .mv-card p {
  font-size: 11px;
  color: var(--text-m);
  line-height: 1.5;
}

/* Support Chat */
.support-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(240, 180, 41, 0.35);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
}

.support-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(240, 180, 41, 0.5);
}

.support-fab svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.support-fab .fab-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-box {
  position: fixed;
  bottom: 150px;
  right: 20px;
  width: 340px;
  max-height: 450px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-header {
  padding: 14px 16px;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}

.chat-header button:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--gold);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.support {
  align-self: flex-start;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg .msg-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input-area {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: #fff;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--gold);
}

.chat-input-area button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-input-area button svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

.chat-typing {
  font-size: 11px;
  color: var(--text-m);
  padding: 4px 14px;
  font-style: italic;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chat-box {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 140px;
  }
  
  .mission-vision .mv-grid {
    grid-template-columns: 1fr;
  }
}