/* ============================================
   WINGO STRATEGY DASHBOARD - DESIGN SYSTEM
   Premium Dark Glassmorphism Theme
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #06061a;
  --bg-secondary: #0c0c2a;
  --bg-card: rgba(14, 14, 42, 0.75);
  --bg-card-active: rgba(20, 20, 60, 0.9);
  --bg-input: rgba(20, 20, 50, 0.6);

  --border-default: rgba(80, 80, 160, 0.15);
  --border-hover: rgba(100, 100, 200, 0.3);
  --border-active: rgba(56, 189, 248, 0.5);

  --text-primary: #e4e4f8;
  --text-secondary: #9090bb;
  --text-muted: #5a5a80;
  --text-accent: #38bdf8;

  --color-red: #FF4757;
  --color-red-glow: rgba(255, 71, 87, 0.4);
  --color-green: #2ED573;
  --color-green-glow: rgba(46, 213, 115, 0.4);
  --color-violet: #A855F7;
  --color-violet-glow: rgba(168, 85, 247, 0.4);

  --signal-red: #FF4757;
  --signal-green: #2ED573;
  --signal-glow: rgba(255, 71, 87, 0.6);

  --color-amber: #F59E0B;
  --color-blue: #3B82F6;
  --color-cyan: #22D3EE;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
}

/* ---------- Signal Banner ---------- */
.signal-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 20px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  animation: signalPulse 1.5s ease-in-out infinite;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.signal-banner.signal-red {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.92), rgba(200, 30, 50, 0.92));
  box-shadow: 0 4px 30px rgba(255, 71, 87, 0.5);
}

.signal-banner.signal-green {
  background: linear-gradient(135deg, rgba(46, 213, 115, 0.92), rgba(20, 160, 80, 0.92));
  box-shadow: 0 4px 30px rgba(46, 213, 115, 0.5);
}

.signal-banner.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.signal-banner.signal-hunting {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.92));
  box-shadow: 0 4px 30px rgba(245, 158, 11, 0.5);
}

.signal-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.signal-icon {
  font-size: 1.4rem;
  animation: signalBounce 0.8s ease-in-out infinite alternate;
}

.signal-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.signal-main-text {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-sub-text {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.85;
}

@keyframes signalPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

@keyframes signalBounce {
  from { transform: scale(1); }
  to { transform: scale(1.2); }
}

/* ---------- App Header ---------- */
.app-header {
  padding: 28px 24px 16px;
  text-align: center;
  position: relative;
}

.app-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #38bdf8, #a855f7, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.header-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.status-badge.watching {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-badge.signal-active {
  background: rgba(255, 71, 87, 0.15);
  color: var(--color-red);
  border: 1px solid rgba(255, 71, 87, 0.3);
  animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.hunting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: huntingPulse 1.5s ease-in-out infinite;
}

@keyframes huntingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.15); }
}

.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: dotBlink 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(255, 71, 87, 0.15); }
}

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

.update-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Countdown Timer ---------- */
.countdown-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.3s ease;
}

.countdown-timer::before {
  content: '⏱';
  font-size: 0.75rem;
}

.countdown-timer.countdown-soon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
  border-color: rgba(245, 158, 11, 0.35);
}

.countdown-timer.countdown-urgent {
  background: rgba(255, 71, 87, 0.18);
  color: var(--color-red);
  border-color: rgba(255, 71, 87, 0.45);
  animation: countdownPulse 0.8s ease-in-out infinite;
  font-size: 0.9rem;
}

@keyframes countdownPulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 14px 4px rgba(255, 71, 87, 0.2);
    transform: scale(1.05);
  }
}

/* ---------- Refresh Progress Bar ---------- */
.refresh-bar-container {
  width: 100%;
  max-width: 800px;
  margin: 10px auto 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.refresh-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-violet));
  border-radius: 2px;
  transition: width 1s linear;
  width: 0%;
}

/* ---------- Strategy Panel ---------- */
.strategy-panel {
  max-width: 800px;
  margin: 16px auto;
  padding: 0 16px;
}

.strategy-info {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.strategy-info > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.strategy-info .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 500;
}

.strategy-info .value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-accent);
}

.strategy-info .value.watching-mode {
  color: var(--color-cyan);
}

.strategy-info .value.signal-mode {
  color: var(--color-red);
  animation: textPulse 1.5s ease-in-out infinite;
}

