/* ============================================
   FINTECH BANKING Design System - Glassmorphism
   Based on UIUX.md specifications
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* CSS Custom Properties */
:root {
  /* Colors from UIUX.md */
  --primary: #F59E0B;
  --secondary: #FBBF24;
  --cta: #8B5CF6;
  --background: #0F172A;
  --text: #F8FAFC;

  /* Extended palette */
  --background-secondary: #1E293B;
  --border-glass: rgba(255, 255, 255, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;

  /* Glassmorphism effects */
  --blur: 20px;
  --blur-light: 10px;

  /* Typography */
  --font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
  --text-muted: rgba(248, 250, 252, 0.6);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

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

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background gradient effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(251, 191, 36, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  color: rgba(248, 250, 252, 0.8);
}

/* ============================================
   Glassmorphism Components
   ============================================ */

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Glass Panel (larger containers) */
.glass-panel {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
}

/* ============================================
   Layout Components
   ============================================ */

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Header / Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border-glass);
  padding: var(--spacing-md) 0;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  background: var(--glass-bg-hover);
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: var(--spacing-2xl) 0;
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--spacing-xl);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ============================================
   Form Elements
   ============================================ */

/* Input fields */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: rgba(248, 250, 252, 0.9);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.form-input::placeholder {
  color: rgba(248, 250, 252, 0.4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--background);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-cta {
  background: linear-gradient(135deg, var(--cta), #A78BFA);
  color: white;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--glass-bg-hover);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--glass-bg);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1.125rem;
}

/* ============================================
   Data Display Components
   ============================================ */

/* Stats Card */
.stat-card {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* Table */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.table th {
  font-weight: 600;
  color: rgba(248, 250, 252, 0.7);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table tr:hover {
  background: var(--glass-bg);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--glass-bg);
  border: 1px solid var(--border-glass);
}

.badge-primary {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--glass-bg);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 9999px;
  transition: width var(--transition-normal);
}

/* ============================================
   Chart Container
   ============================================ */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
}

.chart-actions {
  display: flex;
  gap: var(--spacing-xs);
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
  display: flex;
  gap: var(--spacing-xs);
  background: var(--glass-bg);
  padding: var(--spacing-xs);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
}

.tab {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(248, 250, 252, 0.6);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  background: var(--primary);
  color: var(--background);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--background-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg);
}

/* ============================================
   Slider / Carousel
   ============================================ */

.slider-container {
  position: relative;
  overflow: hidden;
}

.slider-track {
  display: flex;
  transition: transform var(--transition-normal);
}

.slider-slide {
  flex: 0 0 100%;
  padding: var(--spacing-md);
}

.slider-nav {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.slider-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--glass-bg);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text);
}

.slider-arrow:hover {
  background: var(--glass-bg-hover);
  border-color: var(--primary);
}

.slider-arrow.prev { left: var(--spacing-md); }
.slider-arrow.next { right: var(--spacing-md); }

/* ============================================
   Stock Card
   ============================================ */

.stock-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
}

.stock-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--background);
}

.stock-info {
  flex: 1;
}

.stock-symbol {
  font-weight: 600;
  font-size: 1rem;
}

.stock-name {
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.6);
}

.stock-price {
  text-align: right;
}

.stock-current {
  font-weight: 600;
  font-size: 1.125rem;
}

.stock-change {
  font-size: 0.875rem;
}

.stock-change.positive { color: var(--success); }
.stock-change.negative { color: var(--danger); }

/* ============================================
   Simulation Round Marker
   ============================================ */

.round-marker {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid var(--cta);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--cta);
}

/* ============================================
   Risk Disclaimer
   ============================================ */

.risk-disclaimer {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.8);
}

.risk-disclaimer strong {
  color: var(--danger);
}

/* ============================================
   Section Spacing
   ============================================ */

.section {
  padding: var(--spacing-2xl) 0;
}

.section-header {
  margin-bottom: var(--spacing-xl);
}

