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

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1629;
  --bg-card: rgba(15, 22, 41, 0.85);
  --bg-glass: rgba(16, 24, 50, 0.6);

  --neon-blue: #00f0ff;
  --neon-cyan: #00f0ff;
  --neon-purple: #b46bff;
  --neon-pink: #ff006e;
  --neon-green: #00ff88;
  --neon-yellow: #ffcc00;
  --neon-red: #ff3355;
  --neon-orange: #ff6b35;

  --text-primary: #e0e7ff;
  --text-secondary: #8b95c7;
  --text-muted: #5a6491;

  --status-green: #00ff88;
  --status-yellow: #ffcc00;
  --status-red: #ff3355;
  --status-empty: #3b4270;

  --glow-blue: 0 0 20px rgba(0, 240, 255, 0.4);
  --glow-purple: 0 0 20px rgba(180, 107, 255, 0.4);
  --glow-pink: 0 0 20px rgba(255, 0, 110, 0.4);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
  --glow-yellow: 0 0 20px rgba(255, 204, 0, 0.4);
  --glow-red: 0 0 20px rgba(255, 51, 85, 0.4);

  --border-color: rgba(0, 240, 255, 0.15);
  --border-glow: rgba(0, 240, 255, 0.3);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  font-family: 'Rajdhani', 'Segoe UI', 'PingFang SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(180, 107, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 0, 110, 0.03) 0%, transparent 70%),
    var(--bg-primary);
}

/* Animated grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
  animation: gridShift 30s linear infinite;
}

@keyframes gridShift {
  0% { transform: perspective(500px) rotateX(0deg) scale(1.1); }
  100% { transform: perspective(500px) rotateX(0deg) scale(1.1); }
}

/* Scanline effect */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 240, 255, 0.01) 2%,
    transparent 3%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

#particleCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page-shell {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  z-index: 2;
}

/* Glow orbs */
.ambient {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  pointer-events: none;
  animation: orbFloat 12s ease-in-out infinite;
}

.ambient-left {
  top: -100px;
  left: -150px;
  background: radial-gradient(circle, var(--neon-purple), transparent 70%);
  animation-delay: 0s;
}

.ambient-right {
  bottom: -100px;
  right: -150px;
  background: radial-gradient(circle, var(--neon-blue), transparent 70%);
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.15); }
}

/* Main panel */
.embed-panel {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 60px rgba(0, 240, 255, 0.05),
    0 25px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.embed-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(0, 240, 255, 0.3),
    transparent 40%,
    transparent 60%,
    rgba(180, 107, 255, 0.3)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Corner decorations */
.embed-panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--neon-blue) 0%, transparent 15%) 0 0 / 80px 80px no-repeat,
    linear-gradient(225deg, var(--neon-purple) 0%, transparent 15%) 100% 0 / 80px 80px no-repeat,
    linear-gradient(45deg, var(--neon-pink) 0%, transparent 15%) 0 100% / 80px 80px no-repeat,
    linear-gradient(315deg, var(--neon-blue) 0%, transparent 15%) 100% 100% / 80px 80px no-repeat;
  opacity: 0.4;
  border-radius: var(--radius-xl);
}

.panel-header {
  display: flex;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: 'Orbitron', monospace;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 11px;
  font-weight: 700;
  text-shadow: var(--glow-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--neon-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
  animation: pulse 2s ease-in-out infinite;
}

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

h1 {
  margin: 0;
  font-family: 'Orbitron', 'PingFang SC', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--neon-blue) 50%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.3));
  letter-spacing: 0.05em;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 580px;
  line-height: 1.6;
  font-weight: 300;
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-stat {
  min-width: 160px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.hero-stat:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-blue);
  transform: translateY(-3px);
}

.hero-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

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

.hero-stat-primary::before {
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
}

.hero-stat-primary:hover {
  box-shadow: var(--glow-purple);
}

.hero-stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-stat-value {
  display: block;
  margin-top: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.hero-stat-primary .hero-stat-value {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

/* Meta card */
.meta-card {
  min-width: 260px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.meta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(180, 107, 255, 0.05), transparent 50%);
  pointer-events: none;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

.meta-row-strong span {
  color: var(--neon-blue);
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.meta-row-strong strong {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.meta-row + .meta-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0, 240, 255, 0.1);
}

.meta-row strong {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Toolbar */
.toolbar {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
}

.segmented button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

.segmented button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  transition: opacity 0.25s ease;
}

.segmented button span {
  position: relative;
  z-index: 1;
}

.segmented button:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.segmented button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.4),
    0 0 40px rgba(180, 107, 255, 0.2);
}

.segmented button.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  pointer-events: none;
}

/* State message */
.state-message {
  margin-top: 28px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  text-align: center;
  font-size: 14px;
}

