/* ==========================================================
   Catalyst Capital & BNV Trading Platform - Stylesheet
   CryptoFinance Typography (Plus Jakarta Sans), Font Sizes,
   and Dual Theme (Dark Mode / Light Mode) System
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Inter:wght@400;500;600;700;800&display=swap');

/* ----------------------------------------------------------
   THEME VARIABLES
   ---------------------------------------------------------- */

/* DARK MODE (Default & .dark class) */
html.dark {
  --bg-body: #07090e;
  --bg-shell: #0b0e14;
  --bg-surface: #101520;
  --bg-card: #111520;
  --bg-card-hover: #161c2b;
  --bg-subcard: #0c1018;
  --border-card: #1c2436;
  --border-subtle: #161c28;
  --text-primary: #ffffff;
  --text-secondary: #8c9ba5;
  --text-muted: #64748b;
  --bottom-bar-bg: #0b0e14;
  --bottom-bar-border: #161c28;
  --header-bg: rgba(11, 14, 20, 0.96);
  --header-border: #161c28;
  --input-bg: #0c1018;
  --input-border: #1c2436;
  --pill-bg: #141a26;
  --pill-active-bg: #ff4e91;
  --pill-active-text: #ffffff;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-popup: 0 10px 40px rgba(0, 0, 0, 0.75);
  --toggle-border: #f59e0b;
  --toggle-bg: #111520;
  --toggle-icon: #f59e0b;
}

/* LIGHT MODE (html.light and html:not(.dark)) */
html.light,
html:not(.dark) {
  --bg-body: #f4f6fa;
  --bg-shell: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-subcard: #f8fafc;
  --border-card: #e2e8f0;
  --border-subtle: #edf2f7;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bottom-bar-bg: #ffffff;
  --bottom-bar-border: #edf2f7;
  --header-bg: rgba(255, 255, 255, 0.96);
  --header-border: #edf2f7;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --pill-bg: #f1f5f9;
  --pill-active-bg: #ff4e91;
  --pill-active-text: #ffffff;
  --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.05);
  --shadow-popup: 0 10px 35px rgba(15, 23, 42, 0.12);
  --toggle-border: #e2e8f0;
  --toggle-bg: #ffffff;
  --toggle-icon: #1e293b;
}

/* ----------------------------------------------------------
   GLOBAL RESET & TYPOGRAPHY
   ---------------------------------------------------------- */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'tnum' on, 'lnum' on;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
}

.font-mono, [class*="font-mono"] {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-feature-settings: 'tnum' on, 'lnum' on !important;
  font-variant-numeric: tabular-nums !important;
}

/* Mobile Frame Container */
.mobile-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-shell);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

@media (max-width: 440px) {
  .mobile-shell {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #232a3b;
  border-radius: 4px;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Header Atmospheric Mesh */
html.dark .home-header-atmosphere {
  background: radial-gradient(circle at 50% 0%, rgba(255, 78, 145, 0.35) 0%, rgba(132, 94, 194, 0.22) 45%, rgba(10, 13, 20, 0.9) 85%, var(--bg-shell) 100%);
}
html:not(.dark) .home-header-atmosphere {
  background: radial-gradient(circle at 50% 0%, rgba(255, 117, 140, 0.2) 0%, rgba(216, 180, 254, 0.25) 45%, rgba(246, 248, 252, 0.9) 85%, var(--bg-shell) 100%);
}

/* ----------------------------------------------------------
   THEME TOGGLE BUTTON (From Uploaded Screenshots)
   ---------------------------------------------------------- */
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--toggle-border);
  background: var(--toggle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toggle-icon);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-toggle-btn:active {
  transform: scale(0.9);
}

/* Top Ledger / Book Icon */
.top-ledger-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.top-ledger-btn:active {
  transform: scale(0.92);
}

/* User Avatar Initial */
.avatar-badge-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000000;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  cursor: pointer;
}

/* CryptoFinance Header Profile Pill Trigger (Matches Uploaded Image) */
.profile-pill-trigger {
  border: 2px solid #eab308;
  background-color: #0d111a;
  border-radius: 9999px;
  padding: 3px 8px 3px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.15);
}
.profile-pill-trigger:hover {
  border-color: #facc15;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.35);
}
.profile-pill-trigger:active {
  transform: scale(0.96);
}

