/**
 * Ceypace Enterprise Workspace Provisioning & Launchpad Stylesheet
 *
 * Android / Pixel System Recovery & Erase Kinetic Chromatic Ring Architecture:
 * - Multi-layered kinetic chromatic luminous rings (White Core + Emerald + Amber + Cyan)
 * - Organic fluid gyroscopic morphing & rotation (Zero rainbow / zero pride disc)
 * - Authentic Google / Android Material You enterprise aesthetics
 * - High-contrast crisp typography (Anti-washed out text)
 * - Minimalist high-tech glowing progress bar
 * - Smooth state transition from Provisioning Loader -> Success Reveal (3.2s)
 * - Prominent, high-contrast Workspace URL card with 1-click clipboard copy
 * - 100% Tokenized Polaris 2024/2025 Architecture (Light & Dark Mode)
 *
 * @package Ceypace
 * @author Ceypace Engineering
 */

/* ==========================================================================
   Provisioning Viewport Shell
   ========================================================================== */
.qs-provision-shell {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

.qs-provision-card {
  background: var(--p-color-bg-surface, #ffffff);
  border-radius: var(--p-border-radius-xl, 16px);
  border: 1px solid var(--p-border-subtle, rgba(0, 0, 0, 0.08));
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 38px 32px 32px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--p-transition-normal), box-shadow var(--p-transition-normal), background-color 0.25s ease;
}

/* ==========================================================================
   Stage 1: Ceypace Quantum Reactor & Orbital Hyper-Ring Engine
   ========================================================================== */
.qs-stage-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.qs-stage-loading.is-hidden {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  display: none;
}

/* Central Quantum Stage Container */
.qs-quantum-stage {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 26px auto;
}

/* Atmospheric Soft Diffuse Emerald/Cyan Aurora Aura */
.qs-quantum-halo {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(6, 182, 212, 0.16) 45%, transparent 72%);
  filter: blur(22px);
  pointer-events: none;
  animation: qsQuantumHaloPulse 3.6s ease-in-out infinite alternate;
}

/* SVG Quantum Reactor Core */
.qs-quantum-svg {
  width: 160px;
  height: 160px;
  overflow: visible;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Outer Laser Arc (Emerald to Cyan Orbital Sweep) */
.qs-arc-outer {
  transform-origin: 80px 80px;
  animation: qsSweepClockwise 3.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

/* Middle Laser Arc (Electric Cyan to Mint Counter-Sweep) */
.qs-arc-mid {
  transform-origin: 80px 80px;
  animation: qsSweepCounter 4.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Inner High-Velocity Arc */
.qs-arc-inner {
  transform-origin: 80px 80px;
  animation: qsSweepClockwise 2.2s linear infinite;
}

/* Satellite Particles Orbit */
.qs-satellites-group {
  transform-origin: 80px 80px;
  animation: qsSweepClockwise 5.6s ease-in-out infinite;
}

/* Central Quantum Beacon (Glassmorphic Gem with Ceypace Icon) */
.qs-quantum-center-gem {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 16px -2px rgba(0, 128, 96, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #008060;
  animation: qsGemHeartbeat 2.4s ease-in-out infinite alternate;
}

.qs-quantum-center-gem svg {
  filter: drop-shadow(0 1px 2px rgba(0, 128, 96, 0.3));
}

/* Keyframe Animations */
@keyframes qsSweepClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes qsSweepCounter {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes qsQuantumHaloPulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.14); opacity: 1; }
}

@keyframes qsGemHeartbeat {
  0% {
    transform: scale(0.96);
    box-shadow: 0 4px 14px -2px rgba(0, 128, 96, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 6px 22px 0 rgba(0, 128, 96, 0.35), 0 0 12px rgba(6, 182, 212, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  }
}

/* ==========================================================================
   Provisioning Typography & Milestone Sequencing (Shopify Polaris Hierarchy)
   ========================================================================== */
.qs-provision-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--p-color-text, #111827);
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;
  line-height: 24px;
}

.qs-provision-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
  margin: 0 0 20px 0;
  min-height: 18px;
  line-height: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Minimalist Progress Bar (Linear 4-Step Synchronized) */
.qs-progress-track {
  width: 100%;
  max-width: 240px;
  height: 3px;
  background: var(--p-color-bg-subdued, #e5e7eb);
  border-radius: var(--p-border-radius-full, 9999px);
  overflow: hidden;
  margin: 0 auto 14px auto;
  position: relative;
}

.qs-progress-bar {
  height: 100%;
  width: 0%;
  background: #008060; /* Clean Ceypace Enterprise Emerald */
  border-radius: var(--p-border-radius-full, 9999px);
  box-shadow: 0 0 6px rgba(0, 128, 96, 0.35);
  position: relative;
  overflow: hidden;
}

.qs-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7));
  filter: blur(1px);
}

/* Organic Realistic Multi-Milestone Easing */
@keyframes qsProgressOrganicFill {
  0% {
    width: 0%;
  }
  12% {
    width: 18%;
  }
  24% {
    width: 27%;
  }
  38% {
    width: 48%;
  }
  50% {
    width: 56%;
  }
  64% {
    width: 74%;
  }
  75% {
    width: 82%;
  }
  88% {
    width: 95%;
  }
  95% {
    width: 98%;
  }
  100% {
    width: 100%;
  }
}

.qs-progress-steps-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin: 0 auto;
}

.qs-progress-steps-label .qs-spinner-micro {
  width: 9px;
  height: 9px;
  border: 1.5px solid #d1d5db;
  border-top-color: #008060;
  border-radius: 50%;
  animation: qsMicroSpin 0.7s linear infinite;
}

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

