/* ============================================================
   FinAdvisor Pro - Design System
   Professional HK Stock Market Platform
   ============================================================ */

/* === 1. CSS Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }

/* === 2. Design Tokens (CSS Variables) === */
:root {
  /* --- Dark Theme (Default) --- */
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-tertiary: #1A2235;
  --bg-elevated: #1F2937;
  --bg-hover: #253041;
  --bg-active: #2D3B4E;
  --bg-overlay: rgba(10, 14, 26, 0.85);
  --bg-input: #1A2235;

  --border-primary: #1F2937;
  --border-secondary: #2D3B4E;
  --border-focus: #3B82F6;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-muted: #475569;
  --text-inverse: #0A0E1A;

  --accent-gold: #F59E0B;
  --accent-gold-hover: #D97706;
  --accent-gold-subtle: rgba(245, 158, 11, 0.12);
  --accent-blue: #3B82F6;
  --accent-blue-hover: #2563EB;
  --accent-blue-subtle: rgba(59, 130, 246, 0.12);
  --accent-purple: #8B5CF6;
  --accent-purple-subtle: rgba(139, 92, 246, 0.12);

  --market-up: #EF4444;
  --market-up-bg: rgba(239, 68, 68, 0.1);
  --market-down: #10B981;
  --market-down-bg: rgba(16, 185, 129, 0.1);
  --market-flat: #94A3B8;
  --market-flat-bg: rgba(148, 163, 184, 0.1);

  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-error: #EF4444;
  --status-info: #3B82F6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 56px;
  --bottom-nav-height: 56px;
  --ticker-height: 32px;

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease-out;
  --transition-slow: 400ms ease;
  --transition-chart: 800ms ease-out;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-active: #E2E8F0;
  --bg-overlay: rgba(255, 255, 255, 0.9);
  --bg-input: #F8FAFC;

  --border-primary: #E2E8F0;
  --border-secondary: #CBD5E1;
  --border-focus: #2563EB;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #64748B;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  --accent-gold: #D97706;
  --accent-gold-hover: #B45309;
  --accent-gold-subtle: rgba(217, 119, 6, 0.1);
  --accent-blue: #2563EB;
  --accent-blue-hover: #1D4ED8;
  --accent-blue-subtle: rgba(37, 99, 235, 0.08);

  --market-up: #DC2626;
  --market-up-bg: rgba(220, 38, 38, 0.08);
  --market-down: #059669;
  --market-down-bg: rgba(5, 150, 105, 0.08);
  --market-flat: #64748B;
  --market-flat-bg: rgba(100, 116, 139, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/* === 3. Typography === */
@import url('https://fonts.googleapis.cn/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
}

.font-mono { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-md { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 32px; }
.text-4xl { font-size: 40px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* === 4. Layout === */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.sidebar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-brand span {
  color: var(--accent-gold);
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--market-up);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-primary);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === 5. Header === */
.main-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: var(--z-sticky);
  gap: 16px;
}

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0 12px 0 36px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.header-search input:focus {
  border-color: var(--border-focus);
}

.header-search input::placeholder {
  color: var(--text-tertiary);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  position: relative;
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--market-up);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* === 6. Market Ticker === */
.market-ticker {
  height: var(--ticker-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  animation: ticker-scroll 60s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 500;
}

.ticker-item .ticker-name {
  color: var(--text-secondary);
}

.ticker-item .ticker-value {
  color: var(--text-primary);
  font-family: 'SF Mono', monospace;
}

.ticker-item .ticker-change {
  font-family: 'SF Mono', monospace;
  font-weight: 600;
}

.ticker-item .ticker-change.up { color: var(--market-up); }
.ticker-item .ticker-change.down { color: var(--market-down); }
.ticker-item .ticker-change.flat { color: var(--market-flat); }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* === 7. Page Container === */
.page-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* === 8. Cards === */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--border-secondary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* === 9. Index Cards === */
.index-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.index-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.index-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.index-card.up::before { background: var(--market-up); }
.index-card.down::before { background: var(--market-down); }
.index-card.flat::before { background: var(--market-flat); }

.index-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.index-card .index-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.index-card .index-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
  margin-bottom: 4px;
}

.index-card.up .index-value { color: var(--market-up); }
.index-card.down .index-value { color: var(--market-down); }

.index-card .index-change {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
  display: flex;
  gap: 12px;
}

.index-card.up .index-change { color: var(--market-up); }
.index-card.down .index-change { color: var(--market-down); }

.index-card .index-sparkline {
  margin-top: 12px;
  height: 32px;
}

/* === Horizontal Scroll Containers === */
.index-cards {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.index-cards::-webkit-scrollbar {
  display: none;
}

.index-cards .index-card {
  flex: 0 0 220px;
  min-width: 220px;
  scroll-snap-align: start;
}

.home-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.home-grid::-webkit-scrollbar {
  display: none;
}

.home-grid > .card {
  flex: 0 0 380px;
  min-width: 380px;
  scroll-snap-align: start;
}

/* Scroll indicator dots */
.scroll-indicator {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 0;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  transition: all 0.3s ease;
}

.scroll-dot.active {
  background: var(--color-accent-blue, #3b82f6);
  width: 18px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Swipe hint animation */
@keyframes swipeHint {
  0% { transform: translateX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(-30px); opacity: 0; }
}

.scroll-hint {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  color: rgba(148, 163, 184, 0.5);
  font-size: 0.75rem;
}

.scroll-hint-arrow {
  display: inline-block;
  animation: swipeHint 2s ease-in-out infinite;
  font-size: 1rem;
}

/* === 10. Data Table === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.data-table thead th:hover {
  color: var(--text-primary);
}

.data-table thead th.sortable::after {
  content: ' \2195';
  font-size: 10px;
  opacity: 0.5;
}

.data-table thead th.sort-asc::after {
  content: ' \2191';
  opacity: 1;
  color: var(--accent-blue);
}

.data-table thead th.sort-desc::after {
  content: ' \2193';
  opacity: 1;
  color: var(--accent-blue);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
}

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

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table .stock-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-table .stock-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

.data-table .stock-code {
  font-family: 'SF Mono', monospace;
  color: var(--text-secondary);
  font-size: 12px;
}

.data-table .price-up { color: var(--market-up); }
.data-table .price-down { color: var(--market-down); }
.data-table .price-flat { color: var(--market-flat); }

.data-table .change-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
}

.change-badge.up { background: var(--market-up-bg); color: var(--market-up); }
.change-badge.down { background: var(--market-down-bg); color: var(--market-down); }
.change-badge.flat { background: var(--market-flat-bg); color: var(--market-flat); }

/* === 11. Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
}

.btn-gold {
  background: var(--accent-gold);
  color: #fff;
  border-color: var(--accent-gold);
}

.btn-gold:hover:not(:disabled) {
  background: var(--accent-gold-hover);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--status-error);
  color: #fff;
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* === 12. Forms & Inputs === */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-subtle);
}

.form-input::placeholder { color: var(--text-tertiary); }

.form-select {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-subtle);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

/* === 13. Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 20px;
  gap: 0;
}

.tab-item {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* === 14. Badges & Tags === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-blue { background: var(--accent-blue-subtle); color: var(--accent-blue); }
.badge-gold { background: var(--accent-gold-subtle); color: var(--accent-gold); }
.badge-green { background: var(--market-down-bg); color: var(--market-down); }
.badge-red { background: var(--market-up-bg); color: var(--market-up); }
.badge-purple { background: var(--accent-purple-subtle); color: var(--accent-purple); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

/* === 15. Chart Container === */
.chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-primary);
  flex-wrap: wrap;
}

.chart-toolbar .period-btns {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.chart-toolbar .period-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
}

.chart-toolbar .period-btn:hover {
  color: var(--text-primary);
}

.chart-toolbar .period-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

.chart-toolbar .indicator-select {
  margin-left: auto;
}

.chart-canvas-wrap {
  position: relative;
  padding: 16px;
}

.chart-canvas-wrap canvas {
  width: 100%;
  display: block;
}

/* === 16. Order Book === */
.order-book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-primary);
}

