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

/* Compact Trading Platform Variables - Using Theme CSS */
:root {
  --font-scale: 1.4;
  --font-xs: calc(4px * var(--font-scale));
  --font-sm: calc(6px * var(--font-scale));
  --font-base: calc(8px * var(--font-scale));
  --font-md: calc(10px * var(--font-scale));
  --font-lg: calc(12px * var(--font-scale));
  --font-xl: calc(14px * var(--font-scale));
  --font-2xl: calc(16px * var(--font-scale));
  --font-3xl: calc(18px * var(--font-scale));
}

* {
      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: 1px;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #334155 60%, #475569 100%);
  color: var(--white);
  font-size: var(--font-md);
  position: relative;
    }

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

/* Compact Trading Header */
.firstline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  height: 26px;
}

.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: 1px 3px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--accent-blue);
}

#balance, #tradesTaken, #netProfit {
  font-size: var(--font-base);
  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: 700;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 0 transparent;
}

/* Value-based color states */
#netProfit.profit {
  color: #10b981 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(16, 185, 129, 0.3);
}

#netProfit.loss {
  color: #ef4444 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(239, 68, 68, 0.3);
}

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

/* Professional animations */
@keyframes professionalBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes digitalFlicker {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.8; }
  50% { opacity: 1; }
  75% { opacity: 0.9; }
}

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

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

@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 */
form {
  display: none;
}

/* Consolidated Input Section */
.input-section {
  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: 1px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  max-height: none;
}

.input-row {
  display: flex;
  gap: 1px;
  height: 24px;
}

.input-row.four-columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1px;
  height: 24px;
}

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

/* Compact Inputs */
#symbolInput, #contractTypeInput, #stake_input, #takeprofit_input, #maximum_losses, #stoploss_input, #barrier_input {
  padding: 1px 2px;
  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;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  border-left: 1px solid transparent;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#symbolInput:focus, #contractTypeInput:focus, #stake_input:focus, #takeprofit_input:focus, 
#maximum_losses:focus, #stoploss_input:focus, #barrier_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);
}

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

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

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

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

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

/* Additional Inputs Container */
.additional-inputs-container {
  min-height: 20px;
  position: relative;
}

/* Compact Additional Inputs */
.additional-inputs {
      display: none;
  background: linear-gradient(135deg, var(--dark-navy) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-radius: 6px;
  padding: 1px 2px;
  border: 1px solid var(--slate);
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  align-items: center;
  z-index: 10;
}

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

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

#durationUnit {
  padding: 1px 2px;
  font-size: 7px;
  background: var(--dark-navy);
  border: 1px solid var(--slate);
  border-radius: 3px;
  color: var(--white);
  width: 40px;
}

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

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

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

/* Compact Market Selection */
.market-selection-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
}

.combinedContainer {
  display: flex;
  justify-content: center;
  align-items: center;
}

#combinedButton {
  width: 220px;
  height: 30px;
  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);
}

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

#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;
}

/* Compact Trading Summary */
#tradingSummary {
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(1.3);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow-compact);
  max-height: 28px;
  overflow: hidden;
  border-left: 1px solid var(--warning);
  line-height: 1.2;
  display: none;
}

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

/* Compact Action Panel */
.startbutton {
  display: flex;
  gap: 2px;
  justify-content: center;
  align-items: center;
  height: 26px;
}

.custom-edgeshape-transition {
  padding: 2px 8px;
  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;
  box-shadow: var(--shadow-compact);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.custom-edgeshape-transition.clicked {
  background: var(--gradient-success);
}

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

/* Tables Wrapper */
.tables-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 200px;
  margin-top: 2px;
  min-height: 0;
}

.open-contracts-container {
  flex: 0 0 auto;
}

.trade-history-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--glass-light);
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-compact);
  padding: 1px;
  overflow: hidden;
}

.recent-trades {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--glass-light);
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  padding: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-trades:hover {
  background: var(--glass-medium);
  border-color: var(--glass-border-hover);
}

.recent-trades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 2px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--glass-border);
}