.strategy-info .value.reset-mode {
  color: var(--color-amber);
}

.strategy-info .value.hunting-mode {
  color: var(--color-amber);
  animation: textPulse 1.2s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.strategy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 0 4px;
}

.control-button {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(56, 189, 248, 0.14));
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.control-button:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.18);
}

.control-button:active {
  transform: translateY(0);
}

.strategy-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

/* ---------- Sections Grid ---------- */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

@media (max-width: 600px) {
  .sections-grid {
    grid-template-columns: 1fr;
  }

  .strategy-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .strategy-hint {
    text-align: left;
  }
}

/* ---------- Section Card ---------- */
.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-violet));
  opacity: 0.6;
  transition: opacity var(--transition-normal);
}

.section-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-card.active {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow), 0 0 40px rgba(56, 189, 248, 0.1);
}

.section-card.active::before {
  opacity: 1;
  height: 3px;
  animation: borderGlow 2s ease-in-out infinite;
}

.section-card.signal-triggered {
  border-color: rgba(255, 71, 87, 0.5);
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.15);
  animation: cardPulse 2s ease-in-out infinite;
}

.section-card.signal-triggered::before {
  background: linear-gradient(90deg, var(--color-red), var(--color-amber));
  opacity: 1;
}

.section-card.paused {
  opacity: 0.45;
  filter: grayscale(0.3);
}

.section-card.hunting {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.section-card.hunting::before {
  background: linear-gradient(90deg, var(--color-amber), var(--color-cyan));
  opacity: 1;
  animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 -2px 8px rgba(56, 189, 248, 0.3); }
  50% { box-shadow: 0 -2px 16px rgba(56, 189, 248, 0.5); }
}

@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 71, 87, 0.1); }
  50% { box-shadow: 0 0 40px rgba(255, 71, 87, 0.25); }
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-status {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.section-status.status-watching {
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-cyan);
}

.section-status.status-pattern {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber);
}

.section-status.status-signal {
  background: rgba(255, 71, 87, 0.15);
  color: var(--color-red);
  animation: statusPulse 2s ease-in-out infinite;
}

.section-status.status-profit {
  background: rgba(46, 213, 115, 0.12);
  color: var(--color-green);
}

.section-status.status-paused {
  background: rgba(90, 90, 128, 0.12);
  color: var(--text-muted);
}

.section-status.status-hunting {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber);
  animation: huntingPulse 1.5s ease-in-out infinite;
}

/* ---------- Color Trend (dots) ---------- */
.color-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  min-height: 60px;
  align-items: center;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
  flex-shrink: 0;
}

.color-dot.red {
  background: var(--color-red);
  box-shadow: 0 0 8px var(--color-red-glow);
}

.color-dot.green {
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green-glow);
}

.color-dot.violet {
  background: var(--color-violet);
  box-shadow: 0 0 8px var(--color-violet-glow);
}

.color-dot.red-violet {
  background: linear-gradient(135deg, var(--color-red) 50%, var(--color-violet) 50%);
  box-shadow: 0 0 8px var(--color-violet-glow);
}

.color-dot.green-violet {
  background: linear-gradient(135deg, var(--color-green) 50%, var(--color-violet) 50%);
  box-shadow: 0 0 8px var(--color-violet-glow);
}

.color-dot:hover {
  transform: scale(1.3);
  z-index: 2;
}

.color-dot.latest {
  width: 26px;
  height: 26px;
  font-size: 0.6rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  animation: latestDotPulse 2s ease-in-out infinite;
}

@keyframes latestDotPulse {
  0%, 100% { box-shadow: 0 0 8px var(--color-green-glow); }
  50% { box-shadow: 0 0 16px var(--color-green-glow); }
}

