/* ==========================================
   CAPITALIST - Stock Market Simulator
   Modern Dark Theme with Vibrant Accents
   ========================================== */

/* CSS Variables */
:root {
  /* Background Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #16161f;
  --bg-elevated: #1e1e28;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  /* Accent Colors */
  --accent-green: #00ff88;
  --accent-green-dim: #00cc6a;
  --accent-red: #ff4757;
  --accent-red-dim: #cc3945;
  --accent-blue: #00d4ff;
  --accent-purple: #a855f7;
  --accent-gold: #ffd700;
  
  /* Gradients */
  --gradient-green: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
  --gradient-red: linear-gradient(135deg, #ff4757 0%, #ff6b7a 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-green: 0 0 30px rgba(0, 255, 136, 0.3);
  --shadow-glow-red: 0 0 30px rgba(255, 71, 87, 0.3);
  
  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Typography */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

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

/* ==========================================
   SPLASH SCREEN
   ========================================== */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
}

.logo-container {
  animation: fadeInUp 0.8s ease-out;
}

.logo-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-lg);
  animation: pulse 2s ease-in-out infinite;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.logo-tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin: var(--space-xl) auto 0;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: var(--gradient-green);
  border-radius: 3px;
  animation: loading 1.5s ease-in-out forwards;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ==========================================
   MAIN APP
   ========================================== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 80px;
  width: 100%;
  max-width: 100%;
}

.app.hidden {
  display: none;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.app-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.balance-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.balance-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.balance-amount {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-green);
}

