/* ==========================================================================
   AxonFlow AI — 3D Spiral Previews & Showcase Styles
   ========================================================================== */

.spiral-showcase-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
  overscroll-behavior-x: none;
}

.spiral-track {
  position: relative;
  width: 100%;
  height: auto !important;
  margin: 0;
  padding: 0;
}

.spiral-stage {
  position: relative !important;
  top: auto !important;
  height: clamp(580px, 80vh, 720px) !important;
  overflow: clip !important;
  overflow-clip-margin: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  background: transparent !important;
  border-radius: 24px;
  overscroll-behavior: none;
  overscroll-behavior-x: none;
}

/* Background animated SVG guide */
.spiral-guide {
  position: absolute;
  width: 135vmin;
  height: 135vmin;
  opacity: 0.35;
  pointer-events: none;
  transition: transform 0.08s linear;
  will-change: transform;
}

.spiral-guide path {
  fill: none;
  stroke: rgba(127, 129, 255, 0.45);
  stroke-width: 1.4;
  stroke-dasharray: 4 8;
}

[data-theme="disabled-light"] .spiral-guide path,
html.disabled-light .spiral-guide path {
  stroke: rgba(67, 56, 202, 0.35);
}

/* Spiral HUD overlay */
.sp-head {
  position: absolute;
  left: clamp(20px, 4vw, 48px);
  top: clamp(24px, 4vh, 48px);
  max-width: 320px;
  z-index: 140;
  pointer-events: auto;
  text-align: left;
  background: rgba(8, 12, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 16px 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

[data-theme="disabled-light"] .sp-head,
html.disabled-light .sp-head {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.sp-head-main {
  display: flex;
  flex-direction: column;
}

.sp-head-titles {
  margin-top: 4px;
}

.sp-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #35d07f;
  background: rgba(53, 208, 127, 0.12);
  border: 1px solid rgba(53, 208, 127, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 6px;
  align-self: flex-start;
}

.sp-pill .sp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 10px #35d07f;
  animation: spPulse 1.5s infinite;
}

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

.sp-title {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 700;
  margin: 4px 0 6px;
  line-height: 1.2;
  color: var(--text, #f4f4f1);
  font-family: var(--font-display, serif);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sp-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #7f81ff);
  margin-bottom: 6px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sp-head-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-count {
  color: var(--accent, #7f81ff);
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  text-shadow: 0 0 20px rgba(127, 129, 255, 0.4);
}

.sp-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 200px;
}

.sp-dots i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  transition: all 0.25s ease;
  cursor: pointer;
}

[data-theme="disabled-light"] .sp-dots i,
html.disabled-light .sp-dots i {
  background: rgba(0, 0, 0, 0.15);
}

.sp-dots i.done {
  background: var(--accent-2, #35d07f);
}

.sp-dots i.on {
  background: var(--accent, #7f81ff);
  width: 32px;
  box-shadow: 0 0 10px var(--accent, #7f81ff);
}

/* 3D Spiral Center Deck */
.spiral-center {
  position: relative;
  width: 0;
  height: 0;
  perspective: 1400px;
  transform-style: preserve-3d;
  margin-top: -20px;
}

.sp-card {
  position: absolute;
  left: calc(min(560px, 78vw) / -2);
  top: -180px;
  width: min(560px, 78vw);
  cursor: pointer;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.sp-card.on .bframe {
  box-shadow: 0 0 0 2px #00d4ff, 0 20px 50px rgba(0, 212, 255, 0.40), 0 35px 80px rgba(0, 0, 0, 0.85);
  border-color: #00d4ff;
}

/* Browser mockup window with 16:10 monitor aspect ratio */
.bframe {
  border-radius: 16px;
  overflow: hidden;
  background: #090c14;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

[data-theme="disabled-light"] .bframe,
html.disabled-light .bframe {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.bbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: #121624;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="disabled-light"] .bbar,
html.disabled-light .bbar {
  background: #f1f5f9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bbar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.bbar i:nth-child(1) { background: #ff5f57; }
.bbar i:nth-child(2) { background: #febc2e; }
.bbar i:nth-child(3) { background: #28c840; }

.addr {
  flex: 1;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-dim, #9aa0ab);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

[data-theme="disabled-light"] .addr,
html.disabled-light .addr {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}

.addr .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  flex-shrink: 0;
}

/* Preview screen with fixed 16:10 computer resolution */
.bview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #06080c;
}

.bview-poster-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #090c14;
}

.bview-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.sp-card:hover .bview-poster {
  transform: scale(1.03);
}

.bview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.75) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sp-card:hover .bview-overlay,
.sp-card.on .bview-overlay {
  opacity: 1;
}

.bview-launch-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(84, 87, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 99px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(84, 87, 255, 0.5);
}

.bview-scaled {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bview-scaled iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
  background: transparent;
}

.bview-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #ffffff;
  text-align: center;
}

.bview-fallback-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.bview-fallback-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sp-cap {
  margin-top: 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text, #f4f4f1);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sp-card.on .sp-cap {
  opacity: 1;
  transform: translateY(0);
}

.sp-cap-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #00d4ff;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sp-cap-sep {
  color: rgba(255, 255, 255, 0.3);
}

.sp-cap-action {
  font-size: 0.76rem;
  color: #f1f5f9;
  font-weight: 600;
}

/* Dedicated Interactive Scroller & Navigation Controls */
.sp-controls {
  position: absolute;
  bottom: clamp(16px, 3vh, 28px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 160;
  pointer-events: auto;
  width: min(92%, 580px);
}

.sp-arrow-btn {
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: var(--text, #f4f4f1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

[data-theme="disabled-light"] .sp-arrow-btn,
html.disabled-light .sp-arrow-btn {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(67, 56, 202, 0.25);
  color: #0f172a;
}

.sp-arrow-btn:hover {
  background: #00d4ff;
  color: #07080a;
  border-color: #00d4ff;
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Dedicated Interactive Scroller Track */
.sp-scroller-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 18px 7px 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 212, 255, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

[data-theme="disabled-light"] .sp-scroller-track,
html.disabled-light .sp-scroller-track {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.sp-scroller-track:focus-visible {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

.sp-scroller-rail {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: visible;
}

[data-theme="disabled-light"] .sp-scroller-rail,
html.disabled-light .sp-scroller-rail {
  background: rgba(0, 0, 0, 0.10);
}

.sp-scroller-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2%;
  background: linear-gradient(90deg, #38bdf8, #00d4ff);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  pointer-events: none;
  transition: width 0.08s ease;
}

.sp-scroller-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 10;
  touch-action: none;
  transition: left 0.08s ease;
}

.sp-scroller-thumb:active {
  cursor: grabbing;
}

.sp-thumb-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #00d4ff;
  color: #030814;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.75), 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

.sp-scroller-thumb:hover .sp-thumb-pill,
.sp-scroller-thumb:active .sp-thumb-pill {
  transform: scale(1.15);
  background: #ffffff;
  color: #020617;
  box-shadow: 0 0 16px rgba(0, 212, 255, 1);
}

.sp-scroller-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-dim, #94a3b8);
  margin-top: 2px;
}

.sp-scroller-tip {
  opacity: 0.75;
}

.sp-scroller-total {
  color: #00d4ff;
  font-weight: 700;
}

/* View toggle switch: 3D Spiral vs. 3-Column Grid */
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body, sans-serif);
  color: var(--text-dim, #9aa0ab);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background: var(--accent, #7f81ff);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(127, 129, 255, 0.4);
}

.view-toggle-btn:not(.active):hover {
  color: var(--text, #f4f4f1);
  background: rgba(255, 255, 255, 0.06);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .spiral-stage {
    height: 520px !important;
    overflow: clip !important;
    overflow-clip-margin: 0px;
    border-radius: 18px;
  }

  .sp-head {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: 480px;
    margin: 0 auto;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(8, 12, 22, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    z-index: 140;
  }

  .sp-head-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .sp-pill {
    margin-bottom: 0 !important;
    padding: 3px 8px !important;
    font-size: 0.62rem !important;
    flex-shrink: 0;
  }

  .sp-head-titles {
    margin-top: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .sp-title {
    font-size: 0.92rem !important;
    font-weight: 700;
    margin: 0 !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sp-tag {
    font-size: 0.68rem !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
  }

  .sp-head-meta {
    margin-top: 0;
    flex-shrink: 0;
  }

  .sp-count {
    font-size: 0.82rem !important;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.28);
    color: #00d4ff !important;
    font-weight: 700;
  }

  .sp-dots {
    display: none !important;
  }

  .spiral-center {
    position: absolute;
    left: 50%;
    top: 52%;
  }

  .sp-card {
    width: min(330px, 86vw);
    left: calc(min(330px, 86vw) / -2);
    top: -100px;
  }

  .sp-controls {
    bottom: 12px;
    gap: 8px;
    width: calc(100% - 20px);
    max-width: 480px;
  }

  .sp-arrow-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .sp-scroller-track {
    padding: 6px 14px 6px 14px;
  }
}

@media (max-width: 480px) {
  .spiral-stage {
    height: 480px !important;
    overflow: clip !important;
    overflow-clip-margin: 0px;
  }

  .sp-card {
    width: min(290px, 90vw);
    left: calc(min(290px, 90vw) / -2);
    top: -90px;
  }

  .sp-head {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 6px 10px;
  }

  .sp-tag {
    display: none;
  }

  .sp-controls {
    bottom: 8px;
    gap: 6px;
    width: calc(100% - 14px);
  }

  .sp-arrow-btn {
    width: 34px;
    height: 34px;
  }

  .sp-scroller-track {
    padding: 5px 10px;
  }

  .sp-scroller-tip {
    display: none;
  }
}

/* Dedicated Google AI Studio preview styling */
.aistudio-preview {
  height: 100%;
  padding: 14px 18px;
  background: radial-gradient(circle at 85% 10%, rgba(66, 133, 244, 0.28), transparent 55%),
              radial-gradient(circle at 15% 90%, rgba(219, 68, 85, 0.18), transparent 50%),
              linear-gradient(160deg, #0a0e1a, #05070e);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, sans-serif;
}

.as-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.as-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.as-sparkle {
  width: 16px;
  height: 16px;
  color: #60a5fa;
}

.as-model-badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #93c5fd;
  font: 600 0.68rem var(--font-mono, monospace);
}

.as-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 600 0.65rem var(--font-mono, monospace);
  color: #4ade80;
}

.as-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.as-content {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.as-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.as-subtitle {
  font-size: 0.74rem;
  color: var(--text-dim, #94a3b8);
  margin: 0;
  line-height: 1.4;
}

.as-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.as-metric-box {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.as-metric-label {
  font-size: 0.58rem;
  color: var(--text-dim, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.as-metric-val {
  font-size: 0.76rem;
  font-weight: 700;
  color: #67e8f9;
  margin-top: 2px;
  display: block;
}

.as-desc {
  font-size: 0.72rem;
  line-height: 1.4;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.025);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #38bdf8;
  margin: 0;
}

.as-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.as-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.as-tags span {
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.as-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.as-launch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
  color: #ffffff;
}