.section-title {
  margin-bottom: var(--spacing-sm);
}

.section-subtitle {
  color: rgba(248, 250, 252, 0.6);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Mobile: 375px */
@media (max-width: 375px) {
  html { font-size: 14px; }

  .container { padding: 0 var(--spacing-md); }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }

  .navbar-nav { display: none; }
}

/* Tablet: 768px */
@media (max-width: 768px) {
  .hero { padding: var(--spacing-xl) 0; }

  .stat-value { font-size: 1.5rem; }

  .glass-panel { padding: var(--spacing-lg); }
}

/* Desktop: 1024px */
@media (max-width: 1024px) {
  .container { max-width: 100%; }
}

/* Large: 1440px handled by max-width on container */

/* ============================================
   Utilities
   ============================================ */

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-cta { color: var(--cta); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: rgba(248, 250, 252, 0.6); }

.bg-glass { background: var(--glass-bg); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-glow {
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.2);
}

.hidden { display: none !important; }
.visible { display: block !important; }

/* ============================================
   FINTECH BANKING - Enhanced Effects
   ============================================ */

/* Animated gradient background */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animate {
  background: linear-gradient(-45deg, var(--primary), var(--cta), var(--secondary), var(--success));
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Glow effects */
.glow-primary {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), 0 0 40px rgba(245, 158, 11, 0.2);
}

.glow-cta {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.2);
}

.glow-success {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.glow-danger {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Card hover animations */
.glass-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(245, 158, 11, 0.1);
}

/* Pulse animation for live indicators */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Number counter animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-count {
  animation: countUp 0.6s ease-out forwards;
}

/* Slide in animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out forwards;
}

/* Stagger children animations */
.stagger-children > * {
  opacity: 0;
  animation: slideInUp 0.4s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Neon text effect */
.neon-text {
  text-shadow:
    0 0 5px var(--primary),
    0 0 10px var(--primary),
    0 0 20px var(--primary);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--cta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Data visualization enhancements */
.chart-glow {
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
}

/* Price ticker styles */
.price-up {
  color: var(--success);
  position: relative;
}

.price-up::before {
  content: '▲';
  font-size: 0.7em;
  margin-right: 4px;
}

.price-down {
  color: var(--danger);
  position: relative;
}

.price-down::before {
  content: '▼';
  font-size: 0.7em;
  margin-right: 4px;
}

/* Fintech card styles */
.fintech-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.fintech-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cta));
}

.fintech-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

/* Sparkline mini charts */
.sparkline-container {
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.sparkline-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary), var(--secondary));
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.sparkline-bar:hover {
  background: var(--cta);
}

/* Status indicators */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-dot.offline {
  background: var(--danger);
}

.status-dot.pending {
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Metric delta indicators */
.delta-positive {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.delta-negative {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Interactive buttons with ripple */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* Data grid cards */
.data-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
}

.data-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--primary);
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.data-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.data-card-label {
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Investment allocation bar */
.allocation-bar {
  height: 8px;
  background: var(--glass-bg);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.allocation-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.allocation-segment:first-child {
  border-radius: 4px 0 0 4px;
}

.allocation-segment:last-child {
  border-radius: 0 4px 4px 0;
}

/* Tooltip enhancements */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1em;
}

.skeleton-chart {
  height: 200px;
}

/* Focus ring for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.5);
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .navbar,
  .tabs,
  .btn,
  .slider-arrow {
    display: none !important;
  }

  .glass-card,
  .glass-panel {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .chart-container {
    page-break-inside: avoid;
  }
}

/* ============================================
   Additional Fintech Enhancements
   ============================================ */

/* Data Table Enhancements */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead tr {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(139, 92, 246, 0.05));
}

.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding: 1rem;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(245, 158, 11, 0.05);
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-variant-numeric: tabular-nums;
}

/* Numeric values styling */
.number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Currency display */
.currency::before {
  content: '$';
  opacity: 0.6;
  font-size: 0.9em;
}

