/* ==========================================================================
   GD Stake — Core Styles
   Design tokens + base component styles for the staking platform UI

   Palette recolored to match the mark: platinum/silver (#f6f8fc → #c9d3e6)
   paired with the logo's electric-to-deep blue (#86b3ff → #3b7bff). Purple,
   violet, and cyan tokens are kept for backward-compatibility (in case
   other pages reference them directly) but now resolve to blue/silver
   values instead of their original hues. Functional status colors
   (positive/negative/amber) are left untouched — those are semantic
   (gains/losses/warnings), not brand color.
   ========================================================================== */

:root {
  /* ---- Palette --------------------------------------------------------- */
  --gd-black: #00030a;
  --gd-navy: #0a1730;
  --gd-surface: #080c17;
  --gd-surface-2: #0b1120;
  --gd-surface-3: #131a2c;
  --gd-border: rgba(198, 212, 240, 0.08);
  --gd-border-strong: rgba(134, 179, 255, 0.28);

  --gd-blue: #3b7bff;
  --gd-blue-2: #86b3ff;
  --gd-purple: #3b7bff; /* merged into blue */
  --gd-violet: #86b3ff; /* merged into light blue */
  --gd-cyan: #86b3ff; /* merged into light blue */
  --gd-silver: #f6f8fc;
  --gd-silver-2: #c9d3e6;
  --gd-emerald: #2ee6a6;
  --gd-red: #ff5c7a;
  --gd-amber: #f5a623;

  --gd-gradient-primary: linear-gradient(
    100deg,
    #f6f8fc 0%,
    #cfe0ff 32%,
    #86b3ff 62%,
    #3b7bff 100%
  );
  --gd-gradient-teal: linear-gradient(100deg, #86b3ff 0%, #3b7bff 100%);
  --gd-gradient-radial: radial-gradient(
    circle at 25% 15%,
    rgba(59, 123, 255, 0.16),
    transparent 55%
  );
  --gd-gradient-card: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.025) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  --gd-gradient-text: linear-gradient(
    96deg,
    #f6f8fc 0%,
    #c9d3e6 40%,
    #86b3ff 72%,
    #3b7bff 100%
  );

  --gd-text-primary: #f6f8fc;
  --gd-text-secondary: #8b94ac;
  --gd-text-muted: #545e77;

  --gd-glow-blue: 0 0 24px rgba(59, 123, 255, 0.32);
  --gd-glow-purple: 0 0 26px rgba(134, 179, 255, 0.32);
  --gd-shadow-card: 0 10px 28px rgba(0, 0, 0, 0.45);
  --gd-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.3);

  --gd-radius-sm: 12px;
  --gd-radius-md: 18px;
  --gd-radius-lg: 24px;
  --gd-radius-pill: 999px;

  --gd-font-display: "Poppins", sans-serif;
  --gd-font-body: "Inter", sans-serif;

  --gd-app-max: 430px;
  --gd-nav-h: 78px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--gd-black);
  color: var(--gd-text-primary);
  font-family: var(--gd-font-body);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--gd-font-display);
  color: var(--gd-text-primary);
  margin: 0;
}

