@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg-glow: rgba(255, 153, 0, 0.12);
  --accent: #ff9900;
  --accent-2: #f3a847;
  --accent-3: #146eb4;
  --danger: #cc0c39;
  --success: #067d62;
  --text-soft: rgba(255, 255, 255, 0.82);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-bg: #1e2a3a;
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.36);
  --focus-ring: 0 0 0 3px rgba(79, 208, 255, 0.3);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --surface: #1e2a3a;
  --surface-2: #2b3d52;
  --glow-blue: rgba(79, 208, 255, 0.18);
  --glow-purple: rgba(111, 108, 255, 0.18);
  /* Elite Spacing Tokens */
  --container-max: 1200px;
  --gap-grid: 32px;
  --gap-section: 64px;
  --padding-card: 28px;

  /* Elite Shadows */
  --shadow-elite: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 20px rgba(79, 208, 255, 0.3);

  /* Elite Radius */
  --radius-pill: 100px;
  --radius-card: 16px;
  --radius-input: 14px;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  letter-spacing: 0.1px;
}

.soft-bg {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(255, 153, 0, 0.12), transparent 55%),
    radial-gradient(900px 600px at 85% 10%, rgba(20, 110, 180, 0.12), transparent 55%),
    linear-gradient(180deg, #151b2f, #0f1324);
  background-attachment: fixed;
}

::selection {
  background: rgba(255, 153, 0, 0.35);
}

a {
  text-decoration: none;
}

button,
.btn,
input,
select,
textarea {
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), background var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

input,
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(79, 208, 255, 0.5);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(79, 208, 255, 0.14);
}

button,
.btn {
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  letter-spacing: 0.3px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Shimmer layer on hover */
button::after,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
  pointer-events: none;
}

button:hover::after,
.btn:hover::after {
  opacity: 1;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}

