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

/* High-End Trading Platform Variables - Using Theme CSS */
  /* Font Scale Factor - Change this to scale all fonts proportionally */
:root {
  --font-scale: 1.4; /* Increase this to make fonts bigger (1.0 = original, 1.7 = 70% bigger) */
  
  /* Base Font Sizes - All scaled by --font-scale */
  --font-xs: calc(4px * var(--font-scale));    /* Extra small */
  --font-sm: calc(6px * var(--font-scale));    /* Small */
  --font-base: calc(8px * var(--font-scale));  /* Base/Medium */
  --font-md: calc(10px * var(--font-scale));   /* Medium-Large */
  --font-lg: calc(12px * var(--font-scale));   /* Large */
  --font-xl: calc(14px * var(--font-scale));   /* Extra Large */
  --font-2xl: calc(16px * var(--font-scale));  /* 2X Large */
  --font-3xl: calc(18px * var(--font-scale));  /* 3X Large */
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-ultra-smooth: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

/* Professional Tooltip Enhancement */
[title] {
  position: relative;
  cursor: help;
}

/* Custom CSS Tooltip for Desktop */
[title]:hover::before,
[title]:hover::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: translateY(10px);
  z-index: 10000;
}

/* Tooltip content */
[title]:hover::before {
  content: attr(title);
  background: linear-gradient(135deg, var(--dark-navy) 0%, #2a3441 100%);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: var(--font-sm);
  font-weight: 500;
  line-height: 1.4;
  max-width: 300px;
  width: max-content;
  border: 1px solid var(--accent-blue);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  white-space: normal;
  word-wrap: break-word;
}

/* Tooltip arrow */
[title]:hover::after {
  content: '';
  border: 6px solid transparent;
  border-top: 6px solid var(--dark-navy);
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Show tooltip on hover */
[title]:hover::before,
[title]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Enhanced tooltip styling for inputs and selects */
input[title]:hover, 
select[title]:hover, 
label[title]:hover {
  filter: brightness(1.15);
  box-shadow: 
    0 0 15px rgba(59, 130, 246, 0.4),
    0 0 30px rgba(59, 130, 246, 0.2);
  transition: var(--transition-smooth);
  transform: translateY(-1px);
}

/* Tooltip accessibility enhancement */
[title]:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Additional visual feedback for tooltipped elements */
input[title], select[title] {
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: var(--transition-smooth);
}

input[title]:hover, select[title]:hover {
  border-color: var(--accent-blue);
}

/* Hide default browser tooltip */
[title] {
  position: relative;
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
  /* Hide custom tooltips on mobile to prevent conflicts */
  [title]:hover::before,
  [title]:hover::after {
    display: none;
  }
  
  /* Show mobile info icons */
  [title]::after {
    content: ' â“˜';
    color: var(--accent-blue);
    font-size: 0.8em;
    opacity: 0.7;
  }
}

/* Mobile Touch Tooltip Popup */
.mobile-tooltip {
  position: fixed;
  background: var(--dark-navy);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent-blue);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  font-size: var(--font-sm);
  max-width: 280px;
  z-index: 9999;
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  line-height: 1.4;
}

.mobile-tooltip.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.mobile-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--dark-navy);
}

/* Visual feedback for long press */
.long-press-active {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: var(--accent-blue) !important;
  transform: scale(0.98);
}

/* Touch feedback hint */
@media (max-width: 768px) {
  [title]::after {
    content: ' â“˜';
    color: var(--accent-blue);
    font-size: 0.8em;
    opacity: 0.7;
  }
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 30%, #1a1a1a 60%, #2a2a2a 100%);
  color: var(--white);
  font-size: var(--font-base);
  position: relative;
}

/* Professional Trading Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.06) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
  animation: backgroundShift 35s ease-in-out infinite;
}

.container {
  position: relative;
  width: 100%;
  height: 100vh;
  padding: 2px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Professional Trading Header Dashboard */
.firstline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  height: 28px;
}

.acctbalance, .tradesTaken, .netProfit {
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-compact);
  padding: 2px 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-left: 2px solid var(--accent-blue);
  transition: var(--transition-smooth);
}