.order-book-side {
  background: var(--bg-secondary);
}

.order-book-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-primary);
}

.order-book-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 4px 12px;
  font-size: 12px;
  font-family: 'SF Mono', monospace;
  position: relative;
  transition: background var(--transition-fast);
}

.order-book-row:hover {
  background: var(--bg-hover);
}

.order-book-row .row-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
}

.order-book-row.ask .row-bg { background: var(--market-down); }
.order-book-row.bid .row-bg { background: var(--market-up); }
.order-book-row.ask .price { color: var(--market-down); }
.order-book-row.bid .price { color: var(--market-up); }

/* === 17. Fund Flow === */
.fund-flow-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0;
}

.fund-flow-bar .flow-in {
  background: var(--market-up);
  transition: width var(--transition-slow);
}

.fund-flow-bar .flow-out {
  background: var(--market-down);
  transition: width var(--transition-slow);
}

.fund-flow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-primary);
}

.fund-flow-item:last-child { border-bottom: none; }

.fund-flow-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 80px;
}

.fund-flow-values {
  display: flex;
  gap: 24px;
  font-family: 'SF Mono', monospace;
  font-size: 13px;
}

.fund-flow-values .in { color: var(--market-up); }
.fund-flow-values .out { color: var(--market-down); }
.fund-flow-values .net { font-weight: 600; }

/* === 18. AI Chat === */
.ai-chat-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  z-index: var(--z-overlay);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.ai-chat-panel.open {
  transform: translateX(0);
}