.state-message.loading {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { border-color: var(--border-color); }
  50% { border-color: var(--neon-blue); }
}

.state-message.error {
  color: var(--neon-red);
  border-color: rgba(255, 51, 85, 0.3);
  background: rgba(255, 51, 85, 0.05);
}

/* Cards grid */
.cards {
  margin-top: 28px;
  display: grid;
  gap: 20px;
}

/* Status card */
.status-card {
  position: relative;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  overflow: hidden;
}

.status-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 240, 255, 0.1);
}

/* Card accent bar */
.status-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--status-empty), rgba(59, 66, 112, 0.2));
}

.status-card-green .status-accent {
  background: linear-gradient(180deg, var(--status-green), rgba(0, 255, 136, 0.2));
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.status-card-yellow .status-accent {
  background: linear-gradient(180deg, var(--status-yellow), rgba(255, 204, 0, 0.2));
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.status-card-red .status-accent {
  background: linear-gradient(180deg, var(--status-red), rgba(255, 51, 85, 0.2));
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.4);
  animation: redGlow 1.5s ease-in-out infinite;
}

@keyframes redGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 51, 85, 0.4); }
  50% { box-shadow: 0 0 25px rgba(255, 51, 85, 0.7); }
}

/* Card glow effect */
.status-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  background: radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.08), transparent 50%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.status-card:hover::before {
  opacity: 1;
}

.card-top {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Status dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-empty);
  box-shadow: 0 0 10px rgba(59, 66, 112, 0.5);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.3;
  animation: pingDot 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingDot {
  0% { transform: scale(1); opacity: 0.3; }
  75%, 100% { transform: scale(1.8); opacity: 0; }
}

.status-dot.green {
  background: var(--status-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 20px rgba(0, 255, 136, 0.4);
}

.status-dot.yellow {
  background: var(--status-yellow);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.8), 0 0 20px rgba(255, 204, 0, 0.4);
}

.status-dot.red {
  background: var(--status-red);
  box-shadow: 0 0 10px rgba(255, 51, 85, 0.8), 0 0 20px rgba(255, 51, 85, 0.4);
}

.model-name {
  margin: 0;
  font-family: 'Orbitron', 'PingFang SC', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-pill.green {
  color: #002611;
  background: rgba(0, 255, 136, 0.9);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.status-pill.yellow {
  color: #2a1800;
  background: rgba(255, 204, 0, 0.9);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.status-pill.red {
  color: #2a0008;
  background: rgba(255, 51, 85, 0.9);
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.4);
  animation: pillPulse 1.5s ease-in-out infinite;
}

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

.status-pill.empty {
  color: var(--text-muted);
  background: rgba(59, 66, 112, 0.5);
}

.card-subtitle {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 300;
}

/* Metric grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 18px;
  min-width: 220px;
}

.metric-label {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.metric-value {
  display: block;
  margin-top: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Timeline */
.timeline-block {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 240, 255, 0.08);
}

.timeline {
  display: grid;
  gap: 4px;
  align-items: end;
  min-height: 72px;
  width: 100%;
  overflow: visible;
}

.timeline-slot {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.timeline-bar {
  display: block;
  width: 100%;
  min-width: 6px;
  border-radius: 6px 6px 3px 3px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.timeline-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}

.timeline-slot:hover .timeline-bar {
  transform: translateY(-4px);
  filter: brightness(1.2) saturate(1.3);
}

.timeline-bar.green {
  background: linear-gradient(180deg, #00ff88, #00a35f);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.timeline-bar.yellow {
  background: linear-gradient(180deg, #ffcc00, #cc9900);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.timeline-bar.red {
  background: linear-gradient(180deg, #ff3355, #cc002a);
  box-shadow: 0 0 10px rgba(255, 51, 85, 0.3);
}

.timeline-bar.empty {
  background: linear-gradient(180deg, #2a3050, #1a2038);
  opacity: 0.5;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-muted);
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(10, 14, 26, 0.95);
  border: 1px solid var(--border-glow);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 240, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.tooltip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--neon-blue), transparent, var(--neon-purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.tooltip-title {
  margin: 0 0 12px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 12px;
}

.tooltip-row + .tooltip-row {
  margin-top: 10px;
}

.tooltip-row strong {
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
}

/* Responsive */
@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .embed-panel {
    padding: 20px;
  }

  .panel-header {
    flex-direction: column;
  }

  .hero-stats {
    width: 100%;
  }

  .hero-stat {
    flex: 1 1 0;
    min-width: 0;
  }

  .meta-card,
  .metric-grid {
    width: 100%;
    min-width: 0;
  }

  .meta-row-strong strong {
    font-size: 20px;
  }

  .card-top {
    flex-direction: column;
    gap: 16px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 26px;
  }
}

/* Loading animation */
@keyframes loadingDots {
  0%, 20% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.state-message.loading::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