.color-dot.pattern-highlight {
  border: 2px solid var(--color-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* ---------- Section Info ---------- */
.section-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.pattern-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.pattern-status.pattern-found {
  color: var(--color-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.pattern-status.no-pattern {
  color: var(--text-muted);
}

.bet-info {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.bet-info.bet-red {
  color: var(--color-red);
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.bet-info.bet-green {
  color: var(--color-green);
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.2);
}

.bet-info.bet-none {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
}

/* ---------- Section Stats ---------- */
.section-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  flex: 1;
}

.stat.win {
  color: var(--color-green);
  background: rgba(46, 213, 115, 0.08);
}

.stat.loss {
  color: var(--color-red);
  background: rgba(255, 71, 87, 0.08);
}

.stat.streak {
  color: var(--color-amber);
  background: rgba(245, 158, 11, 0.08);
}

/* ---------- Activity Log ---------- */
.log-section {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.log-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 4px;
}

.activity-log {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 100, 200, 0.2) transparent;
}

.activity-log::-webkit-scrollbar {
  width: 5px;
}

.activity-log::-webkit-scrollbar-track {
  background: transparent;
}

.activity-log::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 200, 0.2);
  border-radius: 4px;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.5;
  animation: logSlideIn 0.3s ease-out;
  transition: background var(--transition-fast);
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.03);
}

.log-entry + .log-entry {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.log-time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 58px;
}

.log-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
}

.log-text {
  color: var(--text-secondary);
  word-break: break-word;
}

.log-entry.log-signal {
  background: rgba(255, 71, 87, 0.06);
  border-left: 2px solid var(--color-red);
}

.log-entry.log-win {
  background: rgba(46, 213, 115, 0.05);
}

.log-entry.log-loss {
  background: rgba(255, 71, 87, 0.04);
}

.log-entry.log-pattern {
  background: rgba(245, 158, 11, 0.04);
}

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

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

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

/* ---------- Loading Overlay ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  gap: 16px;
  transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ---------- Bet History Ribbon ---------- */
.bet-history {
  display: flex;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bet-result-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: white;
}

.bet-result-dot.result-win {
  background: var(--color-green);
}

.bet-result-dot.result-loss {
  background: var(--color-red);
}

/* ---------- Period Info ---------- */
.period-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.text-red { color: var(--color-red); }
.text-green { color: var(--color-green); }
.text-violet { color: var(--color-violet); }
.text-amber { color: var(--color-amber); }
.text-cyan { color: var(--color-cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.4rem;
  }

  .strategy-info {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .strategy-info > div {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .section-card {
    padding: 12px;
  }

  .color-dot {
    width: 18px;
    height: 18px;
    font-size: 0.5rem;
  }

  .color-dot.latest {
    width: 22px;
    height: 22px;
  }
}

/* ---------- Fade-in animation for cards ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-card {
  animation: fadeInUp 0.5s ease-out backwards;
}

.section-card:nth-child(1) { animation-delay: 0.1s; }
.section-card:nth-child(2) { animation-delay: 0.2s; }
.section-card:nth-child(3) { animation-delay: 0.3s; }
.section-card:nth-child(4) { animation-delay: 0.4s; }

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.toast-error {
  background: rgba(255, 71, 87, 0.9);
  color: white;
}

.toast.toast-success {
  background: rgba(46, 213, 115, 0.9);
  color: white;
}

.toast.toast-info {
  background: rgba(56, 189, 248, 0.9);
  color: white;
}

/* ---------- In-Card Trade Banner ---------- */
.trade-card-banner {
  margin: 8px -16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  animation: tradeBannerSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trade-card-banner.hidden {
  display: none !important;
}

/* Red mode */
.trade-card-banner.banner-mode-red {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.18), rgba(255, 71, 87, 0.06));
  border-top-color: rgba(255, 71, 87, 0.25);
  border-bottom-color: rgba(255, 71, 87, 0.25);
}

/* Green mode */
.trade-card-banner.banner-mode-green {
  background: linear-gradient(135deg, rgba(46, 213, 115, 0.18), rgba(46, 213, 115, 0.06));
  border-top-color: rgba(46, 213, 115, 0.25);
  border-bottom-color: rgba(46, 213, 115, 0.25);
}

/* Animated glow bar at top of banner */
.trade-card-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-red), var(--color-amber), transparent);
  background-size: 200% 100%;
  animation: bannerGlowMove 2s linear infinite;
}

.trade-card-banner.banner-mode-green::before {
  background: linear-gradient(90deg, transparent, var(--color-green), var(--color-cyan), transparent);
  background-size: 200% 100%;
}

@keyframes bannerGlowMove {
  from { background-position: -200% 0%; }
  to { background-position: 200% 0%; }
}

@keyframes tradeBannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

/* Banner icon */
.trade-banner-icon {
  font-size: 1.8rem;
  animation: tradeBannerIconPulse 1s ease-in-out infinite alternate;
  flex-shrink: 0;
}