.ai-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-header h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-header .ai-badge {
  font-size: 10px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message {
  display: flex;
  gap: 10px;
}

.ai-message .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ai-message.bot .msg-avatar {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
}

.ai-message.user .msg-avatar {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ai-message .msg-content {
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.ai-message .msg-content p { margin-bottom: 8px; }
.ai-message .msg-content p:last-child { margin-bottom: 0; }

.ai-message .msg-disclaimer {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.ai-chat-input {
  padding: 16px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  gap: 8px;
}

.ai-chat-input input {
  flex: 1;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.ai-chat-input input:focus {
  border-color: var(--border-focus);
}

.ai-chat-input button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.ai-chat-input button:hover {
  background: var(--accent-blue-hover);
}

/* === 19. Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === 20. Toast / Notifications === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 300ms ease-out;
}

.toast.success { border-left: 3px solid var(--status-success); }
.toast.error { border-left: 3px solid var(--status-error); }
.toast.warning { border-left: 3px solid var(--status-warning); }
.toast.info { border-left: 3px solid var(--status-info); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === 21. Skeleton Loading === */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.sm { height: 12px; width: 60%; }
.skeleton-text.lg { height: 20px; width: 40%; }
.skeleton-card { height: 120px; }
.skeleton-chart { height: 300px; }

/* === 22. Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination .page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--transition-fast);
}

.pagination .page-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination .page-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* === 23. Rankings === */
.ranking-list {
  display: flex;
  flex-direction: column;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.ranking-item:hover {
  background: var(--bg-hover);
}

.ranking-item:last-child { border-bottom: none; }

.ranking-pos {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ranking-pos.top-1 { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.ranking-pos.top-2 { background: linear-gradient(135deg, #94A3B8, #64748B); color: #fff; }
.ranking-pos.top-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-info .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-info .code {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', monospace;
}

.ranking-value {
  text-align: right;
  font-family: 'SF Mono', monospace;
  font-size: 14px;
  font-weight: 600;
}

/* === 24. News Feed === */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-primary);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.news-item:hover { opacity: 0.8; }
.news-item:last-child { border-bottom: none; }

.news-item .news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.news-item .news-source {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-blue);
}

.news-item .news-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.news-item .news-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.news-item .news-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === 25. Settings === */
.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.settings-row .setting-label {
  font-size: 14px;
  color: var(--text-primary);
}

.settings-row .setting-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* === 26. Stock Detail === */
.stock-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.stock-detail-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stock-detail-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stock-detail-name h2 {
  font-size: 20px;
  font-weight: 700;
}

.stock-detail-name .code {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'SF Mono', monospace;
}

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

.stock-detail-price .current-price {
  font-size: 32px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
}

.stock-detail-price .price-change {
  font-size: 16px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
}

.stock-detail-price .price-change.up { color: var(--market-up); }
.stock-detail-price .price-change.down { color: var(--market-down); }

.stock-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.stock-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--bg-secondary);
  padding: 16px;
  text-align: center;
}

.stat-item .stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.stat-item .stat-value {
  font-size: 16px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
  color: var(--text-primary);
}

/* === 27. Financial Data === */
.financial-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.metric-card .metric-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
  color: var(--text-primary);
}

.metric-card .metric-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

/* === 28. Admin Panel === */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
}

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.admin-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.admin-stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.admin-stat-card .stat-icon.blue { background: var(--accent-blue-subtle); color: var(--accent-blue); }
.admin-stat-card .stat-icon.gold { background: var(--accent-gold-subtle); color: var(--accent-gold); }
.admin-stat-card .stat-icon.green { background: var(--market-down-bg); color: var(--market-down); }
.admin-stat-card .stat-icon.purple { background: var(--accent-purple-subtle); color: var(--accent-purple); }

.admin-stat-card .stat-number {
  font-size: 28px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
  color: var(--text-primary);
}

.admin-stat-card .stat-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === 29. Animations === */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes price-flash-up {
  0% { background: var(--market-up-bg); }
  100% { background: transparent; }
}

@keyframes price-flash-down {
  0% { background: var(--market-down-bg); }
  100% { background: transparent; }
}

.flash-up { animation: price-flash-up 600ms ease-out; }
.flash-down { animation: price-flash-down 600ms ease-out; }

.animate-fade-in { animation: fade-in 300ms ease-out; }
.animate-slide-up { animation: slide-up 400ms ease-out; }

/* === 30. Responsive === */
@media (max-width: 1200px) {
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .stock-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .financial-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* === CRITICAL: Enable scrolling on mobile === */
  html {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative !important;
  }

  /* === Layout adjustments === */
  .app-layout {
    display: block !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow: visible !important;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    display: block !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow: visible !important;
  }

  .page-container {
    display: block !important;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 12px !important;
    padding-bottom: calc(var(--bottom-nav-height) + 20px) !important;
  }

  /* === Grid adjustments === */
  .index-grid { grid-template-columns: 1fr; }
  .stock-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .financial-metrics { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr; }

  /* === AI Chat Panel === */
  .ai-chat-panel {
    width: 100%;
  }

  /* === Modal adjustments === */
  .modal {
    width: 95%;
    max-height: 90vh;
  }

  /* Bottom Navigation */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-fixed);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
  }

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

  .bottom-nav-item .nav-icon {
    font-size: 20px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .stock-detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .stock-detail-price {
    text-align: left;
  }

  /* Mobile stock card view */
  .stock-table-container {
    margin: 0 -16px;
  }

  .stock-table thead {
    display: none;
  }

  .stock-table,
  .stock-table tbody {
    display: block;
  }

  .stock-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-primary);
    gap: 8px;
  }

  .stock-table td {
    border: none;
    padding: 0;
  }

  .stock-table td.symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    width: 70px;
  }

  .stock-table td.name {
    flex: 1;
    min-width: 100px;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stock-table td.price {
    font-size: 15px;
    font-weight: 600;
    width: 80px;
    text-align: right;
  }

  .stock-table td.change,
  .stock-table td.change-percent {
    font-size: 12px;
    width: auto;
  }

  .stock-table td.change-percent {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
  }

  .stock-table td.change-percent.up {
    background: rgba(239, 68, 68, 0.15);
  }

  .stock-table td.change-percent.down {
    background: rgba(16, 185, 129, 0.15);
  }

  .stock-table td.volume,
  .stock-table td.turnover,
  .stock-table td.market-cap,
  .stock-table td.pe,
  .stock-table td.dividend {
    display: none;
  }

  .stock-table td.action {
    width: 100%;
    text-align: right;
    margin-top: 4px;
  }

  /* Filter bar mobile */
  .filter-bar {
    flex-direction: column;
    gap: 12px;
  }

  .filter-bar .search-box {
    width: 100%;
  }

  .filter-bar .filter-group {
    width: 100%;
  }

  .filter-bar select {
    width: 100%;
  }

  /* Ranking cards mobile */
  .rankings-grid {
    grid-template-columns: 1fr;
  }

  /* Index cards mobile */
  .index-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .index-card {
    padding: 12px;
  }

  .index-card-name {
    font-size: 12px;
  }

  .index-card-price {
    font-size: 16px;
  }

  .index-card-change {
    font-size: 11px;
  }

  /* News cards mobile */
  .news-card {
    padding: 14px;
  }

  .news-card-title {
    font-size: 14px;
    line-height: 1.4;
  }

  /* Settings mobile */
  .settings-section {
    padding: 16px;
  }

  .setting-item {
    padding: 14px 0;
    min-height: 52px;
  }

  /* AI chat mobile */
  .ai-chat-panel {
    width: 100%;
    right: 0;
  }

  .ai-chat-messages {
    padding: 12px;
  }

  .ai-message {
    max-width: 90%;
  }

  .ai-chat-input {
    padding: 12px;
  }

  .ai-chat-input input {
    font-size: 16px;
    padding: 12px 16px;
  }

  .ai-chat-input button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Modal mobile */
  .modal {
    width: 95%;
    max-height: 85vh;
    margin: auto;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 16px 20px;
  }

  .modal-footer {
    padding: 12px 20px;
  }

  /* Login modal mobile */
  .login-modal {
    padding: 24px 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .login-form input[type="email"],
  .login-form input[type="password"] {
    font-size: 16px;
    padding: 14px 16px;
  }

  .login-btn {
    padding: 16px;
    font-size: 16px;
  }

  /* Global investment mobile */
  .global-indices-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .global-index-card {
    padding: 12px;
  }

  .forex-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  /* Watchlist mobile */
  .watchlist-item {
    padding: 14px 16px;
    min-height: 64px;
  }

  /* Touch improvements */
  .nav-item,
  .bottom-nav-item,
  .btn,
  .header-btn,
  .tab-btn,
  .filter-chip,
  .stock-row,
  .card-clickable {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Prevent iOS zoom on inputs */
  input, select, textarea {
    font-size: 16px;
  }

  /* Smooth scrolling */
  .page-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: calc(var(--bottom-nav-height) + 24px) !important;
  }

  .data-table {
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure content is scrollable */
  #pageContent {
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
  }
  
  /* Force body to be the scroll container on mobile */
  body {
    display: block !important;
  }
  
  /* Remove any flex constraints */
  .main-content,
  .page-container,
  #pageContent {
    flex: none !important;
    display: block !important;
  }
}

@media (min-width: 769px) {
  .bottom-nav { display: none; }
  .mobile-menu-btn { display: none; }
}

/* === 31. Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* === 32. Utility Classes === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }

/* ============================================================
   37. Global Investment Page
   ============================================================ */
.global-indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.global-index-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.global-index-card:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.global-index-card.up { border-left: 3px solid var(--market-up); }
.global-index-card.down { border-left: 3px solid var(--market-down); }

.global-index-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.global-index-flag {
  font-size: 20px;
  line-height: 1;
}

.global-index-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-index-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.global-index-change {
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.global-index-card.up .global-index-change { color: var(--market-up); }
.global-index-card.down .global-index-change { color: var(--market-down); }

.global-index-sparkline {
  margin-top: 8px;
  height: 30px;
}

.global-index-sparkline canvas {
  width: 100%;
  height: 100%;
}

/* Global filter buttons */
.global-filter-btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
}

.global-filter-btn.active {
  background: var(--accent-blue-subtle) !important;
  color: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
}

/* Forex Grid */
.forex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.forex-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--transition-fast);
}

