/**
 * DosiPlot v5.0 — Simulation Monte Carlo Interactive
 * © 2025 Pr. Yassine OULHOUQ
 * Université Mohammed Premier (UMP) — Oujda, Maroc
 * Module: Phantom — Phantom Canvas, MC Info Bar, Progress Bar, Stats Display
 */

/* ============================================
   PHANTOM BOX
   ============================================ */
.phantom-box {
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.phantom-box:hover {
  border-color: var(--border2);
}

/* ============================================
   PHANTOM TITLE
   ============================================ */
.phantom-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--t2);
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   PHANTOM CANVAS
   ============================================ */
.phantom-canvas {
  flex: 1;
  border-radius: 10px;
  background: var(--bg0);
  border: 1px solid var(--border);
  display: block;
  transition: border-color 0.3s;
}

.phantom-canvas:hover {
  border-color: var(--border2);
}

/* Canvas overlay for interaction hints */
.phantom-canvas-wrapper {
  position: relative;
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
}

.phantom-canvas-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--t3);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.phantom-canvas-wrapper:hover .phantom-canvas-hint {
  opacity: 1;
}

/* ============================================
   MC INFO BAR
   ============================================ */
.mc-info {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.3s;
}

/* MC Status Message */
.mc-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--blue);
  min-height: 14px;
  margin-bottom: 5px;
  font-weight: 500;
  transition: color 0.3s;
}

.mc-msg.elec {
  color: var(--amber);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.mc-bar-w {
  height: 6px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
  border: 1px solid rgba(100, 160, 255, 0.08);
  position: relative;
}

.mc-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.mc-bar.photon {
  background: linear-gradient(90deg, #0066cc, var(--blue), var(--cyan));
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.3);
}

.mc-bar.electron {
  background: linear-gradient(90deg, #cc7700, var(--amber), #ffcc00);
  box-shadow: 0 0 10px rgba(255, 176, 32, 0.3);
}

/* Progress bar pulse glow during simulation */
.mc-bar.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  bottom: -2px;
  width: 20px;
  border-radius: 3px;
  animation: progressGlow 1.5s ease-in-out infinite;
}

.mc-bar.photon.active::after {
  background: radial-gradient(circle at right, rgba(0, 180, 255, 0.6), transparent);
}

.mc-bar.electron.active::after {
  background: radial-gradient(circle at right, rgba(255, 176, 32, 0.6), transparent);
}

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

/* ============================================
   MC STATS DISPLAY
   ============================================ */
.mc-stats {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--t3);
  font-weight: 600;
}

.mc-stats span {
  transition: color 0.3s;
}

/* Stats highlights */
.mc-stats .stat-value {
  color: var(--t2);
}

.mc-stats .stat-photon {
  color: var(--blue);
}

.mc-stats .stat-electron {
  color: var(--amber);
}

/* ============================================
   PHANTOM VISUALIZATION STATES
   ============================================ */

/* Idle / waiting state */
.phantom-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--t3);
  text-align: center;
}

.phantom-idle-icon {
  font-size: 48px;
  opacity: 0.2;
  margin-bottom: 12px;
}

.phantom-idle-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* Running simulation glow border */
.phantom-box.simulating {
  border-color: rgba(0, 180, 255, 0.3);
  box-shadow: var(--shadow), 0 0 20px rgba(0, 180, 255, 0.08);
}

.phantom-box.simulating.electron-sim {
  border-color: rgba(255, 176, 32, 0.3);
  box-shadow: var(--shadow), 0 0 20px rgba(255, 176, 32, 0.08);
}