.acctbalance:hover, .tradesTaken:hover, .netProfit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--light-blue);
}

.acctbalance::before, .tradesTaken::before, .netProfit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  animation: dataShimmer 5s ease-in-out infinite;
}

#balance, #tradesTaken, #netProfit {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--white);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 16px;
}

#netProfit {
  font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Courier New', monospace;
  font-size: var(--font-3xl);
  font-weight: 600;
  color: var(--white);
  margin: 0;
  letter-spacing: 0.8px;
  line-height: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}

/* Simple color states for net profit - based only on value */
#netProfit.profit {
  color: #10b981 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

#netProfit.loss {
  color: #ef4444 !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

#netProfit.neutral {
  color: var(--white) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Professional bounce animation */
@keyframes professionalBounce {
  0% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(0.98); }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

/* Digital counter animation */
@keyframes digitalFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

#netProfit.animating {
  animation: professionalBounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#netProfit.counting {
  animation: digitalFlicker 0.1s ease-in-out;
}

#netProfit.profit-active {
  color: var(--success) !important;
}

#netProfit.loss-active {
  color: var(--danger) !important;
}

/* Remove all animation classes */
.netProfit.profit-increase {
  border-left-color: var(--success);
}

.netProfit.loss-decrease {
  border-left-color: var(--danger);
}

/* Simple highlight states - no animations */
#netProfit.profit-highlight {
  color: var(--success) !important;
}

#netProfit.loss-highlight {
  color: var(--danger) !important;
}

/* Simple active states with pulsing */
.netProfit.profit-active {
  border-left-color: var(--success);
  animation: profitPulse 2s ease-in-out infinite;
}

.netProfit.loss-active {
  border-left-color: var(--danger);
  animation: lossPulse 2s ease-in-out infinite;
}

@keyframes profitPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  }
}

@keyframes lossPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  }
}

/* Hide radio form (controlled by combined button) */
form {
  display: none;
}

/* Professional Trading Input Panel */
.trading-input-panel {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr;
  gap: 2px;
  height: 30px;
}

.input-row {
  display: flex;
  gap: 2px;
  height: 100%;
}

.input-row .custom-edgeshape {
  flex: 1;
  margin: 0;
}

/* Premium Professional Inputs */
#symbolInput, #stake_input, #takeprofit_input, #maximum_losses, #stoploss_input {
  padding: 2px 4px;
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--dark-navy) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid var(--slate);
  border-radius: 6px;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  border-left: 2px solid transparent;
}

#symbolInput:hover, #stake_input:hover, #takeprofit_input:hover, 
#maximum_losses:hover, #stoploss_input:hover {
  border-left-color: var(--light-blue);
  transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

#symbolInput:focus, #stake_input:focus, #takeprofit_input:focus, 
#maximum_losses:focus, #stoploss_input:focus {
  border-left-color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px) scale(1.01);
}

#symbolInput {
  font-size: var(--font-sm);
}

/* Glassmorphism Dropdown Options */
#symbolInput option {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px) saturate(1.3);
  color: var(--white);
  padding: 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: var(--font-sm);
}

#symbolInput option:hover, #symbolInput option:checked {
  background: rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(25px) saturate(1.5);
  color: var(--white);
}

#durationUnit option {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px) saturate(1.3);
  color: var(--white);
  padding: 2px 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: var(--font-sm);
}

#durationUnit option:hover, #durationUnit option:checked {
  background: rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(25px) saturate(1.5);
  color: var(--white);
}

/* Professional Strategy Panel - Fixed Layout */
.strategy-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  padding: 4px 6px;
  box-shadow: var(--shadow-compact);
  transition: var(--transition-smooth);
  min-height: 50px;
}

.strategy-panel:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--glass-border-hover);
}

.strategy-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  align-items: center;
  justify-items: start;
  height: 40px;
  margin-bottom: 2px;
}

.square-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  white-space: nowrap;
  padding: 3px 4px;
  border-radius: 6px;
  transition: var(--transition-smooth);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
}

.square-radio:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  border-color: var(--glass-border);
}