.recent-title {
  font-size: 8px;
  font-weight: 600;
  color: var(--accent-blue);
  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: 6px;
  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;
}

.recent-trade-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 1px;
  padding: 1px;
  font-size: 6px;
  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: 10px;
  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: 10px;
  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: 8px;
  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);
  }
}

/* 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: 8px;
  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: 16px;
  white-space: nowrap;
  animation: profitGlow 1.5s ease-in-out;
}

/* Mobile Compact Optimization */
@media screen and (max-width: 768px) {
  body {
    font-size: 9px;
    padding: 1px;
  }
  
  .container {
    padding: 1px;
    gap: 1px;
    grid-template-rows: 24px auto 3px 28px 26px 24px 1fr;
  }
  
  .firstline {
    height: 24px;
  }
  
  #balance, #tradesTaken, #netProfit {
    font-size: 7px;
    line-height: 14px;
  }
  
  #netProfit {
    font-size: 20px;
  }
  
  .input-row, .input-row.four-columns {
    height: 24px;
  }
  
  .input-row.four-columns {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
  
  #symbolInput, #contractTypeInput, #stake_input, #takeprofit_input, 
  #maximum_losses, #stoploss_input, #barrier_input {
    font-size: 7px;
    padding: 1px 2px;
  }
  
  .market-selection-panel {
    height: 28px;
  }
  
  #combinedButton {
    width: 200px;
    height: 28px;
  }
  
  #evenSection, #oddSection {
    font-size: 6px;
  }
  
  th, td {
    font-size: 5px;
    padding: 0px 1px;
  }
  
  th {
    height: 10px;
  }
  
  #tradingSummary {
    font-size: 8px;
    max-height: 26px;
  }
  
  .startbutton {
    height: 24px;
  }
  
  .custom-edgeshape-transition {
    font-size: 7px;
    padding: 2px 6px;
  }
  
  .trade-history-container {
    max-height: 200px;
  }
  
  .recent-trades-list {
    max-height: 150px;
  }
}

@media screen and (max-width: 480px) {
  .popup {
    padding: 12px;
    max-width: 95vw;
    margin: 5px;
    border-radius: 10px;
  }
  
  #popupMessage {
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
  }
  
  .container1, .container2 {
    margin: 8px 0;
    padding: 8px;
    border-radius: 6px;
  }
  
  .close-btn-footer {
    padding: 8px 16px;
    font-size: 11px;
    border-radius: 6px;
  }
  
  .container2 button {
    padding: 6px 12px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  
  .a2a_button_whatsapp,
  .a2a_button_x,
  .a2a_button_twitter,
  .a2a_button_facebook,
  .share-button {
    width: 20px !important;
    height: 20px !important;
  }
  
  .container1 {
    gap: 4px !important;
  }
  
  .trade-history-container {
    max-height: 180px;
  }
  
  .recent-trades-list {
    max-height: 130px;
  }
  
  .input-row.four-columns {
    grid-template-columns: 1fr 0.7fr 0.7fr 0.8fr;
    font-size: var(--font-xs);
  }
}

@media screen and (max-width: 360px) {
  body {
    font-size: 8px;
  }
  
  .container {
    grid-template-rows: 22px auto 3px 26px 24px 22px 1fr;
  }
  
  .firstline {
    height: 22px;
  }

  #balance, #tradesTaken, #netProfit {
    font-size: 6px;
    line-height: 12px;
  }
  
  .input-row, .input-row.four-columns {
    height: 22px;
  }
  
  .input-row.four-columns {
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr;
  }
  
  #combinedButton {
    width: 180px;
    height: 26px;
  }
  
  #evenSection, #oddSection {
    font-size: 5px;
  }
  
  .custom-edgeshape-transition {
    font-size: 6px;
    padding: 1px 4px;
  }
}

/* Compact Trading Tables */
#openContractsTable {
  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);
  max-height: 45px;
}

/* Basic table styles for open contracts */
#openContractsTable th, #openContractsTable td {
  padding: 1px 2px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
}

#openContractsTable 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);
}

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

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

/* Trade result colors */
.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 */