.text-grad {
  background: var(--gd-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted-gd {
  color: var(--gd-text-secondary) !important;
}
.text-faint-gd {
  color: var(--gd-text-muted) !important;
}
.text-positive {
  color: var(--gd-emerald) !important;
}
.text-negative {
  color: var(--gd-red) !important;
}
.text-cyan-gd {
  color: var(--gd-cyan) !important;
}
.text-amber-gd {
  color: var(--gd-amber) !important;
}

/* ---- App Shell ---------------------------------------------------------- */

.app-shell {
  max-width: var(--gd-app-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--gd-gradient-radial), var(--gd-black);
  overflow-x: hidden;
  padding-bottom: calc(var(--gd-nav-h) + 14px);
}

.app-shell.no-bottom-nav {
  padding-bottom: 0;
}

.app-main {
  padding: 18px 18px 8px;
  animation: gdFadeIn 0.45s ease both;
}

/* subtle starfield dots on dark backgrounds */
.starfield {
  position: fixed;
  inset: 0;
  max-width: var(--gd-app-max);
  margin: 0 auto;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(
      1.5px 1.5px at 40% 80%,
      rgba(255, 255, 255, 0.3),
      transparent
    ),
    radial-gradient(1px 1px at 90% 15%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0.5;
  z-index: 0;
}

/* ---- Topbar -------------------------------------------------------------- */

.gd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 6px;
  position: relative;
  z-index: 5;
}

.gd-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--gd-radius-pill);
  background: var(--gd-surface-2);
  border: 1px solid var(--gd-border);
  color: var(--gd-text-primary);
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}
.gd-icon-btn:hover {
  background: var(--gd-surface-3);
  box-shadow: var(--gd-glow-blue);
}
.gd-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gd-red);
  box-shadow: 0 0 6px var(--gd-red);
}

.gd-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gd-page-title h1 {
  font-size: 18px;
  font-weight: 600;
}
.gd-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gd-surface-2);
  border: 1px solid var(--gd-border);
}

/* ---- Cards ---------------------------------------------------------------- */

.gd-card {
  background: var(--gd-surface);
  background-image: var(--gd-gradient-card);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius-md);
  padding: 18px;
  box-shadow: var(--gd-shadow-card);
  position: relative;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.gd-card.hoverable:hover {
  transform: translateY(-3px);
  border-color: var(--gd-border-strong);
  box-shadow: var(--gd-shadow-card), var(--gd-glow-blue);
}

.gd-card-glow {
  box-shadow:
    var(--gd-shadow-card),
    0 0 40px -10px rgba(59, 123, 255, 0.35);
}

.gd-hero-card {
  border-radius: var(--gd-radius-lg);
  padding: 20px 22px;
  background: var(--gd-surface);
  background-image:
    radial-gradient(
      circle at 88% 18%,
      rgba(59, 123, 255, 0.35),
      transparent 45%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(134, 179, 255, 0.18),
      transparent 55%
    ),
    var(--gd-gradient-card);
  border: 1px solid var(--gd-border);
  position: relative;
  overflow: hidden;
  box-shadow: var(--gd-shadow-card);
}
.gd-hero-card::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -25%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(80, 130, 255, 0.45) 0%,
    rgba(80, 130, 255, 0.08) 45%,
    transparent 70%
  );
  filter: blur(2px);
  pointer-events: none;
}
.gd-hero-card > * {
  position: relative;
  z-index: 1;
}

/* Outer "wrap" card — contains multiple divided inner sections (Login,
   AI Insights, Retirement Planner, Rewards, Referral, Transactions, Profile) */
.gd-outer-card {
  background: var(--gd-surface);
  background-image: var(--gd-gradient-card);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius-lg);
  box-shadow: var(--gd-shadow-card);
  overflow: hidden;
}
.gd-outer-card .gd-inner-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--gd-border);
}
.gd-outer-card .gd-inner-section:last-child {
  border-bottom: none;
}
.gd-outer-card .gd-inner-card {
  margin: 14px 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius-md);
}

/* ---- Buttons --------------------------------------------------------------- */

.btn-gd-primary {
  background: var(--gd-gradient-primary);
  border: none;
  color: #04070f;
  font-weight: 600;
  border-radius: var(--gd-radius-sm);
  padding: 13px 20px;
  width: 100%;
  box-shadow: 0 6px 18px -4px rgba(59, 123, 255, 0.55);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.btn-gd-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(59, 123, 255, 0.7);
  color: #04070f;
}
.btn-gd-primary:active {
  transform: translateY(0);
}

.btn-gd-ghost {
  background: var(--gd-surface-2);
  border: 1px solid var(--gd-border-strong);
  color: var(--gd-text-primary);
  font-weight: 600;
  border-radius: var(--gd-radius-sm);
  padding: 13px 20px;
  width: 100%;
  transition: all 0.2s ease;
}
.btn-gd-ghost:hover {
  background: var(--gd-surface-3);
  color: #fff;
}