/* Percentage pill */
.percentage-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.percentage-pill.positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.percentage-pill.negative {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Glassmorphism button variants */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--cta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(245, 158, 11, 0.5),
    rgba(139, 92, 246, 0.5),
    transparent
  );
  margin: 3rem 0;
}

/* Feature highlight box */
.highlight-box {
  position: relative;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.highlight-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* Animated border */
.animated-border {
  position: relative;
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--primary), var(--cta), var(--secondary), var(--primary));
  background-size: 400% 400%;
  border-radius: inherit;
  z-index: -1;
  animation: borderRotate 3s ease infinite;
}

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

/* Success/Error states for inputs */
.form-input.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Animated checkmark */
.checkmark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Metric counter animation */
.counter {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: rgba(248, 250, 252, 0.5);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Contextual menu */
.context-menu {
  position: absolute;
  background: rgba(30, 41, 59, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
  min-width: 180px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.context-menu-item:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 0.5rem 0;
}

/* Notification dot */
.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--background);
}

/* Progress ring */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.progress-ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

/* Tooltip arrow */
.tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

.tooltip-arrow.top {
  bottom: -6px;
  border-top: 6px solid rgba(30, 41, 59, 0.98);
}

.tooltip-arrow.bottom {
  top: -6px;
  border-bottom: 6px solid rgba(30, 41, 59, 0.98);
}

/* Selection highlight */
::selection {
  background: rgba(245, 158, 11, 0.3);
  color: var(--text);
}

/* Module transition animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero badge styling */
.hero-badge {
  animation: fadeInDown 0.6s ease-out;
}

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

/* Stagger animation for children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

/* Hover lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Subtle background animation for sections */
.section-bg-animated {
  position: relative;
}

.section-bg-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.03) 0%, transparent 70%);
  animation: breathe 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Cyberpunk-style lines */
.cyber-line {
  position: relative;
  overflow: hidden;
}

.cyber-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: cyberScan 3s ease-in-out infinite;
}

@keyframes cyberScan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Glass panel subtle glow on hover */
.glass-panel:hover {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.1),
    0 20px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Enhanced focus styles for buttons */
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--primary);
}

/* Webkit autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--background-secondary) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   Breakpoints: 375px, 768px, 1024px, 1440px
   ============================================ */