.forex-card:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.forex-pair-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.forex-flag {
  font-size: 24px;
  line-height: 1;
}

.forex-pair-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.forex-price {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.forex-change {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: 8px;
}

.forex-change.up { color: var(--market-up); }
.forex-change.down { color: var(--market-down); }

.forex-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Commodity Grid */
.commodity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.commodity-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
}

.commodity-card:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.commodity-icon {
  font-size: 28px;
  line-height: 1;
}

.commodity-info {
  flex: 1;
  min-width: 80px;
}

.commodity-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.commodity-unit {
  font-size: 11px;
  color: var(--text-tertiary);
}

.commodity-price {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.commodity-change {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  width: 100%;
}

.commodity-change.up { color: var(--market-up); }
.commodity-change.down { color: var(--market-down); }

/* Investment Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-region-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  border: 1px solid var(--border-primary);
}

.project-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.project-name-en {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.project-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.project-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  border-radius: 4px;
  font-weight: 500;
}

.project-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.project-metric .metric-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.project-metric .metric-value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary);
}

.project-manager {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-rating {
  color: var(--accent-gold);
  font-size: 14px;
}

.project-type-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive for global page */
@media (max-width: 768px) {
  .global-indices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .forex-grid {
    grid-template-columns: 1fr;
  }
  .commodity-grid {
    grid-template-columns: 1fr 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .global-indices-grid {
    grid-template-columns: 1fr;
  }
  .commodity-grid {
    grid-template-columns: 1fr;
  }
}
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

/* === 32. Login Modal === */
.login-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-overlay.hidden {
  display: none;
}

.login-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modal-enter 300ms ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 16px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.password-toggle:hover {
  opacity: 1;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

.forgot-link {
  font-size: 13px;
  color: var(--accent-blue);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn-guest {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.login-btn-guest:hover {
  background: var(--bg-tertiary);
  box-shadow: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-disclaimer {
  margin-top: 16px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--accent-gold);
  text-align: center;
}

/* ============================================
   51. SCI-FI / TECH VISUAL EFFECTS
   ============================================ */

/* --- Animated Grid Background --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}

[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* --- Scan Line Effect --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.02) 50%,
    transparent 100%
  );
  background-size: 100% 4px;
  animation: scanLine 8s linear infinite;
  opacity: 0.5;
}

[data-theme="dark"] body::after {
  opacity: 0.8;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.04) 50%,
    transparent 100%
  );
  background-size: 100% 4px;
}

@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* --- Neon Glow on Cards --- */
[data-theme="dark"] .card,
[data-theme="dark"] .data-card {
  position: relative;
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(59, 130, 246, 0.1),
    0 0 0 1px rgba(59, 130, 246, 0.05);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .data-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(59, 130, 246, 0.15),
    0 0 20px rgba(59, 130, 246, 0.1),
    0 0 40px rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

/* --- Neon Glow on Sidebar --- */
[data-theme="dark"] .sidebar {
  border-right: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow:
    4px 0 24px rgba(0, 0, 0, 0.3),
    1px 0 0 rgba(59, 130, 246, 0.05);
}

/* --- Glowing Active Nav Items --- */
[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .nav-item:hover:not(.active) {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.1);
}

/* --- Tech Corner Decorations on Cards --- */
[data-theme="dark"] .card::before,
[data-theme="dark"] .data-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-top: 2px solid rgba(59, 130, 246, 0.4);
  border-left: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 0;
  pointer-events: none;
}

[data-theme="dark"] .card::after,
[data-theme="dark"] .data-card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
  border-right: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 0;
  pointer-events: none;
}

/* --- Glowing Buttons --- */
[data-theme="dark"] .btn-primary {
  position: relative;
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.3),
    0 0 24px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.5),
    0 0 40px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* --- Glowing Gold Accent --- */
[data-theme="dark"] .btn-secondary {
  box-shadow:
    0 0 8px rgba(245, 158, 11, 0.15),
    inset 0 1px 0 rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .btn-secondary:hover {
  box-shadow:
    0 0 16px rgba(245, 158, 11, 0.25),
    0 0 32px rgba(245, 158, 11, 0.1),
    inset 0 1px 0 rgba(245, 158, 11, 0.15);
}

/* --- Market Ticker Glow --- */
[data-theme="dark"] .market-ticker {
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* --- Table Tech Style --- */
[data-theme="dark"] .data-table {
  border: 1px solid rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .data-table thead th {
  background: rgba(59, 130, 246, 0.05);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.03);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.02);
}

/* --- Input Glow on Focus --- */
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.1),
    0 0 12px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(59, 130, 246, 0.05);
}

/* --- Badge Glow --- */
[data-theme="dark"] .badge {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .badge-up {
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .badge-down {
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

/* --- Header Tech Style --- */
[data-theme="dark"] .header {
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(59, 130, 246, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* --- Pulse Animation for Live Indicators --- */
@keyframes techPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 8px currentColor; }
}

.live-dot {
  animation: techPulse 2s ease-in-out infinite;
}

/* --- Holographic Shimmer on Hover --- */
[data-theme="dark"] .card:hover .card-title,
[data-theme="dark"] .data-card:hover .data-label {
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* --- Glowing Scrollbar --- */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.5);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* --- Login Modal Tech Style --- */
[data-theme="dark"] .login-modal {
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(59, 130, 246, 0.1),
    0 0 80px rgba(59, 130, 246, 0.05),
    inset 0 1px 0 rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .login-modal::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2) 0%,
    transparent 40%,
    transparent 60%,
    rgba(245, 158, 11, 0.1) 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* --- Tech Data Flow Lines --- */
[data-theme="dark"] .sidebar-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12px;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.1) 20%,
    rgba(59, 130, 246, 0.2) 50%,
    rgba(59, 130, 246, 0.1) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* --- Animated Border Gradient --- */
@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

[data-theme="dark"] .login-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.5),
    rgba(245, 158, 11, 0.3),
    rgba(59, 130, 246, 0.5),
    transparent
  );
  background-size: 200% 100%;
  animation: borderGlow 3s ease infinite;
}

/* --- Notification Dot Glow --- */
[data-theme="dark"] .notification-dot {
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  animation: techPulse 2s ease-in-out infinite;
}

/* --- Footer Tech Style --- */
[data-theme="dark"] .footer {
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

/* --- Tab Active Glow --- */
[data-theme="dark"] .tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* --- Progress Bar Glow --- */
[data-theme="dark"] .progress-bar-fill {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* --- Chart Area Glow --- */
[data-theme="dark"] .chart-container {
  border: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.02);
}

/* --- Selection Highlight --- */
[data-theme="dark"] ::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

/* --- Focus Ring Glow --- */
[data-theme="dark"] *:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

/* --- Responsive: Disable heavy effects on mobile --- */
@media (max-width: 768px) {
  body::before {
    animation: none;
    background-size: 40px 40px;
  }
  body::after {
    animation: none;
    opacity: 0.3;
  }
  [data-theme="dark"] .card::before,
  [data-theme="dark"] .card::after,
  [data-theme="dark"] .data-card::before,
  [data-theme="dark"] .data-card::after {
    display: none;
  }
}

/* ============================================
   31. HERO SECTION - IMMERSIVE TECH
   ============================================ */
.hero-section {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: -1.5rem -1.5rem 2rem -1.5rem;
}

.hero-section-compact {
  min-height: 50vh;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 26, 0.3) 0%,
    rgba(10, 14, 26, 0.5) 40%,
    rgba(10, 14, 26, 0.75) 70%,
    rgba(10, 14, 26, 0.95) 100%
  );
  z-index: 1;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 179, 255, 0.9), rgba(59, 130, 246, 0.3));
  animation: particleFloat 6s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6), 0 0 12px rgba(59, 130, 246, 0.3);
}

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) translateX(10px) scale(1.3);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-10px) translateX(-8px) scale(0.8);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-30px) translateX(5px) scale(1.1);
    opacity: 0.8;
  }
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 780px;
  width: 100%;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #7dd3fc;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(59, 130, 246, 0.1); }
  50% { box-shadow: 0 0 25px rgba(59, 130, 246, 0.25); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: #fff;
  text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.hero-title-ai {
  display: inline-block;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6, #60a5fa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  filter: drop-shadow(0 0 20px rgba(99, 179, 255, 0.4));
}

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

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(203, 213, 225, 0.85);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Register Form */
.hero-register-form {
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 0.35rem;
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.08), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-input-wrap:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-input-icon {
  width: 20px;
  height: 20px;
  margin-left: 1rem;
  color: rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
}

.hero-input-wrap input {
  flex: 1;
  padding: 0.9rem 1rem;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: var(--font-family);
}

.hero-input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.hero-register-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: var(--font-family);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.hero-register-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.hero-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(59, 130, 246, 0.5);
}