.reset-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reset-btn:hover {
  background: var(--bg-elevated);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

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

/* ==========================================
   SCREEN CONTAINER
   ========================================== */
.screen-container {
  flex: 1;
  padding: var(--space-lg) var(--space-xl);
  width: 100%;
  max-width: 100%;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.screen-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.market-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: rgba(0, 255, 136, 0.1);
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

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

.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================
   SORT CONTROLS
   ========================================== */
.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
}

.sort-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-buttons {
  display: flex;
  gap: var(--space-sm);
}

.sort-btn {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.sort-btn.active {
  background: var(--gradient-green);
  color: var(--bg-primary);
  border-color: transparent;
  font-weight: 600;
}

/* ==========================================
   SEARCH
   ========================================== */
.search-container {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 48px;
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

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

.search-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

/* ==========================================
   STOCK LIST
   ========================================== */
.stock-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stock-card:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.stock-card:active {
  transform: scale(0.98);
}

.stock-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.stock-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stock-details {
  flex: 1;
  min-width: 0;
}

.stock-symbol {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stock-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-price-info {
  text-align: right;
  flex-shrink: 0;
}

.stock-price {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stock-change {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.stock-change.positive {
  color: var(--accent-green);
}

.stock-change.negative {
  color: var(--accent-red);
}

/* ==========================================
   PORTFOLIO SCREEN
   ========================================== */
.portfolio-summary {
  margin-bottom: var(--space-lg);
}

.total-value-card {
  background: var(--gradient-card), var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-md);
}

.total-value-card .card-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.total-value-card .card-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.profit-loss {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.profit-loss.positive .pl-amount,
.profit-loss.positive .pl-percent {
  color: var(--accent-green);
}

.profit-loss.negative .pl-amount,
.profit-loss.negative .pl-percent {
  color: var(--accent-red);
}

.pl-amount {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.pl-percent {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================
   CHART
   ========================================== */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  height: 280px;
  min-height: 280px;
  max-height: 280px;
  overflow: hidden;
}

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

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

.timeframe-buttons {
  display: flex;
  gap: var(--space-xs);
}

.timeframe-btn {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.timeframe-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.timeframe-btn.active {
  color: var(--accent-green);
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-green);
}

.chart-wrapper {
  height: 200px;
  max-height: 200px;
  position: relative;
}

#performanceChart {
  width: 100%;
  height: 100%;
  max-height: 200px;
}

/* ==========================================
   HOLDINGS & TRANSACTIONS
   ========================================== */
.holdings-section,
.transactions-section {
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.holdings-list,
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  text-align: center;
}

.empty-state svg {
  width: 60px;
  height: 60px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.empty-state span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Holding Card */
.holding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.holding-card:hover {
  background: var(--bg-elevated);
  transform: translateX(4px);
}

.holding-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.holding-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.holding-details .holding-symbol {
  font-size: 0.95rem;
  font-weight: 600;
}

.holding-details .holding-shares {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.holding-value {
  text-align: right;
}

.holding-total {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

.holding-pnl {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.holding-pnl.positive {
  color: var(--accent-green);
}

.holding-pnl.negative {
  color: var(--accent-red);
}

/* Transaction Card */
.transaction-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
}

.transaction-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.transaction-type {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.transaction-type.buy {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}

.transaction-type.sell {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-red);
}

.transaction-details .transaction-symbol {
  font-size: 0.95rem;
  font-weight: 600;
}

.transaction-details .transaction-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.transaction-amount {
  text-align: right;
}

.transaction-total {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

.transaction-total.buy {
  color: var(--accent-red);
}

.transaction-total.sell {
  color: var(--accent-green);
}

.transaction-shares {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================
   BOTTOM NAVIGATION
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) var(--space-md);
  padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

.nav-btn span {
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-btn:hover {
  color: var(--text-secondary);
}

.nav-btn.active {
  color: var(--accent-green);
}

.nav-btn.active svg {
  filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
  padding: var(--space-lg);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.modal-close svg {
  width: 18px;
  height: 18px;
}

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

.modal-stock-info {
  display: flex;
  flex-direction: column;
}

.modal-symbol {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-price-info {
  text-align: right;
}

.modal-price {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-change {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.modal-change.positive {
  color: var(--accent-green);
}

.modal-change.negative {
  color: var(--accent-red);
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.modal-tab {
  flex: 1;
  padding: var(--space-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.modal-tab.active[data-action="buy"] {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.modal-tab.active[data-action="sell"] {
  background: rgba(255, 71, 87, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Input Type Toggle */
.input-type-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  padding: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Amount Input */
.amount-input-container {
  margin-bottom: var(--space-lg);
}

.input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

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

.input-prefix {
  position: absolute;
  left: var(--space-md);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--text-muted);
}

.amount-input {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.amount-input:focus {
  border-color: var(--accent-green);
}

.amount-input::placeholder {
  color: var(--text-muted);
}

/* Hide number input arrows */
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input[type=number] {
  -moz-appearance: textfield;
}

/* Quick Amount Buttons */
.quick-amounts {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.quick-btn {
  flex: 1;
  padding: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Order Summary */
.order-summary {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.summary-row:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.summary-row span:last-child {
  font-family: var(--font-mono);
}

/* Holdings Info */
.holdings-info {
  text-align: center;
  padding: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.holdings-info strong {
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

/* Trade Button */
.trade-btn {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.trade-btn.buy {
  background: var(--gradient-green);
  color: var(--bg-primary);
}

.trade-btn.buy:hover {
  box-shadow: var(--shadow-glow-green);
  transform: translateY(-2px);
}

.trade-btn.sell {
  background: var(--gradient-red);
  color: var(--text-primary);
}

.trade-btn.sell:hover {
  box-shadow: var(--shadow-glow-red);
  transform: translateY(-2px);
}

.trade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Confirm Modal */
.confirm-modal {
  text-align: center;
  border-radius: var(--border-radius-xl);
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 71, 87, 0.15);
  border-radius: 50%;
}

.confirm-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent-red);
}

.confirm-modal h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.confirm-modal p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.confirm-buttons {
  display: flex;
  gap: var(--space-md);
}

.confirm-btn {
  flex: 1;
  padding: var(--space-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.confirm-btn.cancel:hover {
  background: var(--bg-elevated);
}

.confirm-btn.confirm {
  background: var(--accent-red);
  color: var(--text-primary);
}

.confirm-btn.confirm:hover {
  background: var(--accent-red-dim);
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.toast.success {
  border-color: var(--accent-green);
  background: rgba(0, 255, 136, 0.1);
}

.toast.error {
  border-color: var(--accent-red);
  background: rgba(255, 71, 87, 0.1);
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: var(--space-lg);
  }
  
  .modal {
    border-radius: var(--border-radius-xl);
  }
  
  .screen-container {
    max-width: 100%;
    padding: var(--space-lg) var(--space-xl);
  }
  
  .total-value-card .card-value {
    font-size: 3rem;
  }
  
  /* Desktop grid layout for stock list */
  .stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
  }
  
  /* Desktop layout for portfolio */
  .portfolio-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
  }
  
  .total-value-card {
    margin-bottom: 0;
  }
  
  .stats-row {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .stat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* Holdings and transactions side by side on desktop */
  .holdings-transactions-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* Dark mode forced */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: dark;
  }
}