@keyframes tradeBannerIconPulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Banner content */
.trade-banner-content {
  flex: 1;
  min-width: 0;
}

.trade-banner-title {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  animation: tradeTitleFlash 1.5s ease-in-out infinite;
}

@keyframes tradeTitleFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.trade-banner-color {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: tradeColorPulse 2s ease-in-out infinite;
}

.trade-banner-color.banner-red {
  color: var(--color-red);
  text-shadow: 0 0 16px rgba(255, 71, 87, 0.4);
}

.trade-banner-color.banner-green {
  color: var(--color-green);
  text-shadow: 0 0 16px rgba(46, 213, 115, 0.4);
}

@keyframes tradeColorPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.trade-banner-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* Signal-triggered card enhancements for green */
.section-card.signal-triggered.signal-green {
  border-color: rgba(46, 213, 115, 0.5);
  box-shadow: 0 0 30px rgba(46, 213, 115, 0.15);
  animation: cardPulseGreen 2s ease-in-out infinite;
}

.section-card.signal-triggered.signal-green::before {
  background: linear-gradient(90deg, var(--color-green), var(--color-cyan));
  opacity: 1;
}

@keyframes cardPulseGreen {
  0%, 100% { box-shadow: 0 0 20px rgba(46, 213, 115, 0.1); }
  50% { box-shadow: 0 0 40px rgba(46, 213, 115, 0.25); }
}

/* ============================================
   UPGRADE ADDITIONS - STRATEGY SELECTOR & TOGGLES
   ============================================ */

.strategy-selector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 16px;
  background: rgba(14, 14, 42, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(80, 80, 160, 0.1);
}

.strategy-select-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.strategy-select-dropdown {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239090bb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

.strategy-select-dropdown:hover,
.strategy-select-dropdown:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* iOS Toggle Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(90, 90, 128, 0.2);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: rgba(46, 213, 115, 0.15);
  border-color: rgba(46, 213, 115, 0.4);
}

.switch-toggle input:checked + .switch-slider::before {
  background-color: var(--color-green);
  transform: translateX(18px);
}

/* ============ SNIPER LOSS TRACKER ============ */

.sniper-tracker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.4s ease;
}

.sniper-tracker.tracker-ready {
  background: rgba(46, 213, 115, 0.08);
  border-color: rgba(46, 213, 115, 0.25);
  box-shadow: 0 0 12px rgba(46, 213, 115, 0.1);
}

.sniper-tracker.tracker-live {
  background: rgba(255, 165, 2, 0.1);
  border-color: rgba(255, 165, 2, 0.3);
  box-shadow: 0 0 16px rgba(255, 165, 2, 0.15);
  animation: trackerPulse 2s ease-in-out infinite;
}

@keyframes trackerPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 165, 2, 0.1); }
  50% { box-shadow: 0 0 20px rgba(255, 165, 2, 0.25); }
}

.sniper-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sniper-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sniper-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sniper-dot.filled {
  background: var(--color-red);
  border-color: rgba(255, 71, 87, 0.6);
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
  animation: dotFill 0.4s ease-out;
}

.sniper-dot.filled.ready {
  background: var(--color-green);
  border-color: rgba(46, 213, 115, 0.6);
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
  animation: dotReady 0.6s ease-out;
}