.hero-register-btn:hover svg {
  transform: translateX(3px);
}

/* Hero Features */
.hero-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(203, 213, 225, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
}

.hero-feature-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
}

/* Market Data Section */
.market-data-section {
  padding: 0 0.5rem;
}

.section-header-glow {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.section-header-glow h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

.section-line {
  width: 80px;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--color-accent-blue), transparent);
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .hero-input-wrap {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  .hero-input-icon {
    display: none;
  }
  .hero-input-wrap input {
    width: 100%;
    text-align: center;
  }
  .hero-register-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-features {
    gap: 1rem;
  }
  .hero-content {
    padding: 2rem 1.25rem;
  }
}

/* Light theme hero adjustments */
[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 40%,
    rgba(255, 255, 255, 0.6) 70%,
    rgba(248, 250, 252, 0.95) 100%
  );
}

[data-theme="light"] .hero-title {
  color: #1e293b;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-subtitle {
  color: rgba(51, 65, 85, 0.85);
}

[data-theme="light"] .hero-input-wrap {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hero-input-wrap input {
  color: #1e293b;
}

[data-theme="light"] .hero-input-wrap input::placeholder {
  color: rgba(100, 116, 139, 0.6);
}

[data-theme="light"] .hero-feature {
  color: rgba(51, 65, 85, 0.7);
}

[data-theme="light"] .hero-badge {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

/* ============================================
   32. REGISTRATION GATE OVERLAY
   ============================================ */
.reg-gate {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.reg-gate.reg-gate-closed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Scrollable wrapper */
.reg-gate-scroll {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.reg-gate-scroll::-webkit-scrollbar {
  display: none;
}

/* Background layers */
.reg-gate-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.reg-gate-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  animation: regBgZoom 30s ease-in-out infinite alternate;
}

@keyframes regBgZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.reg-gate-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(10, 14, 26, 0.4) 0%, rgba(10, 14, 26, 0.85) 70%, rgba(10, 14, 26, 0.95) 100%);
  z-index: 1;
}

/* Animated grid */
.reg-gate-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Scanning line */
.reg-gate-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), rgba(99, 179, 255, 0.8), rgba(59, 130, 246, 0.5), transparent);
  z-index: 3;
  animation: scanLine 6s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 60px rgba(59, 130, 246, 0.2);
}