/* ==========================================================================
   Stage 2: Workspace Ready Reveal & Launchpad
   ========================================================================== */
.qs-stage-ready {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.qs-stage-ready.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Celebration Success Badge with Glow */
.qs-ready-badge-stage {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qs-ready-badge-halo {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
  filter: blur(8px);
  animation: qsSuccessBreathe 2.5s ease-in-out infinite alternate;
}

.qs-ready-badge-circle {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #008060 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 128, 96, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: qsBadgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes qsBadgePop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes qsSuccessBreathe {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0.9; }
}

/* Animated SVG Checkmark */
.qs-ready-checkmark {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: qsStrokeDraw 0.4s ease-out 0.15s forwards;
}

@keyframes qsStrokeDraw {
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   Workspace Domain Card (Shopify Polaris Standard)
   ========================================================================== */
.qs-ready-domain-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 16px 0 18px 0;
  text-align: left;
  transition: all var(--p-transition-fast);
}

.qs-ready-domain-card:hover {
  border-color: #d1d5db;
}

.qs-ready-domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.qs-ready-domain-label {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.qs-ready-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 450;
  color: #065f46;
  background: #ecfdf5;
  padding: 1.5px 7px;
  border-radius: 9999px;
  border: 1px solid #d1fae5;
}

.qs-ready-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 5px #059669;
  animation: qsDotBlink 2s ease-in-out infinite;
}

@keyframes qsDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.qs-ready-domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qs-ready-domain-url-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.qs-ready-domain-url-wrap svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.qs-ready-domain-url {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  letter-spacing: -0.1px;
  user-select: all;
  -webkit-user-select: all;
  cursor: text;
  text-decoration: none;
}

/* Copy Action Button (Compact Shopify Style) */
.qs-ready-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 28px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
  transition: all var(--p-transition-fast);
  flex-shrink: 0;
}

.qs-ready-copy-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.qs-ready-copy-btn.is-copied {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* ==========================================================================
   Primary Launch CTA Button (Shopify Polaris Standard Small / Normal)
   ========================================================================== */
.qs-launch-cta-btn {
  display: inline-flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
  text-decoration: none !important;
  border-radius: 6px !important;
  background: #111827 !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all var(--p-transition-fast) !important;
}

.qs-launch-cta-btn:hover {
  background: #1f2937 !important;
  transform: translateY(-0.5px) !important;
}

.qs-launch-cta-btn svg {
  transition: transform 0.15s ease;
}

.qs-launch-cta-btn:hover svg {
  transform: translateX(2px);
}

/* Preview Mode Controls (Compact Replay Pill) */
.qs-preview-controls-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qs-preview-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px dashed #d1d5db;
  border-radius: 9999px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 450;
  color: #6b7280;
  cursor: pointer;
  transition: all var(--p-transition-fast);
}

.qs-preview-replay-btn:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #9ca3af;
}

/* ==========================================================================
   Obsidian Dark Mode Overrides
   ========================================================================== */
[data-color-scheme="dark"] .qs-provision-card {
  background: #0b0e14;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.95), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

[data-color-scheme="dark"] .qs-provision-title {
  color: #f9fafb;
}

[data-color-scheme="dark"] .qs-provision-subtitle {
  color: #9ca3af;
}

/* Dark Mode Quantum Luminescence */
[data-color-scheme="dark"] .qs-quantum-halo {
  background: radial-gradient(circle, rgba(0, 230, 118, 0.28) 0%, rgba(0, 229, 255, 0.22) 45%, transparent 75%);
}

[data-color-scheme="dark"] .qs-quantum-center-gem {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  color: #00e676;
}

[data-color-scheme="dark"] .qs-track-outer,
[data-color-scheme="dark"] .qs-track-mid {
  stroke: #94a3b8 !important;
  opacity: 0.25 !important;
}

[data-color-scheme="dark"] .qs-quantum-svg line {
  stroke: #94a3b8 !important;
  opacity: 0.5 !important;
}

[data-color-scheme="dark"] .qs-progress-track {
  background: #1f2937;
}

[data-color-scheme="dark"] .qs-progress-bar {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

[data-color-scheme="dark"] .qs-progress-bar::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85));
}

[data-color-scheme="dark"] .qs-progress-steps-label {
  color: #9ca3af;
}

[data-color-scheme="dark"] .qs-ready-domain-card {
  background: #111827;
  border-color: #1f2937;
}

[data-color-scheme="dark"] .qs-ready-domain-header {
  color: #9ca3af;
}

[data-color-scheme="dark"] .qs-ready-domain-label {
  color: #9ca3af;
}

[data-color-scheme="dark"] .qs-ready-status-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

[data-color-scheme="dark"] .qs-ready-domain-url {
  color: #f3f4f6;
}

[data-color-scheme="dark"] .qs-ready-copy-btn {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

[data-color-scheme="dark"] .qs-ready-copy-btn:hover {
  background: #374151;
  border-color: #4b5563;
  color: #ffffff;
}

[data-color-scheme="dark"] .qs-ready-copy-btn.is-copied {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

[data-color-scheme="dark"] .qs-launch-cta-btn {
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-color-scheme="dark"] .qs-launch-cta-btn:hover {
  background: #f3f4f6 !important;
}

[data-color-scheme="dark"] .qs-preview-replay-btn {
  border-color: #374151;
  color: #9ca3af;
}

[data-color-scheme="dark"] .qs-preview-replay-btn:hover {
  background: #1f2937;
  color: #f9fafb;
  border-color: #4b5563;
}
