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

/* Ultra-Sophisticated Over/Under Trading Platform Variables */
/* TOPGRADE Dark Luxury Fintech Theme */
:root {
  /* Backgrounds */
  --bg-primary: #080808;
  --bg-secondary: #101010;
  --bg-tertiary: #181818;

  /* Cards and surfaces */
  --surface-primary: #202020;
  --surface-secondary: #303030;
  --surface-glass: rgba(32, 32, 32, 0.75);
  --card-glass: rgba(28, 28, 28, 0.70);

  /* Gold palette */
  --gold-dark: #806020;
  --gold-bronze: #A08030;
  --gold-primary: #B9A05A;
  --gold-accent: #C8A64E;
  --gold-light: #D8BD7A;
  --gold-highlight: #E5D3A0;

  /* Typography */
  --text-primary: #FFFFFF;
  --text-secondary: #BDBDBD;
  --text-muted: #777777;

  /* Borders */
  --border-primary: rgba(255, 255, 255, 0.10);
  --border-secondary: #303030;
  --border-gold: rgba(200, 166, 78, 0.35);

  /* Effects */
  --gold-glow: 0 0 20px rgba(200, 166, 78, 0.20);
  --card-blur: blur(16px);

  /* Gradients */
  --gold-gradient: linear-gradient(110deg, #806020, #B99A4A, #D8BD7A);
  --gold-gradient-hover: linear-gradient(110deg, #A08030, #C8A64E, #E5D3A0);
  --background-gradient: linear-gradient(135deg, #080808, #111111, #080808);

  /* Legacy variable compatibility mappings */
  --primary-blue: #C8A64E;
  --secondary-blue: #B9A05A;
  --accent-blue: #D8BD7A;
  --light-blue: #E5D3A0;
  --dark-navy: #080808;
  --navy: #101010;
  --slate: #202020;
  --light-color: #FFFFFF;
  --gray-color: #BDBDBD;
  --glass-white: rgba(255, 255, 255, 0.05);
  --glass-blue: rgba(200, 166, 78, 0.12);
  --glass-border: rgba(255, 255, 255, 0.10);
  --blue-gradient: linear-gradient(110deg, #806020, #B99A4A, #D8BD7A);
  --primary-color: #C8A64E;
  --secondary-color: #B9A05A;
  --accent-color: #D8BD7A;
  --background-color: #080808;
  --form-background: rgba(16, 16, 16, 0.85);
  --primary-text: #FFFFFF;
  --secondary-text: #BDBDBD;
  --input-background: #181818;
  --input-border: #303030;
  --accent-glow: rgba(200, 166, 78, 0.30);
  --info-panel-bg: linear-gradient(160deg, rgba(32, 32, 32, 0.95), rgba(8, 8, 8, 0.98) 70%);
  --success-color: #10b981;
  --error-color: #ef4444;
}

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

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #080808 0%, #101010 30%, #202020 60%, #475569 100%);
  color: var(--white);
  font-size: 10px;
  position: relative;
}

/* Static Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 40% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

.container {
  position: relative;
  width: 100%;
  height: 100vh;
  padding: 4px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Header */
.input-container {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--glass-light);
  backdrop-filter: blur(15px) saturate(1.3);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  box-shadow: 
    var(--shadow-compact),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.input-container:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 
    var(--shadow-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Select Styling */
#symbolInput {
  flex: 1;
  min-width: 100px;
  padding: 4px 6px;
  font-size: 8px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--dark-navy) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid var(--slate);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#symbolInput:hover, #symbolInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 
    0 0 0 2px rgba(200, 166, 78, 0.30),
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    var(--shadow-glow);
}

/* Input Styling */
#digitsInput {
  width: 50px;
  padding: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--dark-navy) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid var(--slate);
  border-radius: 6px;
  text-align: center;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
}

#digitsInput:hover, #digitsInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 
    0 0 0 2px rgba(200, 166, 78, 0.30),
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    var(--shadow-glow);
}

/* Button Styling */
.small-buttons-container,
.medium-buttons-container {
  display: flex;
  gap: 2px;
}

