/* ===== FOREX SIGNAL PRO+ - CYBERPUNK THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&family=Exo+2:wght@300;400;600;700&display=swap');

:root {
  --cyber-bg: #020c14;
  --cyber-panel: #0a1628;
  --cyber-border: #00f5ff;
  --cyber-border2: #ff006e;
  --cyber-accent: #00f5ff;
  --cyber-accent2: #ff006e;
  --cyber-accent3: #ffe600;
  --cyber-green: #00ff88;
  --cyber-red: #ff2244;
  --cyber-text: #c8f0ff;
  --cyber-dim: #4a7a9b;
  --glow-cyan: 0 0 10px #00f5ff, 0 0 20px #00f5ff44;
  --glow-pink: 0 0 10px #ff006e, 0 0 20px #ff006e44;
  --glow-green: 0 0 10px #00ff88, 0 0 20px #00ff8844;
  --glow-red: 0 0 10px #ff2244, 0 0 20px #ff224444;
  --glow-yellow: 0 0 10px #ffe600, 0 0 20px #ffe60044;
}

#fsp-widget-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Exo 2', sans-serif;
}

#fsp-main-widget {
  background: var(--cyber-bg);
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Scanline overlay */
#fsp-main-widget::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,245,255,0.015) 2px,
    rgba(0,245,255,0.015) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Grid background */
#fsp-main-widget::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,245,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.fsp-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
.fsp-header {
  text-align: center;
  margin-bottom: 24px;
}

.fsp-title {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--cyber-accent3);
  text-shadow: var(--glow-yellow);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%,100% { text-shadow: var(--glow-yellow); }
  50% { text-shadow: 0 0 20px #ffe600, 0 0 40px #ffe600, 0 0 60px #ffe60066; }
}

.fsp-subtitle {
  font-family: 'Share Tech Mono', monospace;
  color: var(--cyber-dim);
  font-size: 0.75rem;
  letter-spacing: 4px;
  margin-top: 4px;
}

/* ── PAIR SELECTOR ── */
.fsp-pair-selector {
  background: var(--cyber-panel);
  border: 1px solid var(--cyber-border);
  border-radius: 4px;
  padding: 2px;
  margin-bottom: 20px;
  box-shadow: var(--glow-cyan);
  position: relative;
}

.fsp-pair-selector::before {
  content: '◈ CURRENCY PAIR';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--cyber-bg);
  padding: 0 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyber-accent);
  letter-spacing: 2px;
}

#fsp-pair-select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--cyber-accent);
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 16px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  letter-spacing: 2px;
}

#fsp-pair-select option {
  background: var(--cyber-panel);
  color: var(--cyber-text);
}

.fsp-pair-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyber-accent);
  font-size: 1.2rem;
  pointer-events: none;
}

/* ── MAIN SIGNAL PANEL ── */
.fsp-signal-panel {
  background: var(--cyber-panel);
  border: 1px solid var(--cyber-border2);
  border-radius: 4px;
  padding: 28px 20px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow-pink);
}

.fsp-signal-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyber-border2), transparent);
  animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Market status */
.fsp-market-status {
  text-align: center;
  margin-bottom: 12px;
}

.fsp-market-badge {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 3px;
  padding: 4px 12px;
  border-radius: 2px;
}

.fsp-market-badge.open {
  color: var(--cyber-green);
  border: 1px solid var(--cyber-green);
  box-shadow: var(--glow-green);
}

.fsp-market-badge.closed {
  color: var(--cyber-red);
  border: 1px solid var(--cyber-red);
  box-shadow: var(--glow-red);
  animation: closedBlink 1.5s ease-in-out infinite;
}

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