@keyframes scanLine {
  0% { top: -2px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Particles */
.reg-gate-particles {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.reg-gate-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 179, 255, 0.9), rgba(59, 130, 246, 0.2));
  animation: gateParticleFloat 8s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6), 0 0 16px rgba(59, 130, 246, 0.3);
}

@keyframes gateParticleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.2;
  }
  20% {
    transform: translateY(-30px) translateX(15px) scale(1.4);
    opacity: 0.8;
  }
  40% {
    transform: translateY(-15px) translateX(-10px) scale(0.7);
    opacity: 0.4;
  }
  60% {
    transform: translateY(-40px) translateX(8px) scale(1.2);
    opacity: 0.9;
  }
  80% {
    transform: translateY(-20px) translateX(-5px) scale(0.9);
    opacity: 0.5;
  }
}

/* Phase management */
.reg-gate-phase {
  position: relative;
  z-index: 5;
  text-align: center;
  max-width: 700px;
  width: 100%;
  padding: 0.25rem 2rem 2rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reg-gate-phase-hidden {
  display: none;
}

/* Phase 1: Landing */
.reg-gate-logo {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 2rem;
}

.reg-gate-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.3);
  animation: logoRingSpin 8s linear infinite;
}

.reg-gate-logo-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 10px #60a5fa, 0 0 20px rgba(96, 165, 250, 0.5);
  transform: translateX(-50%);
}