.square-radio input[type="radio"] {
  appearance: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  background: var(--glass-light);
  transition: var(--transition-spring);
  position: relative;
  flex-shrink: 0;
}

.square-radio input[type="radio"]:checked {
  background: var(--gradient-primary);
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
  transform: scale(1.1);
}

.square-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Additional Inputs - Enhanced Design */
.additional-inputs {
  display: none;
  background: linear-gradient(135deg, var(--dark-navy) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-radius: 4px;
  padding: 2px 4px;
  border: 1px solid var(--slate);
  margin: 0;
  animation: slideIn 0.3s ease-out;
  z-index: 10;
  position: relative;
}

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

.additional-inputs label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--white);
  margin-right: 4px;
}

#martingaleDigitInput, #ticksInput, #durationInput {
  padding: 2px 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--white);
  background: var(--dark-navy);
  border: 1px solid var(--slate);
  border-radius: 3px;
  width: 40px;
  margin: 0 2px;
  transition: var(--transition-smooth);
}

#martingaleDigitInput:focus, #ticksInput:focus, #durationInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

#durationUnit {
  padding: 2px 4px;
  font-size: var(--font-sm);
  background: var(--dark-navy);
  border: 1px solid var(--slate);
  border-radius: 3px;
  color: var(--white);
  width: 55px;
  transition: var(--transition-smooth);
}

#durationUnit:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

#stakeListContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 2px 0;
}

.stake-input {
  padding: 2px 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--white);
  background: var(--dark-navy);
  border: 1px solid var(--slate);
  border-radius: 3px;
  width: 35px;
  text-align: center;
  transition: var(--transition-smooth);
}

.stake-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* Error Container */
#errorContainer {
  min-height: 4px;
  font-size: var(--font-sm);
  color: var(--danger);
  text-align: center;
  font-weight: 600;
  margin: 0;
  padding: 1px 2px;
  line-height: 1;
  max-height: 12px;
  overflow: hidden;
  border-radius: 3px;
}

/* Professional Market Selection Dashboard */
.market-selection-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: center;
  height: 32px;
}

#combinedButton {
  width: 240px;
  height: 32px;
  position: relative;
  background: var(--glass-medium);
  backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-compact);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

#combinedButton:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

#evenSection, #oddSection {
  position: absolute;
  height: 100%;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 800;
  color: var(--white);
  transition: var(--transition-smooth);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

#evenSection {
  left: 0;
  background: var(--gradient-success);
  border-radius: 16px 0 0 16px;
}

#oddSection {
  right: 0;
  background: var(--gradient-danger);
  border-radius: 0 16px 16px 0;
}

/* Enhanced Trading Summary */
#tradingSummary {
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  padding: 4px 6px;
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow-compact);
  max-height: 32px;
  overflow: hidden;
  border-left: 2px solid var(--warning);
  justify-self: start;
  line-height: 1.2;
  transition: var(--transition-smooth);
}

#tradingSummary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

#tradingSummary span.input-value {
  color: var(--accent-blue);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(59, 130, 246, 0.6);
}

/* Professional Action Panel */
.action-panel {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  height: 30px;
}

#tradeButton, #pauseButton {
  padding: 4px 12px;
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--white);
  background: var(--gradient-primary);
  border: 1px solid var(--accent-blue);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-compact);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#tradeButton:hover, #pauseButton:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

#tradeButton.clicked {
  background: var(--gradient-success);
  animation: pulse 2s ease-in-out infinite;
}

#pauseButton {
  background: var(--gradient-danger);
  display: none;
}

/* Professional Trading Tables Dashboard */
.trading-tables {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2px;
  height: 100%;
  min-height: 0;
}

#openContractsTable, #tradeHistoryTable {
  width: 100%;
  border-collapse: collapse;
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.2);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow-compact);
  font-size: var(--font-sm);
  border-top: 2px solid var(--accent-blue);
}

#openContractsTable {
  max-height: 45px;
}

#tradeHistoryTable {
  height: 100%;
  display: block;
  overflow-y: auto;
}

