/* =========================================================
   NIMBUS CAPITAL — Premium Investment App
   Design tokens, layout, components, animations
   ========================================================= */

:root {
  --bg: #08111F;
  --card: #101C32;
  --card-alt: #14213A;
  --primary: #1E88E5;
  --primary-light: #4FA3F7;
  --secondary: #00C853;
  --accent: #FFD54F;
  --danger: #FF5252;
  --text-primary: #FFFFFF;
  --text-secondary: #AAB5C5;
  --border: rgba(255, 255, 255, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-glow-blue: 0 8px 32px rgba(30, 136, 229, 0.28);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: 'Poppins', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }
img { display: block; }

/* =========================================================
   APP SHELL — locked portrait mobile frame
   ========================================================= */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(30,136,229,0.12) 0%, rgba(8,17,31,0) 55%),
    var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 17, 31, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  animation: fadeDown 0.6s ease both;
}

.header-left { display: flex; align-items: center; gap: 11px; }

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #16233D, #0C1526);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.header-text { display: flex; flex-direction: column; line-height: 1.25; }
.greeting { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.username { font-size: 14.5px; font-weight: 700; letter-spacing: 0.1px; }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-clock {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.icon-btn:active { transform: scale(0.9); }

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

.avatar-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }

/* =========================================================
   MAIN SCROLL AREA
   ========================================================= */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 0;
  scroll-behavior: smooth;
}

.section-block { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: 0.1px; }
.see-all { font-size: 12.5px; font-weight: 600; color: var(--primary-light); }

.scroll-spacer { height: 110px; }

/* =========================================================
   HERO BALANCE CARD
   ========================================================= */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  background: linear-gradient(155deg, #16376B 0%, #0F2B57 38%, #0B1E40 70%, #0A1830 100%);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: var(--shadow-glow-blue), var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  z-index: -1;
  animation: pulseGlow 5s ease-in-out infinite;
}
.hero-glow-a {
  width: 220px; height: 220px;
  top: -90px; right: -60px;
  background: radial-gradient(circle, rgba(30,136,229,0.55), transparent 70%);
}
.hero-glow-b {
  width: 180px; height: 180px;
  bottom: -80px; left: -50px;
  background: radial-gradient(circle, rgba(255,213,79,0.25), transparent 70%);
  animation-delay: 1.5s;
}

.hero-float {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  z-index: -1;
}
.f1 { width: 54px; height: 54px; top: 14px; right: 18px; animation: floatY 4.5s ease-in-out infinite; }
.f2 { width: 26px; height: 26px; top: 74px; right: 70px; animation: floatY 3.6s ease-in-out infinite 0.6s; }
.f3 { width: 16px; height: 16px; bottom: 30px; right: 40px; animation: floatY 5s ease-in-out infinite 1s; }

.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-label { font-size: 12.5px; color: rgba(255,255,255,0.7); font-weight: 500; letter-spacing: 0.2px; }

.eye-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.eye-btn:active { transform: scale(0.88); }

.hero-balance {
  margin-top: 10px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.hero-balance .currency { font-size: 22px; font-weight: 700; color: rgba(255,255,255,0.75); }

.hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.pill-up { background: rgba(0, 200, 83, 0.16); color: var(--secondary); }

.hero-profit-today { font-size: 12.5px; color: rgba(255,255,255,0.65); display: flex; align-items: center; gap: 6px; }
.hero-profit-today strong { color: var(--accent); font-size: 13px; }

.hero-actions { display: flex; gap: 12px; margin-top: 22px; }

.hero-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 0;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.2s ease;
}
.hero-btn:active { transform: scale(0.96); }
.hero-btn.primary { background: linear-gradient(135deg, var(--primary), #1565C0); box-shadow: 0 6px 18px rgba(30,136,229,0.45); }
.hero-btn.secondary { background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.14); }

/* =========================================================
   STATS GRID
   ========================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:active { transform: translateY(-2px) scale(0.99); }

.stat-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.icon-blue { background: rgba(30,136,229,0.14); }
.icon-green { background: rgba(0,200,83,0.14); }
.icon-amber { background: rgba(255,213,79,0.14); }
.icon-red { background: rgba(255,82,82,0.14); }

.stat-value { font-size: 18.5px; font-weight: 800; letter-spacing: -0.2px; }
.stat-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 500; }

/* =========================================================
   INVESTMENT PLANS
   ========================================================= */
.plans-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scroll-snap-type: x mandatory;
}