@keyframes dotFill {
  0% { transform: scale(0.5); opacity: 0.3; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes dotReady {
  0% { transform: scale(0.8); }
  40% { transform: scale(1.4); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.sniper-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin-left: auto;
  min-width: 32px;
  text-align: right;
}

.sniper-count.sniper-ready {
  color: var(--color-green);
  text-shadow: 0 0 8px rgba(46, 213, 115, 0.5);
  animation: countPulse 1.5s ease-in-out infinite;
}

.sniper-count.sniper-live {
  color: #ffa502;
  text-shadow: 0 0 10px rgba(255, 165, 2, 0.6);
  font-size: 0.8rem;
  animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============ ENHANCED SIGNAL HIGHLIGHTING ============ */

.section-card.signal-triggered {
  border: 2px solid;
  animation: signalPulse 1.5s ease-in-out infinite;
  transform: scale(1.01);
  z-index: 2;
}

.section-card.signal-green {
  border-color: var(--color-green);
  box-shadow: 0 0 20px rgba(0, 200, 83, 0.4), 0 0 40px rgba(0, 200, 83, 0.15), inset 0 0 15px rgba(0, 200, 83, 0.05);
}

.section-card.signal-red {
  border-color: var(--color-red);
  box-shadow: 0 0 20px rgba(255, 61, 87, 0.4), 0 0 40px rgba(255, 61, 87, 0.15), inset 0 0 15px rgba(255, 61, 87, 0.05);
}

@keyframes signalPulse {
  0%, 100% { transform: scale(1.01); }
  50% { transform: scale(1.02); }
}

.section-card.virtual-tracking {
  border: 2px solid rgba(245, 158, 11, 0.75);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.22), inset 0 0 18px rgba(245, 158, 11, 0.06);
}

.section-card.virtual-tracking::before {
  background: linear-gradient(90deg, var(--color-amber), var(--color-cyan));
  opacity: 1;
}

.section-card.virtual-ready-highlight {
  border: 2px solid rgba(46, 213, 115, 0.95);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.28),
    0 0 34px rgba(46, 213, 115, 0.38),
    0 0 58px rgba(34, 211, 238, 0.14),
    inset 0 0 22px rgba(46, 213, 115, 0.1);
  animation: readyCardPulse 1.35s ease-in-out infinite;
}

.section-card.virtual-ready-highlight::before {
  height: 5px;
  background: linear-gradient(90deg, var(--color-green), var(--color-cyan), var(--color-green));
  opacity: 1;
}

@keyframes readyCardPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(34, 211, 238, 0.24),
      0 0 24px rgba(46, 213, 115, 0.28),
      0 0 42px rgba(34, 211, 238, 0.1),
      inset 0 0 18px rgba(46, 213, 115, 0.08);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(34, 211, 238, 0.36),
      0 0 42px rgba(46, 213, 115, 0.46),
      0 0 64px rgba(34, 211, 238, 0.18),
      inset 0 0 24px rgba(46, 213, 115, 0.12);
  }
}

.section-card.profit-locked {
  border: 2px solid rgba(46, 213, 115, 0.7);
  background: rgba(12, 42, 28, 0.78);
  box-shadow: 0 0 24px rgba(46, 213, 115, 0.22), inset 0 0 18px rgba(46, 213, 115, 0.08);
}

.section-card.profit-locked::before {
  background: linear-gradient(90deg, var(--color-green), var(--color-cyan));
  opacity: 1;
}

.section-card.active {
  border: 1px solid rgba(0, 200, 83, 0.5);
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.1);
}

/* ============================================
   DATABASE STATUS BAR
   ============================================ */

.db-status-section {
  margin: 12px 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.db-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.db-status-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-primary);
}

.db-icon {
  font-size: 16px;
}

.db-total-badge {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-blue));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  min-width: 24px;
  text-align: center;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}

.db-status-sync {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.db-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green-glow);
  animation: db-pulse 2s ease-in-out infinite;
}

@keyframes db-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.db-cat-counts {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.db-cat-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.db-cat-chip.db-cat-p {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-accent);
}

.db-cat-chip.db-cat-s {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--color-amber);
}

.db-cat-chip.db-cat-b {
  border-color: rgba(255, 71, 87, 0.3);
  color: var(--color-red);
}

.db-cat-chip.db-cat-e {
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--color-violet);
}

.db-actions {
  display: flex;
  gap: 8px;
}

.db-action-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.db-action-btn:active {
  transform: scale(0.96);
}

.db-action-btn.db-export {
  border-color: rgba(46, 213, 115, 0.3);
}

.db-action-btn.db-export:hover,
.db-action-btn.db-export:active {
  background: rgba(46, 213, 115, 0.15);
  color: var(--color-green);
  border-color: rgba(46, 213, 115, 0.5);
}

.db-action-btn.db-import {
  border-color: rgba(56, 189, 248, 0.3);
}

.db-action-btn.db-import:hover,
.db-action-btn.db-import:active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-accent);
  border-color: rgba(56, 189, 248, 0.5);
}

.db-action-btn.db-clear {
  border-color: rgba(255, 71, 87, 0.3);
}

.db-action-btn.db-clear:hover,
.db-action-btn.db-clear:active {
  background: rgba(255, 71, 87, 0.15);
  color: var(--color-red);
  border-color: rgba(255, 71, 87, 0.5);
}

.db-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