@keyframes logoRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reg-gate-logo-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.reg-gate-title {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
  line-height: 1.1;
}

.reg-gate-title-ai {
  display: inline-block;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6, #60a5fa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  filter: drop-shadow(0 0 20px rgba(99, 179, 255, 0.5));
}

.reg-gate-tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.reg-gate-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Button */
.reg-gate-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease;
  font-family: var(--font-family);
  backdrop-filter: blur(10px);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.reg-gate-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.reg-gate-cta:hover::before {
  opacity: 1;
}

.reg-gate-cta:hover {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.3), 0 0 80px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.reg-gate-cta-text {
  position: relative;
  z-index: 1;
}

.reg-gate-cta-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.reg-gate-cta:hover .reg-gate-cta-arrow {
  transform: translateX(4px);
}

/* Stats row */
.reg-gate-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
}

.reg-gate-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.reg-gate-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #60a5fa;
  text-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
}

.reg-gate-stat-label {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reg-gate-stat-divider {
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* Phase 2: Registration Form */
.reg-gate-form-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.1), 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.reg-gate-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, #a78bfa, #3b82f6, transparent);
}

.reg-gate-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.reg-gate-form-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 1rem;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.reg-gate-form-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.reg-gate-form-header p {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.7);
}

.reg-gate-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.reg-gate-input-group {
  text-align: left;
}

.reg-gate-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.8);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reg-gate-input-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  background: rgba(10, 14, 26, 0.6);
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.reg-gate-input-group input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.reg-gate-input-group input::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.reg-gate-submit {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-family);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
  margin-top: 0.5rem;
}

.reg-gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
}

.reg-gate-form-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.reg-gate-back {
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.3s ease;
  font-family: var(--font-family);
}

.reg-gate-back:hover {
  color: #60a5fa;
}

.reg-gate-form-or {
  color: rgba(148, 163, 184, 0.4);
  font-size: 0.8rem;
}

.reg-gate-guest {
  background: none;
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-family);
}

.reg-gate-guest:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

/* Gate Market Data Section */
.reg-gate-market {
  margin-top: 3rem;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.reg-gate-market-header {
  margin-bottom: 1.25rem;
}

.reg-gate-market-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.reg-gate-market-line {
  width: 60px;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
}

.reg-gate-index-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 12px;
}