#tradeHistoryTable thead,
#tradeHistoryTable tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

th, td {
  padding: 1px 2px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
}

th {
  background: var(--gradient-primary);
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  height: 16px;
  font-size: var(--font-sm);
  border-bottom: 1px solid var(--glass-border);
}

tbody {
  color: var(--white);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.01);
  transition: var(--transition-smooth);
}

.positive {
  color: var(--success);
  font-weight: 700;
  text-shadow: 0 0 2px rgba(16, 185, 129, 0.6);
}

.negative {
  color: var(--danger);
  font-weight: 700;
  text-shadow: 0 0 2px rgba(239, 68, 68, 0.6);
}

/* Trade History Container */
.trade-history-container {
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-compact);
  overflow: hidden;
  border-top: 2px solid var(--accent-blue);
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.recent-trades {
  padding: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recent-trades:hover {
  background: rgba(59, 130, 246, 0.05);
}

.recent-trades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.recent-title {
  color: var(--white);
  font-size: var(--font-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.view-all-btn {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  transition: all 0.2s ease;
}

.view-all-btn:hover {
  background: var(--gradient-accent);
  transform: scale(1.05);
}

.recent-trades-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  max-height: 250px;
}

.recent-trade-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 1px;
  padding: 1px;
  font-size: var(--font-sm);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-trade-item.won {
  border-left: 2px solid var(--success);
}

.recent-trade-item.lost {
  border-left: 2px solid var(--danger);
}

.recent-trade-item > div {
  text-align: center;
  padding: 1px;
  font-weight: 600;
}

.recent-trade-item .profit {
  font-weight: 700;
}

.recent-trade-item.won .profit {
  color: var(--success);
}

.recent-trade-item.lost .profit {
  color: var(--danger);
}

/* --- Trade History Popup --- */
.trade-history-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.trade-history-popup-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  animation: popIn 0.3s ease-out;
}

.trade-history-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--gradient-primary);
  border-bottom: 1px solid var(--glass-border);
}

.trade-history-popup-title {
  color: var(--white);
  font-size: var(--font-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.trade-history-close-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 16px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.trade-history-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.trade-history-popup-body {
  padding: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

#tradeHistoryTablePopup {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
    font-size: var(--font-md);
  color: var(--white);
}

#tradeHistoryTablePopup th, #tradeHistoryTablePopup td {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

#tradeHistoryTablePopup th {
  background: var(--gradient-primary);
  color: var(--white);
  font-size: var(--font-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

#tradeHistoryTablePopup tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

#tradeHistoryTablePopup .positive {
  color: var(--success);
  font-weight: 700;
}

#tradeHistoryTablePopup .negative {
  color: var(--danger);
  font-weight: 700;
}

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

/* Enhanced Trading Summary Button */
.summary-btn {
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  padding: 3px 8px;
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-compact);
  border-left: 2px solid var(--warning);
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.summary-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  background: var(--gradient-primary);
}

.summary-btn i {
  font-size: 10px;
}

/* Trading Summary Popup */
.summary-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.summary-popup-content {
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(1.3);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  padding: 16px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-top: 2px solid var(--accent-blue);
}

.summary-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.summary-popup-title {
  color: var(--white);
  font-size: var(--font-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-close-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 14px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.summary-close-btn:hover {
  background: var(--gradient-danger);
  transform: scale(1.1);
}

.summary-popup-text {
  color: var(--white);
  font-size: var(--font-base);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 12px;
}

.summary-popup-text .input-value {
  color: var(--accent-blue);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(59, 130, 246, 0.6);
}

#tradingSummary {
  font-size: var(--font-base);
  max-height: 30px;
}

.summary-btn {
  font-size: var(--font-sm);
  height: 18px;
  padding: 2px 6px;
  gap: 2px;
}

.summary-btn i {
  font-size: var(--font-base);
}

.summary-popup-content {
  max-width: 280px;
  padding: 12px;
}

.summary-popup-title {
  font-size: var(--font-base);
}

.summary-popup-text {
  font-size: var(--font-base);
}

.action-panel {
  height: 28px;
}

/* Net Profit Popup */
.net-profit-popup {
  position: absolute;
  top: -25px;
  right: -5px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--font-base);
  font-weight: 700;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease;
}