button:active,
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ─── Card System ─────────────────────────────────────────────────────────── */
.card,
.table-container,
.wallet-box,
.history-item,
.report-card,
.transaction-card,
.purchase-card,
.notif-card,
.chat-card {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  background: var(--card-bg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.purchase-card:hover,
.transaction-card:hover,
.notif-card:hover,
.history-item:hover,
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(79, 208, 255, 0.2);
}

/* ─── Primary Buttons ─────────────────────────────────────────────────────── */
.btn-primary,
.btn-main,
.btn-login,
.pay-btn,
.save-btn {
  background: linear-gradient(135deg, #f0c040, #e8a820);
  border: 1px solid #c88a00;
  color: #111;
  box-shadow: 0 4px 12px rgba(232, 168, 32, 0.22);
  font-weight: 700;
}

.btn-primary:hover,
.btn-main:hover,
.btn-login:hover,
.pay-btn:hover,
.save-btn:hover {
  box-shadow: 0 8px 28px rgba(232, 168, 32, 0.38);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ─── Gradient Text Utility ───────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(90deg, #4fd0ff, #a78bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Professional motion ─────────────────────────────────────────────────── */
.card,
.purchase-card,
.transaction-card,
.notif-card,
.chat-card {
  animation: riseIn 0.55s var(--transition-slow) both;
}

@keyframes riseIn {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Premium Living Interface (Global Background System) ─────────────────── */
.premium-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  will-change: transform;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #4fd0ff, transparent 70%);
  top: -150px;
  left: -100px;
  animation: blobFloat 45s ease-in-out infinite;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6f6cff, transparent 70%);
  bottom: -100px;
  right: -50px;
  animation: blobFloat 60s ease-in-out infinite reverse;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #a78bff, transparent 70%);
  top: 40%;
  left: 60%;
  animation: blobFloat 52s ease-in-out infinite;
  animation-delay: -15s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.1); }
  66%       { transform: translate(-30px, 40px) scale(0.95); }
}

/* Glass Transparency for Cards to show depth */
.card,
.action-card,
.notif-card,
.chat-card,
.purchase-card,
.transaction-card,
.panel-card,
.settings-card,
.glass-card {
  background: rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 4px 24px -1px rgba(0, 0, 0, 0.2),
    inset 0 0 20px 0 rgba(255, 255, 255, 0.02);
}

/* ─── Elite Mist Particles (Floating Droplets) ────────────────────────────── */
.mist-container {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.mist-droplet {
  position: absolute;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent 70%);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  filter: blur(2px);
  will-change: transform, opacity;
  animation: driftUp var(--duration, 15s) ease-in-out infinite;
  opacity: 0;
}

@keyframes driftUp {
  0% { transform: translate(0, 100vh) scale(0.5); opacity: 0; }
  15% { opacity: var(--max-opacity, 0.2); }
  85% { opacity: var(--max-opacity, 0.2); }
  100% { transform: translate(var(--sway, 40px), -100px) scale(1.2); opacity: 0; }
}

/* ─── Micro-Interactions ────────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

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

.btn-hover-glow:hover {
  box-shadow: 0 0 20px rgba(79, 208, 255, 0.3);
  filter: brightness(1.1);
}

/* ─── Mobile Bottom Navigation ────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 19, 36, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 12px;
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
  min-width: 56px;
  min-height: 44px;
  justify-content: center;
  text-decoration: none;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: #4fd0ff;
}

/* ─── Hamburger Menu ──────────────────────────────────────────────────────── */
.hamburger-btn {
  display: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  color: white;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.open {
  display: block;
}

/* ─── Ambient Droplets ────────────────────────────────────────────────────── */
.droplet-ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.droplet-ambient .drop {
  position: absolute;
  border-radius: 60% 40% 58% 42% / 44% 58% 42% 56%;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,0.45), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(79,208,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0.4;
  animation: floatDrop 20s ease-in-out infinite;
}

.droplet-ambient .drop:nth-child(1) {
  width: 90px; height: 110px;
  top: 8%; left: 4%;
  animation-duration: 18s;
}

.droplet-ambient .drop:nth-child(2) {
  width: 60px; height: 74px;
  bottom: 12%; right: 6%;
  animation-duration: 24s;
  animation-delay: -6s;
}

.droplet-ambient .drop:nth-child(3) {
  width: 44px; height: 54px;
  top: 55%; left: 88%;
  animation-duration: 16s;
  animation-delay: -10s;
  opacity: 0.25;
}

@keyframes floatDrop {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  33% { transform: translate3d(12px,-16px,0) rotate(4deg); }
  66% { transform: translate3d(-8px,10px,0) rotate(-3deg); }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── Desktop Layout Shell ───────────────────────────────────────────────── */
.desktop-shell {
  margin: 0 auto;
  max-width: 1280px;
  width: 100%;
}

/* ─── Desktop Refinements (1280px+) ─────────────────────────────────────── */
@media (min-width: 1280px) {
  /* Global body padding scale */
  body.page-padded {
    padding: 40px 56px;
  }

  /* Sidebar layout pages: better main content padding */
  .main {
    padding: 38px 48px 48px;
    max-width: calc(100vw - 260px);
  }

  /* Cards get a more refined hover on wide screens */
  .card:hover,
  .action-card:hover,
  .purchase-card:hover,
  .transaction-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    transform: translateY(-2px);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  }

  /* Primary buttons get slightly more breathing room */
  .btn-primary,
  .btn-main {
    padding: 14px 28px;
  }
}

/* ─── Desktop Refinements (1440px+) ─────────────────────────────────────── */
@media (min-width: 1440px) {
  body.page-padded {
    padding: 48px 72px;
  }

  .main {
    padding: 44px 56px 56px;
  }

  .desktop-shell {
    max-width: 1360px;
  }
}

/* ─── Desktop Refinements (1920px+) ─────────────────────────────────────── */
@media (min-width: 1920px) {
  body.page-padded {
    padding: 56px 120px;
  }

  .main {
    padding: 52px 72px 72px;
    max-width: 1560px;
  }

  .desktop-shell {
    max-width: 1440px;
  }
}

/* ─── Mobile Refinements ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body {
    padding: 18px !important;
  }

  h1,
  h2 {
    letter-spacing: -0.2px;
  }

  .card,
  .wallet-box,
  .table-container {
    padding: 20px !important;
  }

  .theme-toggle {
    right: 12px;
    bottom: 12px;
  }

  .mobile-nav {
    display: block;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Push page content above the bottom nav */
  body.has-mobile-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* On mobile, hide the desktop sidebar */
  .sidebar {
    display: none !important;
  }

  /* When sidebar is open via hamburger */
  .sidebar.sidebar-open {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: 260px !important;
    z-index: 999;
    flex-direction: column;
    overflow-y: auto;
  }

  .main {
    margin-left: 0 !important;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 18, 28, 0.95);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  min-width: 260px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Centering System ───────────────────────────────────────────────────── */
/* Elite Layout Utilities */
.content-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    width: 100%;
}

/* ─── Typography Polish ──────────────────────────────────────────────────── */
.hero-text-limit {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.heading-elite {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .heading-elite { font-size: 32px; letter-spacing: -0.5px; }
}

.subtext-elite {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    max-width: 650px;
}

/* Elite Component: Global Search Bar */
.search-container-elite {
    height: 56px;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-input);
    display: flex;
    align-items: center;
    padding: 0 8px 0 20px;
    transition: var(--transition-base);
    box-shadow: var(--shadow-soft);
}

.search-container-elite:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(79, 208, 255, 0.15);
}

.search-container-elite input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    outline: none;
}

.search-container-elite input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Elite Component: Pill Chips */
.pill-chip {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.pill-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.pill-chip.active {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
    font-weight: 700;
}

/* Card Improvements */
.glass-card-grid {
    display: grid;
    gap: var(--gap-grid);
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.glass-card {
    border-radius: var(--radius-card);
    padding: var(--padding-card);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-base);
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-elite);
}

/* Micro Interactions */
.btn-primary {
    transition: var(--transition-base);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: scale(1.02);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: var(--transition-base);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}