.reg-gate-index-cards::-webkit-scrollbar {
  display: none;
}

.reg-gate-index-card {
  flex: 0 0 200px;
  min-width: 200px;
  scroll-snap-align: start;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.reg-gate-index-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.reg-gate-index-card.up::before {
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
}

.reg-gate-index-card.down::before {
  background: linear-gradient(90deg, transparent, #10b981, transparent);
}

.reg-gate-index-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.reg-gate-index-name {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.8);
  font-weight: 500;
  margin-bottom: 6px;
}

.reg-gate-index-price {
  font-size: 20px;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 4px;
}

.reg-gate-index-card.up .reg-gate-index-price {
  color: #ef4444;
}

.reg-gate-index-card.down .reg-gate-index-price {
  color: #10b981;
}

.reg-gate-index-change {
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  display: flex;
  gap: 8px;
}

.reg-gate-index-card.up .reg-gate-index-change {
  color: #ef4444;
}

.reg-gate-index-card.down .reg-gate-index-change {
  color: #10b981;
}

.reg-gate-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  color: rgba(148, 163, 184, 0.4);
  font-size: 0.75rem;
}

.reg-gate-scroll-arrow {
  display: inline-block;
  animation: swipeHint 2s ease-in-out infinite;
  font-size: 1rem;
}

/* Gate responsive - Tablet */
@media (max-width: 768px) {
  .reg-gate-scroll {
    padding: 0;
  }

  .reg-gate-phase {
    padding: 0.25rem 1rem 2rem;
  }

  /* Hero section mobile */
  .reg-gate-logo {
    width: 48px;
    height: 48px;
  }
  .reg-gate-logo svg {
    width: 28px;
    height: 28px;
  }
  .reg-gate-logo-ring {
    width: 60px;
    height: 60px;
  }
  .reg-gate-title {
    font-size: 1.5rem;
  }
  .reg-gate-tagline {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }
  .reg-gate-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 100%;
    padding: 0 0.5rem;
  }

  /* Market data section mobile */
  .reg-gate-market-section {
    padding: 0 0.5rem;
    margin-top: 1.5rem;
  }
  .reg-gate-market-title {
    font-size: 1rem;
  }
  .reg-gate-market-subtitle {
    font-size: 0.75rem;
  }
  .reg-gate-index-cards {
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    scroll-snap-type: x mandatory;
  }
  .reg-gate-index-card {
    min-width: 150px;
    max-width: 150px;
    padding: 0.75rem;
  }
  .reg-gate-index-name {
    font-size: 0.7rem;
  }
  .reg-gate-index-value {
    font-size: 0.95rem;
  }
  .reg-gate-index-change {
    font-size: 0.65rem;
  }

  /* Features mobile */
  .reg-gate-features {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0 0.5rem;
  }
  .reg-gate-feature {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }
  .reg-gate-feature-icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .reg-gate-feature-text {
    font-size: 0.7rem;
  }

  /* CTA mobile */
  .reg-gate-cta {
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  /* Stats mobile */
  .reg-gate-stats {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .reg-gate-stat-num {
    font-size: 1.1rem;
  }
  .reg-gate-stat-label {
    font-size: 0.65rem;
  }

  /* Form card mobile */
  .reg-gate-form-card {
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 16px;
    max-width: 100%;
  }
  .reg-gate-form-title {
    font-size: 1.25rem;
  }
  .reg-gate-form-subtitle {
    font-size: 0.8rem;
  }
  .reg-gate-form {
    gap: 0.75rem;
  }
  .reg-gate-input-group {
    gap: 0.3rem;
  }
  .reg-gate-label {
    font-size: 0.75rem;
  }
  .reg-gate-input {
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
  }
  .reg-gate-form-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
  .reg-gate-back-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
  }
  .reg-gate-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
  }
  .reg-gate-guest-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
  }
}

/* Gate responsive - Small phone */
@media (max-width: 480px) {
  .reg-gate-phase {
    padding: 0 0.75rem 1.5rem;
  }
  .reg-gate-title {
    font-size: 1.25rem;
  }
  .reg-gate-tagline {
    font-size: 0.7rem;
  }
  .reg-gate-desc {
    font-size: 0.72rem;
    padding: 0 0.25rem;
  }
  .reg-gate-index-card {
    min-width: 135px;
    max-width: 135px;
    padding: 0.6rem;
  }
  .reg-gate-index-value {
    font-size: 0.85rem;
  }
  .reg-gate-features {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
  .reg-gate-feature {
    padding: 0.5rem 0.6rem;
  }
  .reg-gate-feature-icon {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }
  .reg-gate-feature-text {
    font-size: 0.62rem;
  }
  .reg-gate-cta {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
  }
  .reg-gate-stat-num {
    font-size: 1rem;
  }
  .reg-gate-form-card {
    padding: 1.25rem 0.75rem;
    margin: 0 0.25rem;
  }
  .reg-gate-form-title {
    font-size: 1.1rem;
  }
}