/* Signal display */
.fsp-signal-display {
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fsp-signal-text {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: 4px;
  line-height: 1;
  transition: all 0.3s ease;
}

.fsp-signal-text.PUT {
  color: var(--cyber-red);
  text-shadow: var(--glow-red), 0 0 40px rgba(255,34,68,0.5);
  animation: signalAppear 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}

.fsp-signal-text.CALL {
  color: var(--cyber-green);
  text-shadow: var(--glow-green), 0 0 40px rgba(0,255,136,0.5);
  animation: signalAppear 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}

.fsp-signal-text.WAIT {
  color: var(--cyber-dim);
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 3px;
  animation: none;
}

@keyframes signalAppear {
  0% { transform: scale(0.5) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.fsp-signal-arrow {
  font-size: 0.7em;
  margin-right: 8px;
}

.fsp-signal-price {
  font-family: 'Share Tech Mono', monospace;
  color: var(--cyber-text);
  font-size: 1rem;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* Countdown timer */
.fsp-countdown-wrap {
  width: 100%;
  margin-top: 20px;
}

.fsp-countdown-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyber-accent3);
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 8px;
}

.fsp-countdown-value {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--cyber-accent3);
  text-shadow: var(--glow-yellow);
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.fsp-countdown-bar-outer {
  width: 100%;
  height: 8px;
  background: #0a1a2a;
  border-radius: 4px;
  border: 1px solid var(--cyber-dim);
  overflow: hidden;
  position: relative;
}

.fsp-countdown-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--cyber-accent3), #ff8800);
  border-radius: 4px;
  transition: width 0.9s linear;
  box-shadow: 0 0 8px var(--cyber-accent3);
}

/* Pass rate */
.fsp-pass-rate {
  text-align: center;
  margin-top: 20px;
}

.fsp-pass-rate-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyber-dim);
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.fsp-pass-rate-value {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--cyber-green);
  text-shadow: var(--glow-green);
}

/* ── ACCURACY BAR ── */
.fsp-accuracy-panel {
  background: var(--cyber-panel);
  border: 1px solid var(--cyber-accent);
  border-radius: 4px;
  padding: 20px 16px 16px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--glow-cyan);
}

.fsp-accuracy-panel::before {
  content: '◈ SIGNAL ACCURACY';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--cyber-bg);
  padding: 0 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyber-accent);
  letter-spacing: 2px;
}

.fsp-accuracy-bar-outer {
  width: 100%;
  height: 28px;
  background: #0a1a2a;
  border-radius: 3px;
  border: 1px solid #1a3a5a;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

.fsp-accuracy-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0040ff, #00f5ff, #00ff88);
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.2);
}

.fsp-accuracy-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 100%;
  background: white;
  box-shadow: 0 0 6px white;
  border-radius: 0 3px 3px 0;
}

.fsp-accuracy-bar-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

.fsp-accuracy-stats {
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyber-dim);
}

.fsp-accuracy-stats span { color: var(--cyber-accent); }

/* ── ALGO GRID ── */
.fsp-algo-panel {
  background: var(--cyber-panel);
  border: 1px solid #1a3a5a;
  border-radius: 4px;
  padding: 20px 16px 16px;
  margin-bottom: 20px;
  position: relative;
}

.fsp-algo-panel::before {
  content: '◈ STRATEGY ANALYSIS [100 ALGORITHMS]';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--cyber-bg);
  padding: 0 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyber-accent);
  letter-spacing: 2px;
}

.fsp-algo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.fsp-algo-grid::-webkit-scrollbar {
  width: 4px;
}
.fsp-algo-grid::-webkit-scrollbar-track { background: #0a1628; }
.fsp-algo-grid::-webkit-scrollbar-thumb { background: var(--cyber-accent); border-radius: 2px; }

.fsp-algo-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  padding: 4px 3px;
  border-radius: 2px;
  text-align: center;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.fsp-algo-item.pass {
  color: var(--cyber-green);
  background: rgba(0,255,136,0.06);
  border-color: rgba(0,255,136,0.2);
}

.fsp-algo-item.fail {
  color: var(--cyber-red);
  background: rgba(255,34,68,0.06);
  border-color: rgba(255,34,68,0.2);
}

.fsp-algo-item.neutral {
  color: var(--cyber-dim);
  background: rgba(74,122,155,0.06);
  border-color: rgba(74,122,155,0.2);
}

.fsp-algo-item.running {
  color: var(--cyber-accent3);
  background: rgba(255,230,0,0.06);
  border-color: rgba(255,230,0,0.2);
  animation: algoRunning 0.8s ease-in-out infinite;
}

@keyframes algoRunning {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── SIGNAL HISTORY ── */
.fsp-history-panel {
  background: var(--cyber-panel);
  border: 1px solid #1a3a5a;
  border-radius: 4px;
  padding: 20px 16px 16px;
  margin-bottom: 20px;
  position: relative;
}

.fsp-history-panel::before {
  content: '◈ SIGNAL HISTORY';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--cyber-bg);
  padding: 0 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyber-accent);
  letter-spacing: 2px;
}

