/* Nexo Finance - Custom High-Tech Fintech Theme (Stitch Design System) */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Brand Fills & Neon Accents */
  --bg-primary: #131313;
  --bg-secondary: #1c1b1b;
  --bg-card: rgba(32, 31, 31, 0.85);
  --bg-card-hover: rgba(42, 42, 42, 0.95);
  
  /* Primary Teal Fills (Replaced Neon Lime) */
  --primary-lime: #18d9da;
  --primary-lime-container: #119b91;
  --primary-lime-fixed: #0ebdb1;
  --on-primary: #ffffff;
  --accent-gradient: linear-gradient(135deg, #119b91 0%, #18d9da 100%);
  
  /* High-Contrast Readable Text Tokens */
  --text-main: #f3f4f6;
  --text-muted: #d1d5db;
  
  /* Border & Outline Tokens */
  --border-color: rgba(255, 255, 255, 0.12);
  --outline: #8c947c;
  --outline-variant: #424936;
  
  /* Functional Alert Tokens */
  --alert-error: #ffb4ab;
  --alert-error-bg: #93000a;

  /* Typography Families */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-label: 'Geist', monospace;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Background Sine Wave Animation Canvas/SVG Container */
.nexo-wave-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.65;
}

.nexo-wave-bg svg {
  width: 100%;
  height: 100%;
}

.nexo-wave-bg path {
  fill: none;
  stroke-width: 0.45px;
  vector-effect: non-scaling-stroke;
}

/* High Contrast Override for Subtitle & Muted Helper Text */
.text-muted {
  color: var(--text-muted) !important;
}

.form-label, label {
  color: #e5e7eb !important;
  font-weight: 500;
}

/* Monospaced Technical Labels & Currency Fills */
.font-monospace, .label-data, .nexo-amount {
  font-family: var(--font-label) !important;
}

/* List Styling High Contrast */
.nexo-help-list li {
  color: #e5e7eb !important;
  margin-bottom: 0.5rem;
}

.nexo-help-list li strong {
  color: var(--primary-lime-container) !important;
}

/* ============================================================================
   1. DASHBOARD LAYOUT & GRID CONTAINERS
   ============================================================================ */
.nexo-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

#app-sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-x: hidden !important;
}

#app-sidebar nav {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  width: 100% !important;
}

#app-sidebar nav::-webkit-scrollbar {
  width: 4px;
}
#app-sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}
#app-sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
#app-sidebar nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

#app-header {
  height: 70px;
  position: fixed;
  top: 0;
  right: 0;
  left: 260px;
  background: rgba(28, 27, 27, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
}

#app-content {
  margin-left: 260px;
  margin-top: 70px;
  padding: 2rem;
  min-height: calc(100vh - 70px);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Mobile Sidebar Backdrop */
#nexo-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#nexo-sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Mobile Layout Responsiveness */
@media (max-width: 991px) {
  #app-sidebar {
    transform: translateX(-100%);
  }
  #app-sidebar.show {
    transform: translateX(0);
  }
  #app-header {
    left: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }
  #app-content {
    margin-left: 0;
    padding: 0.75rem 0.75rem 80px 0.75rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
  }
}

/* ============================================================================
   2. TILES & WIDGET CARDS (GLASSMORPHISM & ACCENTS)
   ============================================================================ */
.card-glass, .nexo-tile, .nexo-widget {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nexo-tile:hover, .card-glass:hover {
  border-color: rgba(17, 155, 145, 0.4);
  box-shadow: 0 12px 40px 0 rgba(17, 155, 145, 0.18);
}

/* Featured Teal Card */
.card-highlight-lime {
  background: var(--primary-lime-container) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(17, 155, 145, 0.4);
}

.card-highlight-lime .text-muted, 
.card-highlight-lime .nexo-stat-title,
.card-highlight-lime .text-white {
  color: rgba(255, 255, 255, 0.9) !important;
}

.card-highlight-lime .nexo-amount,
.card-highlight-lime .nexo-stat-value {
  color: #ffffff !important;
  font-weight: 800;
}

/* Stitch Admin Stat Card Widgets */
.nexo-stat-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 20px;
}

.nexo-stat-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.nexo-stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  font-family: var(--font-label);
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.nexo-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
}

.nexo-badge-positive {
  background: rgba(17, 155, 145, 0.15);
  color: var(--primary-lime);
}

.nexo-badge-negative {
  background: rgba(255, 180, 171, 0.15);
  color: var(--alert-error);
}

.nexo-chart-card {
  padding: 1.5rem;
  border-radius: 24px;
}

/* 2x2 Transaction Status Grid Tiles */
.nexo-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 576px) {
  .nexo-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nexo-status-tile {
  padding: 1.25rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}

.nexo-status-tile .tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nexo-status-tile .tile-amount {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-label);
  margin: 0.5rem 0 0.25rem 0;
}

/* Transaction History Asset Rows */
.nexo-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--primary-lime);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.nexo-asset-row:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 155, 145, 0.35);
}

.nexo-asset-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(17, 155, 145, 0.15);
  color: var(--primary-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ============================================================================
   3. MOBILE APP BOTTOM NAVIGATION MENU
   ============================================================================ */
#nexo-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(28, 27, 27, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 1050;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
}

.nexo-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  width: 20%;
}

.nexo-bottom-item i {
  font-size: 1.35rem;
  margin-bottom: 2px;
}

.nexo-bottom-item:hover, .nexo-bottom-item.active {
  color: var(--primary-lime-container);
}

.nexo-bottom-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 20px;
  height: 3px;
  background: var(--primary-lime-container);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px var(--primary-lime-container);
}

/* ============================================================================
   4. NAVIGATION LINKS & BUTTONS
   ============================================================================ */
.nav-link-nexo {
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 500;
  width: 100%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-link-nexo:hover, .nav-link-nexo.active {
  color: #ffffff;
  background: var(--accent-gradient);
  font-weight: 600;
}

.nav-link {
  color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: var(--accent-gradient);
  font-weight: 600;
}

.btn-nexo-primary {
  background: var(--primary-lime-container);
  border: none;
  color: #ffffff;
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(17, 155, 145, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-nexo-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(17, 155, 145, 0.55);
  color: #ffffff;
  background: var(--primary-lime-fixed);
}

.btn-nexo-outline {
  background: transparent;
  border: 1px solid var(--outline);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.btn-nexo-outline:hover {
  border-color: var(--primary-lime-container);
  color: var(--primary-lime-container);
  background: rgba(17, 155, 145, 0.08);
}

/* Utility Overrides */
.text-primary {
  color: var(--primary-lime) !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-lime-container) !important;
  box-shadow: 0 0 0 0.25rem rgba(17, 155, 145, 0.25) !important;
}

/* Input Fields Muted White Placeholder Styling */
::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

::-moz-placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

:-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

::-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

.form-control::placeholder, .form-select::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

/* Spin Rotation Animation */
@keyframes nexoSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spin-animation,
#global-refresh-icon.spin-animation {
  display: inline-block !important;
  animation: nexoSpin 0.8s linear infinite !important;
  transform-origin: 50% 50% !important;
  will-change: transform;
}