/* Base Mobile Styles (375px and up) */
@media (max-width: 767px) {
  /* Typography */
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  /* Container */
  .container {
    padding: 0 var(--spacing-md);
  }

  /* Navigation */
  .navbar {
    padding: var(--spacing-sm) 0;
  }

  .navbar-content {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-brand svg {
    width: 24px;
    height: 24px;
  }

  .navbar-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: 0;
    margin-top: var(--spacing-sm);
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
  }

  .navbar-nav.active {
    display: flex;
  }

  .nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(245, 158, 11, 0.1);
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
  }

  .nav-clock {
    display: none;
  }

  /* Live Indicator in mobile */
  #marketStatus {
    font-size: 0.7rem;
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
  }

  /* Ticker Bar */
  .ticker-bar {
    padding: 6px 0;
    font-size: 0.75rem;
  }

  .ticker-item {
    font-size: 0.75rem;
    gap: 0.35rem;
  }

  /* Hero Section */
  .hero {
    padding: var(--spacing-xl) 0;
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem !important;
    margin-bottom: 0.75rem;
  }

  .hero p {
    font-size: 0.95rem;
    padding: 0 var(--spacing-sm);
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .hero .flex.justify-center.gap-lg {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
  }

  /* Buttons */
  .btn {
    padding: 10px 16px;
    font-size: 0.875rem;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
  }

  .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .btn svg {
    width: 16px;
    height: 16px;
  }

  /* Grid Layouts */
  .grid {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md) !important;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Market Indices - Horizontal scroll on mobile */
  #marketIndices {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
  }

  #marketIndices > * {
    flex: 0 0 70%;
    scroll-snap-align: start;
    min-width: 200px;
  }

  /* Glass Components */
  .glass-card {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }

  .glass-panel {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
  }

  /* Stat Cards */
  .stat-card {
    padding: var(--spacing-md);
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-sm);
    justify-content: flex-start;
  }

  .tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .tab svg {
    width: 14px;
    height: 14px;
  }

  /* Section Headers */
  .section-header {
    margin-bottom: var(--spacing-lg);
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.875rem;
  }

  /* Forms */
  .form-group {
    margin-bottom: var(--spacing-md);
  }

  .form-label {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }
  select option {
    background: #1E293B;
    color: #F8FAFC;
  }
  .form-input,
  .form-select {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  /* Slider */
  .slider-container {
    padding: var(--spacing-md);
  }

  .slider-arrow {
    width: 32px;
    height: 32px;
  }

  .slider-arrow.prev {
    left: -10px;
  }

  .slider-arrow.next {
    right: -10px;
  }

  .slider-nav {
    margin-top: var(--spacing-sm);
  }

  .slider-dot {
    width: 8px;
    height: 8px;
  }

  /* Charts */
  .chart-container {
    height: 250px !important;
  }

  #equityCurve {
    height: 300px !important;
  }

  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 0 var(--spacing-md);
  }

  .table {
    min-width: 600px;
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  /* Badges */
  .badge {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  /* Stock Card */
  .stock-card {
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }

  .stock-icon {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  .stock-symbol {
    font-size: 0.9rem;
  }

  .stock-name {
    font-size: 0.75rem;
  }

  .stock-current {
    font-size: 0.9rem;
  }

  .stock-change {
    font-size: 0.75rem;
  }

  /* Selected Stocks */
  #selectedStocks {
    flex-direction: column;
  }

  #selectedStocks .badge {
    width: 100%;
    justify-content: space-between;
  }

  /* Risk Disclaimer */
  .risk-disclaimer {
    font-size: 0.75rem;
    padding: var(--spacing-sm);
  }

  /* Modal */
  .modal {
    width: 95%;
    max-width: none;
    max-height: 85vh;
    margin: var(--spacing-md);
    padding: var(--spacing-md);
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  /* Footer */
  footer .grid-3 {
    text-align: center;
  }

  footer .flex.gap-md {
    justify-content: center;
  }

  /* Toast */
  .toast-container {
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    top: auto;
    bottom: var(--spacing-md);
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  /* Loading Overlay */
  .loading-logo svg {
    width: 48px;
    height: 48px;
  }

  .loading-text {
    font-size: 1rem;
  }

  .loading-bar {
    width: 150px;
  }

  /* Keyboard shortcuts - hide on mobile */
  footer .grid-3 > div:nth-child(2) {
    display: none;
  }

  /* Flex utilities mobile override */
  .flex.justify-between {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .flex.gap-lg {
    gap: var(--spacing-md);
  }

  .flex.gap-md {
    gap: var(--spacing-sm);
  }

  /* Round Markers */
  #roundMarkers {
    flex-wrap: wrap;
  }

  .round-marker {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  /* Prediction Model Params */
  #modelParams .grid-3 {
    grid-template-columns: 1fr !important;
  }

  /* Strategy Params */
  #strategyParams .form-group {
    margin-bottom: var(--spacing-sm);
  }

  /* Hide particle canvas on mobile for performance */
  .particle-canvas {
    display: none;
  }
}

/* Small Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    padding: 0 var(--spacing-lg);
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar-nav {
    gap: var(--spacing-xs);
  }

  .nav-link {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .hero h1 {
    font-size: 2.5rem !important;
  }

  .chart-container {
    height: 300px !important;
  }

  .modal {
    width: 90%;
    max-width: 600px;
  }

  /* Market Indices grid on tablet */
  #marketIndices {
    grid-template-columns: repeat(2, 1fr) !important;
    display: grid !important;
    overflow-x: visible;
  }

  .tabs {
    justify-content: center;
  }
}