.fsp-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.fsp-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  padding: 6px 10px;
  border-radius: 2px;
  border-left: 3px solid;
}

.fsp-history-item.CALL {
  background: rgba(0,255,136,0.05);
  border-color: var(--cyber-green);
  color: var(--cyber-green);
}

.fsp-history-item.PUT {
  background: rgba(255,34,68,0.05);
  border-color: var(--cyber-red);
  color: var(--cyber-red);
}

.fsp-history-time {
  color: var(--cyber-dim);
  min-width: 55px;
}

.fsp-history-pair {
  color: var(--cyber-text);
  min-width: 65px;
}

.fsp-history-pct {
  margin-left: auto;
  font-weight: 700;
}

/* ── CHART ── */
.fsp-chart-panel {
  background: var(--cyber-panel);
  border: 1px solid var(--cyber-border);
  border-radius: 4px;
  padding: 20px 0 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow-cyan);
}

.fsp-chart-panel::before {
  content: '◈ LIVE CHART';
  position: absolute;
  top: 8px; left: 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyber-accent);
  letter-spacing: 2px;
}

.fsp-chart-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px 120px;
}

.fsp-chart-tab {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  padding: 4px 10px;
  border: 1px solid var(--cyber-dim);
  border-radius: 2px;
  color: var(--cyber-dim);
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.fsp-chart-tab:hover,
.fsp-chart-tab.active {
  border-color: var(--cyber-accent);
  color: var(--cyber-accent);
  box-shadow: var(--glow-cyan);
  background: rgba(0,245,255,0.05);
}

.fsp-tradingview-container {
  width: 100%;
  height: 400px;
}

/* ── LOADING ── */
.fsp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  color: var(--cyber-dim);
}

.fsp-loading-spinner {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(0,245,255,0.1);
  border-top-color: var(--cyber-accent);
  border-right-color: var(--cyber-accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fsp-loading-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: var(--cyber-accent);
  animation: loadingBlink 1s ease-in-out infinite;
}

@keyframes loadingBlink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── CORNER DECORATIONS ── */
.fsp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
}

.fsp-corner-tl { top: 4px; left: 4px; border-top: 2px solid var(--cyber-accent); border-left: 2px solid var(--cyber-accent); }
.fsp-corner-tr { top: 4px; right: 4px; border-top: 2px solid var(--cyber-accent); border-right: 2px solid var(--cyber-accent); }
.fsp-corner-bl { bottom: 4px; left: 4px; border-bottom: 2px solid var(--cyber-accent); border-left: 2px solid var(--cyber-accent); }
.fsp-corner-br { bottom: 4px; right: 4px; border-bottom: 2px solid var(--cyber-accent); border-right: 2px solid var(--cyber-accent); }

/* ── NOTIFICATION FLASH ── */
.fsp-signal-flash {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.fsp-signal-flash.show { opacity: 1; animation: flashLine 0.6s ease-out; }
.fsp-signal-flash.CALL { background: var(--cyber-green); box-shadow: var(--glow-green); }
.fsp-signal-flash.PUT  { background: var(--cyber-red);   box-shadow: var(--glow-red);   }

@keyframes flashLine {
  0%   { transform: scaleX(0); opacity: 1; }
  60%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
  #fsp-main-widget { padding: 12px; }
  .fsp-algo-grid { grid-template-columns: repeat(4, 1fr); }
  .fsp-tradingview-container { height: 300px; }
}
