/* ============================================================
   EVOLVE OS — CORE UI STYLESHEET
   (Orb, panel, states, hints, harness loader, sandbox)
   ============================================================ */

/* ============================================================
   1. BASE RESET
   ============================================================ */
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

/* ============================================================
   2. ORB (LAUNCHER)
   ============================================================ */
#evolve-orb {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;

  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 60%),
    url('/assets/icons/evolve-logo.svg') center center no-repeat;
  background-size: 60% 60%;

  box-shadow:
    0 0 18px rgba(147, 197, 253, 0.9),
    0 0 40px rgba(59, 130, 246, 0.7),
    0 0 70px rgba(129, 140, 248, 0.6);

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background 0.2s ease-out;

  animation: evolve-orb-pulse 4s ease-in-out infinite;

  overflow: hidden;
}

#evolve-orb:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 24px rgba(191, 219, 254, 1),
    0 0 55px rgba(59, 130, 246, 0.9),
    0 0 90px rgba(129, 140, 248, 0.8);
}

#evolve-orb.is-dragging {
  transition: none;
  box-shadow:
    0 0 30px rgba(248, 250, 252, 1),
    0 0 80px rgba(59, 130, 246, 1);
}

/* ============================================================
   3. ORB STATE
   ============================================================ */
#evolve-orb[data-evolve-orb-state="normal"] {
  background:
    radial-gradient(circle at 30% 30%, #60a5fa, #1d4ed8),
    url('/assets/icons/evolve-logo.svg') center center no-repeat;
  background-size: 60% 60%;
}

#evolve-orb[data-evolve-orb-state="warn"] {
  background:
    radial-gradient(circle at 30% 30%, #facc15, #92400e),
    url('/assets/icons/evolve-logo.svg') center center no-repeat;
  background-size: 60% 60%;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.9);
}

#evolve-orb[data-evolve-orb-state="error"] {
  background:
    radial-gradient(circle at 30% 30%, #f97373, #7f1d1d),
    url('/assets/icons/evolve-logo.svg') center center no-repeat;
  background-size: 60% 60%;
  box-shadow: 0 0 22px rgba(248, 113, 113, 1);
  transform: scale(1.03);
}

#evolve-orb[data-evolve-orb-state="hint"] {
  background:
    radial-gradient(circle at 30% 30%, #22d3ee, #0f172a),
    url('/assets/icons/evolve-logo.svg') center center no-repeat;
  background-size: 60% 60%;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.9);
}

/* ============================================================
   4. ORB PULSE ANIMATION
   ============================================================ */
@keyframes evolve-orb-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 18px rgba(147, 197, 253, 0.9),
      0 0 40px rgba(59, 130, 246, 0.7),
      0 0 70px rgba(129, 140, 248, 0.6);
  }
  50% {
    transform: scale(1.03);
    box-shadow:
      0 0 26px rgba(191, 219, 254, 1),
      0 0 60px rgba(59, 130, 246, 0.9),
      0 0 100px rgba(129, 140, 248, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 18px rgba(147, 197, 253, 0.9),
      0 0 40px rgba(59, 130, 246, 0.7),
      0 0 70px rgba(129, 140, 248, 0.6);
  }
}

/* ============================================================
   5. PANEL CONTAINER
   ============================================================ */
.evolve-panel {
  position: fixed;
  background: rgba(20, 20, 30, 0.85);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  min-width: 320px;
  max-width: 480px;

  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  z-index: 9998;
}

.evolve-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ============================================================
   6. PANEL HEADER
   ============================================================ */
.evolve-panel-header {
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #cfcfff;
}

/* ============================================================
   7. TABS
   ============================================================ */
.evolve-panel-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}

.evolve-panel-tab {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.evolve-panel-tab.is-active {
  background: rgba(120,80,255,0.45);
  color: #fff;
}

/* ============================================================
   8. PANEL CONTENT
   ============================================================ */
.evolve-panel-content {
  padding: 14px;
  max-height: 360px;
  overflow-y: auto;
  color: #e5e5e5;
}

/* ============================================================
   9. HINT SYSTEM
   ============================================================ */
.evolve-hint-highlight {
  outline: 3px solid #00e0ff;
  outline-offset: 3px;
  transition: outline 0.2s ease;
}

.evolve-hint-item {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.evolve-hint-item:hover {
  background: #222;
}

.evolve-hint-overlay {
  position: absolute;
  background: #00e0ff;
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 999999;
  pointer-events: none;
  opacity: 0.9;
}

.evolve-hints-btn {
  margin-bottom: 12px;
  padding: 6px 12px;
  background: #333;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #555;
  color: #fff;
}

/* ============================================================
   10. ORB UPDATE PULSE
   ============================================================ */
.evolve-orb.evolve-updated {
  animation: evolvePulse 1.8s ease-out;
}

@keyframes evolvePulse {
  0% { box-shadow: 0 0 0px rgba(0,255,180,0.0); transform: scale(1); }
  40% { box-shadow: 0 0 22px rgba(0,255,180,0.9); transform: scale(1.08); }
  100% { box-shadow: 0 0 0px rgba(0,255,180,0.0); transform: scale(1); }
}

/* ============================================================
   11. HARNESS LOADER (v5)
   ============================================================ */
.evolve-loader-bar {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: 260px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.evolve-loader-inner {
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #00f5ff, #ff00ff);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

.evolve-loader-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  color: #e0e0ff;
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(0,0,0,0.6);
}

.evolve-loader-complete {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

/* ============================================================
   12. SANDBOX READY (Harness v5)
   ============================================================ */
.evolve-sandbox-container {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
}

.evolve-sandbox-frame {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
  background: transparent;
}