.small-button,
.medium-button {
  padding: 3px 6px;
  font-size: 7px;
  font-weight: 700;
  color: var(--white);
  background: var(--gradient-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 
    var(--shadow-compact),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.small-button:hover,
.medium-button:hover {
  box-shadow: var(--shadow-hover);
  background: var(--gradient-accent);
}

.small-button.clicked,
.medium-button.clicked {
  background: var(--gradient-success);
}

/* Price Display */
#priceDisplay {
  font-size: 9px;
  font-weight: 700;
  color: var(--light-blue);
  text-align: center;
  padding: 3px;
  background: var(--glass-light);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  margin: 2px 0;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    var(--shadow-compact);
  position: relative;
  overflow: hidden;
}

/* Last Digits Display */
#lastDigitsList {
  font-size: 8px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  padding: 4px;
  background: var(--glass-light);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  margin: 2px 0;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    var(--shadow-compact);
  position: relative;
  overflow: hidden;
}

/* Chart Container */
.chart-container {
  display: flex;
  width: 100%;
  flex: 1;
  gap: 2px;
  min-height: 0;
  margin: 2px 0;
}

.chart-container canvas {
  flex: 1;
  background: var(--glass-light);
  backdrop-filter: blur(15px) saturate(1.2);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  padding: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    var(--shadow-compact),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: crosshair;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--white);
}

.chart-container canvas:hover {
  filter: brightness(1.1) contrast(1.05);
  box-shadow: var(--shadow-hover);
}

/* Line Chart Styling */
#lineChart {
  width: 100% !important;
  height: auto !important;
  max-height: 120px;
  background: var(--glass-light);
  backdrop-filter: blur(15px) saturate(1.2);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  padding: 4px;
  margin: 2px 0;
  box-shadow: 
    var(--shadow-compact),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: crosshair;
}

#lineChart:hover {
  filter: brightness(1.1) contrast(1.05);
  box-shadow: var(--shadow-hover);
}

/* Table Styling */
table {
  width: 100%;
  margin: 2px 0;
  background: var(--glass-light);
  backdrop-filter: blur(15px) saturate(1.2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 
    var(--shadow-compact),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 7px;
}

thead {
  background: var(--gradient-primary);
}

th {
  padding: 4px;
  font-size: 7px;
  font-weight: 700;
  color: var(--white);
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

td {
  padding: 3px 4px;
  font-size: 6px;
  font-weight: 500;
  color: var(--white);
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

tbody tr:hover {
  background: var(--glass-medium);
}

/* Progress Bar */
.progress {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  width: 2px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
}

.bar {
  display: block;
  height: 0;
  width: 100%;
  background: var(--gradient-primary);
  box-shadow: 
    0 0 8px rgba(59, 130, 246, 0.8),
    0 0 16px rgba(200, 166, 78, 0.35);
  position: relative;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--dark-navy);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(200, 166, 78, 0.40);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-accent);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

/* Select Options */
select option {
  background: var(--dark-navy);
  color: var(--white);
  padding: 4px;
  font-size: 8px;
  font-weight: 600;
}

/* Mobile Optimization for Iframe */
@media screen and (max-width: 480px) {
  .container {
    padding: 2px;
  }

  .input-container {
    padding: 4px;
    gap: 2px;
  }
  
  #symbolInput {
    font-size: 7px;
    padding: 3px 4px;
    min-width: 80px;
  }

  #digitsInput {
    width: 40px;
    font-size: 7px;
    padding: 3px;
}

  .small-button,
  .medium-button {
    padding: 2px 4px;
    font-size: 6px;
  }
  
  #priceDisplay {
    font-size: 8px;
    padding: 2px;
  }
  
  #lastDigitsList {
    font-size: 7px;
    padding: 3px;
  }
  
  .chart-container canvas,
  #lineChart {
    padding: 2px;
  }
  
  th {
    padding: 3px;
    font-size: 6px;
  }
  
  td {
    padding: 2px 3px;
    font-size: 5px;
  }
}

/* Extra Small Screens */
@media screen and (max-width: 360px) {
  .container {
    padding: 1px;
  }
  
  .input-container {
    padding: 2px;
  }
  
  #symbolInput {
    font-size: 6px;
    min-width: 60px;
  }
  
  #digitsInput {
    width: 30px;
    font-size: 6px;
  }
  
  .small-button,
  .medium-button {
    padding: 1px 3px;
    font-size: 5px;
  }

  #lastDigitsList {
    font-size: 6px;
}
}

/* Hide unused elements for space efficiency */
#digitTable,
#percentageTable {
  display: none !important;
}