.profile-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eab308;
  color: #000000;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* CryptoFinance Profile Dropdown Menu Card (Matches Uploaded Image) */
#crypto-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 250px;
  background: #0d111a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  z-index: 100;
  color: #ffffff;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ----------------------------------------------------------
   THEME ADAPTIVE CARDS & CONTAINERS
   ---------------------------------------------------------- */

.theme-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.theme-card-subtle {
  background-color: var(--bg-subcard);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

/* Typography Helpers matching CryptoFinance & Uploaded Images */
.font-cf-title {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.font-cf-subtitle {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 11.5px;
}

.font-cf-heading {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  letter-spacing: -0.015em;
}

/* Explicit Font Colors per Theme */
html.dark .font-cf-title,
html.dark .font-cf-heading,
html.dark .theme-text-primary {
  color: #ffffff !important;
}
html:not(.dark) .font-cf-title,
html.light .font-cf-title,
html:not(.dark) .font-cf-heading,
html.light .font-cf-heading,
html:not(.dark) .theme-text-primary,
html.light .theme-text-primary {
  color: #0f172a !important;
}

html.dark .font-cf-subtitle,
html.dark .theme-text-secondary {
  color: #848e9c !important;
}
html:not(.dark) .font-cf-subtitle,
html.light .font-cf-subtitle,
html:not(.dark) .theme-text-secondary,
html.light .theme-text-secondary {
  color: #707a8a !important;
}

/* Turquoise / Bright Sea-Green for effective/active numbers (matching 0/0 in screenshot) */
.text-cf-turquoise {
  color: #00e5be !important;
}
html.dark .text-cf-turquoise {
  color: #00e5be !important;
}
html:not(.dark) .text-cf-turquoise {
  color: #00b894 !important;
}

/* Squircle Icon Containers (Matching Image 1 & 2) */
.squircle-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.squircle-icon-box:active {
  transform: scale(0.92);
}

/* Pink Squircle */
html.dark .squircle-pink {
  background: rgba(255, 78, 145, 0.14);
  border: 1px solid rgba(255, 78, 145, 0.35);
  color: #ff4e91;
}
html:not(.dark) .squircle-pink,
html.light .squircle-pink {
  background: #fff0f3;
  border: 1px solid #ffd1dc;
  color: #f43f5e;
}

/* Amber/Orange Squircle */
html.dark .squircle-amber {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}
html:not(.dark) .squircle-amber,
html.light .squircle-amber {
  background: #fffbeb;
  border: 1px solid #fef08a;
  color: #d97706;
}

/* Blue Squircle */
html.dark .squircle-blue {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}
html:not(.dark) .squircle-blue,
html.light .squircle-blue {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
}

/* Green/Emerald Squircle */
html.dark .squircle-emerald {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
html:not(.dark) .squircle-emerald,
html.light .squircle-emerald {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #059669;
}

/* Purple Squircle */
html.dark .squircle-purple {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}
html:not(.dark) .squircle-purple,
html.light .squircle-purple {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #9333ea;
}

/* ----------------------------------------------------------
   BOTTOM NAVIGATION BAR (Dual Theme)
   ---------------------------------------------------------- */

.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bottom-bar-bg);
  border-top: 1px solid var(--bottom-bar-border);
  max-width: 440px;
  margin: 0 auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  color: #848e9c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  user-select: none;
}

.bottom-tab svg {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  stroke: #848e9c;
  fill: none;
}

.bottom-tab.active {
  color: #ff4e91;
  font-weight: 700;
}

.bottom-tab.active svg {
  stroke: #ff4e91;
  filter: drop-shadow(0 0 6px rgba(255, 78, 145, 0.5));
}

html.dark .bottom-tab.active {
  color: #ff4e91;
}
html.dark .bottom-tab.active svg {
  stroke: #ff4e91;
  filter: drop-shadow(0 0 6px rgba(255, 78, 145, 0.6));
}

html:not(.dark) .bottom-tab.active {
  color: #ff4e91; /* in light mode matches the pink icon in screenshot 2 */
}
html:not(.dark) .bottom-tab.active svg {
  stroke: #ff4e91;
  filter: drop-shadow(0 0 6px rgba(255, 78, 145, 0.4));
}

/* Center Floating Chip (GO / Invest) */
.center-floating-chip {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  border: 3.5px solid var(--bottom-bar-bg);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.center-floating-chip:active {
  transform: scale(0.92);
}

/* ----------------------------------------------------------
   TOTAL ASSETS CARD & 6-GRID STATS
   ---------------------------------------------------------- */

html.dark .assets-nebula-card {
  background: 
    radial-gradient(circle at 85% 20%, rgba(147, 51, 234, 0.45) 0%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(255, 78, 145, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 60%),
    #0c0f17;
  border: 1px solid #1e2433;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(147, 51, 234, 0.1);
  color: #ffffff;
}

html:not(.dark) .assets-nebula-card {
  background: 
    radial-gradient(circle at 85% 20%, rgba(216, 180, 254, 0.4) 0%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(254, 240, 138, 0.3) 0%, transparent 60%),
    #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  color: #111827;
}

html.dark .stat-box-card {
  background: #11141c;
  border: 1px solid #1a202d;
  border-radius: 14px;
  padding: 12px 10px;
}
html:not(.dark) .stat-box-card {
  background: #ffffff;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* Official Guidance Section */
html.dark .official-guidance-card {
  background: 
    radial-gradient(circle at 50% 60%, rgba(120, 50, 180, 0.2) 0%, transparent 70%),
    linear-gradient(180deg, #12151e 0%, #0c0e14 100%);
  border: 1px solid #1f2535;
}
html:not(.dark) .official-guidance-card {
  background: 
    radial-gradient(circle at 50% 60%, rgba(243, 232, 255, 0.5) 0%, transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ----------------------------------------------------------
   ACTION BUTTONS & PILLS
   ---------------------------------------------------------- */

.pill-btn-pink-orange {
  background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 50%, #ff9a8b 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 117, 140, 0.35);
  border: none;
  font-weight: 700;
  transition: all 0.2s ease;
}
.pill-btn-pink-orange:hover {
  filter: brightness(1.06);
}

.pill-btn-blue {
  background: linear-gradient(90deg, #36d1dc 0%, #5b86e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(54, 209, 220, 0.35);
  border: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pill-btn-teal {
  background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.35);
  border: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pill-btn-contact {
  background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
  color: #ffffff;
  font-weight: 700;
  border-radius: 9999px;
  padding: 6px 18px;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(255, 117, 140, 0.3);
  transition: all 0.2s ease;
}

/* Circular Actions */
.circle-action-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.circle-action-btn:active {
  transform: scale(0.92);
}

/* Ticker Animation */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}
.ticker-content {
  display: inline-block;
  animation: tickerSlide 22s linear infinite;
}
@keyframes tickerSlide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Floating animation */
.animate-float {
  animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Modals */
.modal.flex {
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast */
.toast {
  animation: toastSlide 0.25s ease-out forwards;
}
@keyframes toastSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== CALENDAR RANGE PICKER STYLES ==================== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  row-gap: 3px;
  column-gap: 0px;
}

.cal-cell {
  position: relative;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  transition: transform 0.1s ease;
}
.cal-cell:active {
  transform: scale(0.94);
}

/* Middle days in continuous range - seamless full width */
.cal-cell.in-range::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  right: 0;
  background-color: #3b152d;
  z-index: 1;
}

/* Range Start Day - rounded left cap, extends to right edge */
.cal-cell.range-start::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 2px;
  right: 0;
  background-color: #3b152d;
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
  z-index: 1;
}

/* Range End Day - extends from left edge, rounded right cap */
.cal-cell.range-end::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  right: 2px;
  background-color: #3b152d;
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
  z-index: 1;
}

/* Single selected day: no connecting strip */
.cal-cell.single-selected::before {
  display: none !important;
}

/* Active Start & End Gradient Circle Pill */
.cal-pill {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #60a5fa 0%, #ec4899 50%, #f97316 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45);
  transform: scale(1.05);
}

.cal-cell-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cal-cell:hover .cal-hover-circle {
  background-color: rgba(255, 255, 255, 0.08);
}

.cal-hover-circle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: background-color 0.15s ease;
}

.cal-today-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background-color: #f43f5e;
  display: inline-block;
  margin-left: 2px;
}