/* Large Tablets / Small Desktops (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .container {
    max-width: 1024px;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero h1 {
    font-size: 2.75rem !important;
  }

  .chart-container {
    height: 320px !important;
  }
}

/* Large Desktops (1440px and up) */
@media (min-width: 1440px) {
  .container {
    max-width: 1440px;
    padding: 0 var(--spacing-xl);
  }

  .hero h1 {
    font-size: 3.5rem !important;
  }

  .chart-container {
    height: 400px !important;
  }

  .glass-panel {
    padding: var(--spacing-2xl);
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
  }

  .form-input,
  .form-select {
    min-height: 44px;
  }

  .tab {
    min-height: 44px;
  }

  .slider-arrow {
    width: 44px;
    height: 44px;
  }

  .slider-dot {
    width: 12px;
    height: 12px;
  }

  /* Remove hover effects on touch devices */
  .glass-card:hover,
  .glass-panel:hover,
  .btn:hover,
  .stock-card:hover {
    transform: none;
  }

  /* Add active states instead */
  .glass-card:active {
    transform: scale(0.98);
  }

  .btn:active {
    transform: scale(0.95);
  }

  .stock-card:active {
    background: rgba(245, 158, 11, 0.1);
  }
}

/* Landscape Phone */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-lg) 0;
  }

  .hero h1 {
    font-size: 1.5rem !important;
  }

  .modal {
    max-height: 95vh;
  }

  .chart-container {
    height: 200px !important;
  }
}

/* Very Small Screens (less than 375px) */
@media (max-width: 374px) {
  html {
    font-size: 12px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .hero h1 {
    font-size: 1.5rem !important;
  }

  .btn-lg {
    padding: 10px 16px;
  }

  .glass-card,
  .glass-panel {
    padding: var(--spacing-sm);
  }

  .stat-value {
    font-size: 1.25rem;
  }

  #marketIndices > * {
    flex: 0 0 85%;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .glass-card,
  .glass-panel {
    border-width: 0.5px;
  }
}

/* Dark Mode Preference (already dark, but ensure consistency) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Safe Area Insets for notched devices */
@supports (padding: max(0px)) {
  .navbar {
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
  }

  .container {
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
  }

  .toast-container {
    bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
  }
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  padding: var(--spacing-xs) 0;
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: rgba(248, 250, 252, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
  min-width: 60px;
}

.bottom-nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.bottom-nav-item svg {
  transition: transform 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

.bottom-nav-item:active {
  background: rgba(245, 158, 11, 0.1);
  transform: scale(0.95);
}

/* Show bottom nav on mobile */
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }

  /* Add padding to body to account for bottom nav */
  body {
    padding-bottom: 70px;
  }

  footer {
    padding-bottom: calc(70px + var(--spacing-lg));
  }

  /* Hide tabs on mobile when bottom nav is shown */
  .tabs {
    display: none !important;
  }

  /* Adjust toast position for bottom nav */
  .toast-container {
    bottom: 80px;
  }
}

/* Pulse animation for active bottom nav item */
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-item {
  position: relative;
}

/* Bottom nav glow effect */
.mobile-bottom-nav::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
  pointer-events: none;
}



/* 日歷 */

.date-picker-wrap {
  position: relative;
  display: inline-block;
  width: 150px;
}

.date-display {
  border: 1px solid #444;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  transition: border-color 0.2s;
}
.date-display:hover { border-color: #38bdf8; }

.calendar {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 999;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px;
  min-width: 240px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.calendar.open { display: block; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
}
.cal-header button {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 8px;
  border-radius: 4px;
}
.cal-header button:hover { color: #e2e8f0; background: #334155; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-day {
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #e2e8f0;
  transition: background 0.15s;
}
.cal-day:hover    { background: #334155; }
.cal-day.today    { color: #38bdf8; font-weight: 700; }
.cal-day.selected { background: #38bdf8; color: #0a0e17; font-weight: 700; }