.btn-gd-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--gd-radius-pill);
  font-weight: 600;
}

/* ripple */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: gdRipple 0.6s linear;
  pointer-events: none;
}
@keyframes gdRipple {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* ---- Form fields ------------------------------------------------------------ */

.gd-field label {
  font-size: 12.5px;
  color: var(--gd-text-secondary);
  margin-bottom: 6px;
  display: block;
  font-weight: 500;
}
.gd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gd-surface-2);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius-sm);
  padding: 12px 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.gd-input-wrap:focus-within {
  border-color: var(--gd-blue-2);
  box-shadow: 0 0 0 3px rgba(134, 179, 255, 0.18);
}
.gd-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--gd-text-primary);
  width: 100%;
  font-size: 14px;
}
.gd-input-wrap input::placeholder {
  color: var(--gd-text-muted);
}
.gd-input-wrap i {
  color: var(--gd-text-muted);
}

.gd-tabs {
  display: flex;
  background: var(--gd-surface-2);
  border-radius: var(--gd-radius-pill);
  padding: 4px;
  border: 1px solid var(--gd-border);
}
.gd-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--gd-text-secondary);
  padding: 9px 10px;
  border-radius: var(--gd-radius-pill);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.gd-tabs button.active {
  background: var(--gd-gradient-primary);
  color: #04070f;
  box-shadow: var(--gd-glow-blue);
}

/* Underline tab style — used on Login */
.gd-tabs-underline {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--gd-border);
}
.gd-tabs-underline button {
  border: none;
  background: transparent;
  color: var(--gd-text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 2px 12px;
  position: relative;
}
.gd-tabs-underline button.active {
  color: #fff;
}
.gd-tabs-underline button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--gd-gradient-primary);
  border-radius: 2px;
}

/* ---- Progress bars ------------------------------------------------------------ */

.gd-progress {
  width: 100%;
  height: 8px;
  border-radius: var(--gd-radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.gd-progress > span {
  display: block;
  height: 100%;
  border-radius: var(--gd-radius-pill);
  background: var(--gd-gradient-primary);
  width: 0%;
  transition: width 1.1s cubic-bezier(0.22, 0.8, 0.28, 1);
  box-shadow: 0 0 10px rgba(59, 123, 255, 0.6);
}
.gd-progress.thin {
  height: 6px;
}
.gd-progress.teal > span {
  background: var(--gd-gradient-teal);
  box-shadow: 0 0 10px rgba(134, 179, 255, 0.5);
}

/* ---- Badges ------------------------------------------------------------------- */

.gd-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--gd-radius-pill);
  font-size: 11.5px;
  font-weight: 700;
}
.gd-badge.positive {
  background: rgba(22, 209, 155, 0.14);
  color: var(--gd-emerald);
}
.gd-badge.negative {
  background: rgba(255, 92, 122, 0.14);
  color: var(--gd-red);
}
.gd-badge.info {
  background: rgba(59, 123, 255, 0.16);
  color: #86b3ff;
}
.gd-badge.amber {
  background: rgba(255, 181, 71, 0.14);
  color: var(--gd-amber);
}
.gd-badge.neutral {
  background: var(--gd-surface-3);
  color: var(--gd-text-secondary);
}

.gd-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gd-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #04070f;
}