.net-profit-popup.show {
  animation: netProfitPopupShow 2s ease-out;
}

.net-profit-popup.loss {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes netProfitPopupShow {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-5px) scale(1.1);
  }
  40% {
    opacity: 1;
    transform: translateY(-8px) scale(1.05);
  }
  60% {
    opacity: 0.8;
    transform: translateY(-10px) scale(1);
  }
  80% {
    opacity: 0.4;
    transform: translateY(-12px) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translateY(-15px) scale(0.9);
  }
}

/* Profit Animation Styles - Subtle and Quick */
@keyframes profitFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(-40px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.9);
  }
}

@keyframes profitGlow {
  0%, 100% {
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
  }
  50% {
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.9), 0 0 25px rgba(16, 185, 129, 0.7);
  }
}

/* Subtle Profit Popup */
.profit-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  display: none;
  animation: profitFloat 1.5s ease-out forwards;
}

.profit-popup-content {
  background: rgba(16, 185, 129, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
  color: white;
  font-weight: 700;
  font-size: var(--font-2xl);
  white-space: nowrap;
  animation: profitGlow 1.5s ease-in-out;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
  .profit-popup-content {
    font-size: var(--font-xl);
    padding: 6px 12px;
    border-radius: 6px;
  }
  
  .recent-title {
    font-size: var(--font-sm);
  }
  
  .view-all-btn {
    font-size: var(--font-xs);
  }
  
  .recent-trade-item {
    font-size: var(--font-xs);
    padding: 1px;
    gap: 1px;
  }
  
  .recent-trade-item > div {
    padding: 1px;
    font-size: var(--font-xs);
  }
  
  .trade-history-container {
    max-height: 200px;
  }
  
  .recent-trades-list {
    max-height: 150px;
  }
  
  .trade-history-popup-content {
    width: 95%;
    max-width: 400px;
  }
  
  .trade-history-popup-header {
    padding: 6px 8px;
  }
  
  .trade-history-popup-title {
    font-size: var(--font-base);
  }
  
  .trade-history-popup-body {
    padding: 6px;
    max-height: 50vh;
  }
  
  #tradeHistoryTablePopup {
    font-size: var(--font-base);
  }
  
  #tradeHistoryTablePopup th, #tradeHistoryTablePopup td {
    padding: 3px 4px;
  }
  
  #tradeHistoryTablePopup th {
    font-size: var(--font-sm);
  }
}

@media screen and (max-width: 480px) {
  .profit-popup-content {
    font-size: var(--font-lg);
    padding: 4px 8px;
    border-radius: 4px;
  }
  
  .recent-trade-item {
    font-size: var(--font-xs);
    padding: 1px;
    gap: 1px;
  }
  
  .recent-trade-item > div {
    padding: 1px;
    font-size: var(--font-xs);
  }
  
  .trade-history-container {
    max-height: 180px;
  }
  
  .recent-trades-list {
    max-height: 130px;
  }
  
  .trade-history-popup-content {
    width: 98%;
    max-width: 350px;
  }
  
  .trade-history-popup-title {
    font-size: var(--font-sm);
  }
  
  #tradeHistoryTablePopup {
    font-size: var(--font-sm);
  }
  
  #tradeHistoryTablePopup th, #tradeHistoryTablePopup td {
    padding: 2px 3px;
  }
  
  #tradeHistoryTablePopup th {
    font-size: var(--font-xs);
  }
}

/* Enhanced Universal Popup Integration */
.universal-popup-overlay {
    z-index: 10000 !important;
}

.universal-popup {
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
}

.universal-popup.success {
    border-left: 5px solid #28a745 !important;
}

.universal-popup.warning {
    border-left: 5px solid #ffc107 !important;
}

.universal-popup.error {
    border-left: 5px solid #dc3545 !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .universal-popup {
        margin: 10px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

/* Animation enhancements */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.universal-popup {
    animation: slideInFromTop 0.3s ease-out !important;
}