@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 */
:root {
  --primary-blue: #1a365d;
  --secondary-blue: #2563eb;
  --accent-blue: #3b82f6;
  --light-blue: #60a5fa;
  --dark-navy: #0f172a;
  --slate: #1e293b;
  --light-slate: #475569;
  --white: #ffffff;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-light: rgba(59, 130, 246, 0.08);
  --glass-medium: rgba(59, 130, 246, 0.12);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --shadow-compact: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 12px rgba(59, 130, 246, 0.4);
  --shadow-active: 0 8px 20px rgba(59, 130, 246, 0.3);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.4);
  --gradient-primary: linear-gradient(135deg, #1a365d 0%, #2563eb 50%, #3b82f6 100%);
  --gradient-accent: linear-gradient(45deg, #3b82f6 0%, #60a5fa 100%);
  --gradient-black: linear-gradient(135deg, #000000 0%, #1f2937 50%, #374151 100%);
  --gradient-success: linear-gradient(135deg, #065f46 0%, #10b981 50%, #34d399 100%);
  --gradient-shimmer: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
}

* {
  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, #0f172a 0%, #1e293b 30%, #334155 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(59, 130, 246, 0.3),
    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(59, 130, 246, 0.3),
    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(59, 130, 246, 0.4);
  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(59, 130, 246, 0.5);
}

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