.gd-coin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.gd-coin.eth {
  background: linear-gradient(135deg, #86b3ff, #3b7bff);
  color: #fff;
}
.gd-coin.sol {
  background: #05070d;
  border: 1px solid var(--gd-border-strong);
  color: transparent;
  background-image:
    linear-gradient(
      135deg,
      rgba(134, 179, 255, 0.15),
      rgba(59, 123, 255, 0.15)
    ),
    #05070d;
}
.gd-coin.sol i {
  background: linear-gradient(135deg, #f6f8fc, #3b7bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gd-coin.xrp {
  background: #05070d;
  border: 1.5px solid #fff;
  color: #fff;
}

/* AI metric ring icon — concentric circle "target" glyph */
.gd-ring-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
}
.gd-ring-icon::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
.gd-ring-icon.rc-green {
  color: var(--gd-emerald);
}
.gd-ring-icon.rc-amber {
  color: var(--gd-amber);
}
.gd-ring-icon.rc-blue {
  color: var(--gd-cyan);
}

/* ---- Bottom Navigation ------------------------------------------------------- */

.gd-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--gd-app-max);
  background: rgba(16, 20, 31, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--gd-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--gd-nav-h);
  padding-bottom: 8px;
  z-index: 50;
}
.gd-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--gd-text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 12px;
  transition: color 0.2s ease;
  flex: 1;
}
.gd-nav-item i {
  font-size: 18px;
}
.gd-nav-item.active {
  color: #fff;
}
.gd-nav-item.active i {
  color: var(--gd-cyan);
  filter: drop-shadow(0 0 6px rgba(134, 179, 255, 0.7));
}

/* ---- Side Drawer --------------------------------------------------------------- */

.gd-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 90;
}
.gd-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.gd-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -300px;
  width: 280px;
  background: var(--gd-navy);
  border-right: 1px solid var(--gd-border);
  z-index: 95;
  transition: left 0.32s cubic-bezier(0.22, 0.8, 0.28, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
}
.gd-drawer.open {
  left: 0;
}
.gd-drawer-header {
  padding: 26px 20px 18px;
  border-bottom: 1px solid var(--gd-border);
}
.gd-drawer-body {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}
.gd-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--gd-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s ease;
}
.gd-drawer-link .gd-drawer-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gd-border-strong);
  border-radius: 9px;
  color: var(--gd-text-muted);
  font-size: 13px;
}
.gd-drawer-link:hover,
.gd-drawer-link.active {
  background: var(--gd-surface-2);
  color: #fff;
}
.gd-drawer-link.active .gd-drawer-icon {
  color: #04070f;
  background: var(--gd-gradient-primary);
  border-color: transparent;
}
.gd-drawer-link.danger {
  color: var(--gd-red);
}
.gd-drawer-link.danger .gd-drawer-icon {
  color: var(--gd-red);
  border-color: rgba(255, 92, 122, 0.3);
}

/* ---- Sections / misc ------------------------------------------------------------ */

.gd-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.gd-section-title h2 {
  font-size: 15px;
  font-weight: 600;
}
.gd-section-title a {
  font-size: 12.5px;
  color: var(--gd-cyan);
  font-weight: 600;
}

.gd-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--gd-border);
}
.gd-list-row:last-child {
  border-bottom: none;
}

.gd-divider {
  height: 1px;
  background: var(--gd-border);
  margin: 14px 0;
  border: none;
}

.gd-stat-mini {
  text-align: center;
  flex: 1;
}
.gd-stat-mini .val {
  font-size: 15px;
  font-weight: 700;
}
.gd-stat-mini .lbl {
  font-size: 10.5px;
  color: var(--gd-text-muted);
  margin-top: 2px;
}

.gd-toggle {
  width: 44px;
  height: 26px;
  border-radius: 20px;
  background: var(--gd-surface-3);
  border: 1px solid var(--gd-border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.gd-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.gd-toggle.on {
  background: var(--gd-gradient-primary);
}
.gd-toggle.on::after {
  left: 20px;
}
.gd-toggle.green.on {
  background: var(--gd-emerald);
}

/* scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--gd-surface-3);
  border-radius: 10px;
}

/* ---- Animations ------------------------------------------------------------------ */

@keyframes gdFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gdFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
@keyframes gdPulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 123, 255, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 123, 255, 0);
  }
}
.pulse-dot {
  animation: gdPulseGlow 2s infinite;
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--gd-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.5s ease;
}