.plan-card {
  scroll-snap-align: start;
  flex: 0 0 210px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.plan-card:active { transform: translateY(-3px); }

.plan-card.featured {
  background: linear-gradient(160deg, #123059, #0E2340);
  border-color: rgba(30,136,229,0.4);
  box-shadow: 0 0 0 1px rgba(30,136,229,0.15), 0 14px 30px rgba(30,136,229,0.22);
  animation: glowPulseBorder 3.2s ease-in-out infinite;
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: linear-gradient(135deg, var(--accent), #FFB300);
  color: #08111F;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 10px rgba(255,213,79,0.35);
}

.plan-tag { font-size: 12px; font-weight: 700; color: var(--primary-light); text-transform: uppercase; letter-spacing: 0.6px; }
.plan-amount { font-size: 17px; font-weight: 800; margin-top: 8px; }
.plan-amount span { color: var(--text-secondary); font-weight: 500; }

.plan-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.plan-row span { color: var(--text-secondary); }
.text-green { color: var(--secondary); }
.text-amber { color: var(--accent); }

.plan-btn {
  width: 100%;
  margin-top: 16px;
  padding: 11px 0;
  border-radius: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 0.18s ease;
}
.plan-btn.primary { background: linear-gradient(135deg, var(--primary), #1565C0); border: none; box-shadow: 0 6px 16px rgba(30,136,229,0.4); }
.plan-btn:active { transform: scale(0.95); }

/* =========================================================
   TRANSACTIONS
   ========================================================= */
.tx-list { display: flex; flex-direction: column; gap: 10px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: transform 0.2s ease;
}
.tx-item:active { transform: scale(0.98); }

.tx-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }

.tx-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-name { font-size: 13.5px; font-weight: 600; }
.tx-time { font-size: 11px; color: var(--text-secondary); }

.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tx-amount { font-size: 13.5px; font-weight: 700; color: var(--secondary); }
.tx-amount.tx-negative { color: var(--danger); }

.tx-badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.tx-badge.success { background: rgba(0,200,83,0.14); color: var(--secondary); }
.tx-badge.pending { background: rgba(255,213,79,0.14); color: var(--accent); }

/* =========================================================
   REFERRAL BANNER
   ========================================================= */
.referral-banner {
  position: relative;
  margin-top: 30px;
  border-radius: var(--radius-lg);
  padding: 24px 22px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, #FFB300 100%);
  color: #08111F;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.referral-glow {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.4), transparent 70%);
  top: -100px; left: -60px;
}

.referral-illustration {
  width: 54px; height: 54px;
  margin-bottom: 6px;
}

.referral-title { font-size: 17px; font-weight: 800; }
.referral-sub { font-size: 12.5px; font-weight: 500; opacity: 0.75; margin-bottom: 14px; }

.referral-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8,17,31,0.12);
  border: 1.5px dashed rgba(8,17,31,0.35);
  border-radius: 14px;
  padding: 10px 12px;
}
.referral-code { flex: 1; font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.copy-btn {
  background: #08111F;
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  transition: transform 0.18s ease;
}
.copy-btn:active { transform: scale(0.92); }

.invite-btn {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #08111F;
  color: white;
  padding: 13px 0;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform 0.18s ease;
}
.invite-btn:active { transform: scale(0.96); }

/* =========================================================
   PROMO BANNER
   ========================================================= */
.promo-banner {
  margin-top: 20px;
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(120deg, #00C853, #009951, #00C853);
  background-size: 220% 220%;
  animation: gradientShift 6s ease infinite;
  color: #062012;
}

.promo-content { display: flex; flex-direction: column; gap: 4px; }
.promo-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.7; }
.promo-title { font-size: 15.5px; font-weight: 800; max-width: 190px; line-height: 1.3; }

.promo-btn {
  margin-top: 10px;
  align-self: flex-start;
  background: #08111F;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 11px;
  transition: transform 0.18s ease;
}
.promo-btn:active { transform: scale(0.94); }

.promo-art { flex-shrink: 0; opacity: 0.9; }

/* =========================================================
   FLOATING ACTION BUTTON
   ========================================================= */
.fab {
  position: absolute;
  right: 18px;
  bottom: 104px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #1565C0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(30,136,229,0.55);
  z-index: 45;
  animation: glowPulseFab 2.6s ease-in-out infinite;
  transition: transform 0.2s ease;
}
.fab:active { transform: scale(0.9); }

/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */
.bottom-nav {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 6px;
  border-radius: 26px;
  background: rgba(16, 28, 50, 0.68);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
  z-index: 50;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 16px;
  transition: color 0.25s ease, transform 0.2s ease;
}
.nav-item span:last-child { font-size: 10px; font-weight: 600; }
.nav-item:active { transform: scale(0.92); }

.nav-item.active { color: var(--primary-light); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(30,136,229,0.7)); }

.nav-indicator {
  position: absolute;
  top: -2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary-light);
  opacity: 0;
  box-shadow: 0 0 8px var(--primary-light);
  transition: opacity 0.25s ease;
}
.nav-item.active .nav-indicator { opacity: 1; }

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  background: #0F2340;
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 60;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   RIPPLE EFFECT
   ========================================================= */
.ripple { position: relative; overflow: hidden; }
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--delay, 0) * 0.08s);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   KEYFRAME ANIMATIONS
   ========================================================= */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glowPulseBorder {
  0%, 100% { box-shadow: 0 0 0 1px rgba(30,136,229,0.15), 0 14px 30px rgba(30,136,229,0.22); }
  50% { box-shadow: 0 0 0 1px rgba(30,136,229,0.35), 0 14px 38px rgba(30,136,229,0.4); }
}

@keyframes glowPulseFab {
  0%, 100% { box-shadow: 0 8px 24px rgba(30,136,229,0.55); }
  50% { box-shadow: 0 8px 34px rgba(30,136,229,0.85), 0 0 0 8px rgba(30,136,229,0.08); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes rippleAnim {
  to { transform: scale(2.6); opacity: 0; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   SMALL SCREEN TUNING
   ========================================================= */
@media (max-width: 360px) {
  .hero-balance { font-size: 34px; }
  .plan-card { flex: 0 0 190px; }
}
