/* ==========================================================================
   TTN AI STUDIO — INTERACTIVE SCREENSHOT GUIDE BUILDER
   Dark & Light SaaS Aesthetic • Visual Canvas Hotspot Editor • TTN Player
   ========================================================================== */

:root {
  --ttn-coral: #FF5C35;
  --ttn-coral-light: #FF7A59;
  --ttn-coral-dark: #E04823;
  --ttn-coral-glow: rgba(255, 92, 53, 0.4);
  --ttn-coral-subtle: rgba(255, 92, 53, 0.12);

  --indigo: #6366F1;
  --indigo-dark: #4F46E5;
  --indigo-glow: rgba(99, 102, 241, 0.35);
  --indigo-subtle: rgba(99, 102, 241, 0.12);

  --cyan: #06B6D4;
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #EF4444;

  --bg-app: #0B132B;
  --bg-sidebar: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --bg-input: #1E293B;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-active: #FF5C35;

  --text-white: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --radius-xl: 18px;
  --radius-2xl: 22px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --ease-smooth: cubic-bezier(0.2, 0.9, 0.2, 1);
  --ease-spring: cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background-color: var(--bg-app);
  color: var(--text-white);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.18s ease;
}

/* ==========================================================================
   STUDIO NAVBAR
   ========================================================================== */

.studio-navbar {
  height: 60px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ttn-coral), var(--indigo));
  display: grid;
  place-items: center;
}

.logo-coral-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff;
}

.logo-sonar {
  position: absolute;
  inset: -3px;
  border-radius: 11px;
  border: 1px solid var(--ttn-coral);
  opacity: 0.6;
  animation: logoSonar 2.5s infinite ease-out;
}

@keyframes logoSonar {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.brand-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ttn-coral-subtle);
  color: var(--ttn-coral-light);
  border: 1px solid rgba(255, 92, 53, 0.25);
}

.brand-sub {
  display: block;
  font-size: 0.64rem;
  color: var(--text-dim);
}

.project-title-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

#project-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-white);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  min-width: 280px;
  transition: all 0.2s ease;
}

#project-title-input:hover,
#project-title-input:focus {
  background: var(--bg-input);
  border-color: var(--line-strong);
}

.save-status-pill {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--emerald);
  padding: 2px 6px;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 4px;
}

.nav-center {
  display: flex;
  align-items: center;
}

.mode-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mode-tab:hover {
  color: #fff;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, var(--ttn-coral), #FF7243);
  color: #fff;
  box-shadow: 0 2px 8px var(--ttn-coral-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--ttn-coral), #FF7243);
  color: #fff;
  box-shadow: 0 4px 14px var(--ttn-coral-glow);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-white);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.74rem;
}

.btn-outline {
  border: 1px solid var(--line-strong);
  color: var(--text-white);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--rose);
  color: #fff;
}

/* DROPDOWN MENU */
.dropdown-chevron {
  font-size: 0.6rem;
  margin-left: 2px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  background: #111C44;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: left;
  color: #fff;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dropdown-text strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.dropdown-text small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   STUDIO WORKSPACE LAYOUT (3-PANEL EDITOR)
   ========================================================================== */

.studio-workspace {
  display: grid;
  grid-template-columns: 290px 1fr 320px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* LEFT SIDEBAR: TIMELINE & STEPS */
.timeline-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title-row h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.step-count-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--indigo-subtle);
  color: #A5B4FC;
}

.sidebar-subtitle {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* UPLOAD DROPZONE */
.upload-dropzone {
  margin: 12px 14px 6px;
  padding: 14px;
  border: 1.5px dashed rgba(255, 92, 53, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(255, 92, 53, 0.05);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--ttn-coral);
  background: rgba(255, 92, 53, 0.12);
  transform: scale(1.02);
}

.dropzone-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.dropzone-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ttn-coral-light);
}

.dropzone-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* STEPS LIST */
.steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: grab;
  position: relative;
  transition: all 0.18s ease;
  user-select: none;
}

.step-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.step-card.is-active {
  background: linear-gradient(135deg, rgba(255, 92, 53, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-color: var(--ttn-coral);
  box-shadow: 0 4px 14px rgba(255, 92, 53, 0.2);
}

.step-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.step-num-pill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-input);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.step-card.is-active .step-num-pill {
  background: var(--ttn-coral);
  color: #fff;
}

.step-thumb {
  width: 48px;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.step-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step-card-info {
  flex: 1;
  min-width: 0;
}

.step-card-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-card-kicker {
  margin: 2px 0 0;
  font-size: 0.66rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-card-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-order-btn {
  font-size: 0.6rem;
  padding: 1px 4px;
  color: var(--text-dim);
  border-radius: 2px;
}

.step-order-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.btn-add-step {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add-step:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--indigo);
}

/* ==========================================================================
   CENTER: SCREENSHOT CANVAS & HOTSPOT EDITOR
   ========================================================================== */

.canvas-area {
  background: #070D1E;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.canvas-toolbar {
  height: 50px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-step-indicator {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}

.hotspot-mode-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ttn-coral-subtle);
  color: var(--ttn-coral-light);
}

.toolbar-center {
  display: flex;
  gap: 6px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tool-btn:hover {
  color: #fff;
  background: var(--bg-card-hover);
}

.tool-btn.is-active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}

.ai-magic-btn {
  background: linear-gradient(135deg, var(--indigo) 0%, #7C3AED 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px var(--indigo-glow);
}

.ai-magic-btn:hover {
  background: linear-gradient(135deg, var(--indigo-dark), #6D28D9);
}

.ai-sparkle {
  animation: sparkleSpin 2s infinite ease-in-out;
}

@keyframes sparkleSpin {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
}

/* SCREENSHOT STAGE */
.screenshot-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
}

.screenshot-container {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  overflow: visible;
  line-height: 0;
  user-select: none;
}

#canvas-image {
  display: block;
  max-width: min(900px, 100%);
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
}

/* CANVAS DRAW LAYER (Click & drag to create box) */
.canvas-draw-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 15;
}

/* HOTSPOT BOX OVERLAY (Editable bounding box) */
.hotspot-box {
  position: absolute;
  border: 2.5px solid var(--ttn-coral);
  background: rgba(255, 92, 53, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 92, 53, 0.3), 0 0 25px var(--ttn-coral-glow);
  border-radius: 8px;
  z-index: 20;
  cursor: move;
  transition: border-color 0.15s ease;
}

.hotspot-border-glow {
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  animation: borderBreathe 2s infinite alternate;
}

@keyframes borderBreathe {
  0% { opacity: 0.3; }
  100% { opacity: 0.85; }
}

/* RESIZE HANDLES */
.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid var(--ttn-coral);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-n  { top: -5px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-e  { top: calc(50% - 5px); right: -5px; cursor: ew-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-s  { bottom: -5px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.handle-w  { top: calc(50% - 5px); left: -5px; cursor: ew-resize; }

/* LIVE BEACON PREVIEW ON HOTSPOT */
.preview-beacon {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.beacon-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ttn-coral);
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--ttn-coral);
}

.beacon-wave-1,
.beacon-wave-2 {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ttn-coral);
  animation: sonarPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.beacon-wave-2 {
  animation-delay: 0.65s;
}

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

/* LIVE ACTION BADGE PREVIEW */
.preview-action-badge {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--ttn-coral), #FF7243);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--ttn-coral-glow);
  pointer-events: none;
  animation: badgeBob 2s ease-in-out infinite alternate;
}

@keyframes badgeBob {
  0% { transform: translate(-50%, -3px); }
  100% { transform: translate(-50%, 3px); }
}

.canvas-footer-bar {
  height: 38px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hotspot-coords-readout {
  display: flex;
  gap: 8px;
}

.coord-tag {
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   RIGHT SIDEBAR: STEP PROPS & AI COPYWRITER
   ========================================================================== */

.step-props-sidebar {
  background: var(--bg-sidebar);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.props-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.props-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.props-title-row h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.props-step-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ttn-coral-subtle);
  color: var(--ttn-coral-light);
}

.props-subtitle {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.props-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-enhance-card {
  padding: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ai-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #A5B4FC;
}

.btn-ai-rephrase {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--indigo);
  color: #fff;
  border-radius: var(--radius-sm);
}

.btn-ai-rephrase:hover {
  background: var(--indigo-dark);
}

.ai-card-tip {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.props-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.props-form input,
.props-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-white);
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.props-form input:focus,
.props-form textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-subtle);
}

.props-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.screenshot-mgmt-card {
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.screenshot-mgmt-card h4 {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.screenshot-media-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

#props-thumb-preview {
  width: 60px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.media-preview-info {
  flex: 1;
}

.media-filename {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-danger-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   INTERACTIVE TTN PLAYER WORKSPACE (PLAY MODE)
   ========================================================================== */

.studio-player-workspace {
  position: fixed;
  inset: 0;
  background: #070D1E;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.studio-player-workspace[hidden] {
  display: none !important;
}

.player-topbar {
  height: 56px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  backdrop-filter: blur(16px);
  z-index: 50;
}

.player-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-tour-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.btn-autoplay {
  background: var(--ttn-coral-subtle);
  color: var(--ttn-coral-light);
  border: 1px solid rgba(255, 92, 53, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-autoplay.is-playing {
  background: var(--ttn-coral);
  color: #fff;
  box-shadow: 0 4px 14px var(--ttn-coral-glow);
}

.player-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-step-counter {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  background: var(--indigo-subtle);
  color: #A5B4FC;
  border-radius: 999px;
}

/* PLAYER MAIN STAGE */
.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  position: relative;
  z-index: 2;
}

.studio-app {
  height: 100%;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 1;
  animation: floatGlow 18s ease-in-out infinite alternate;
}

.ambient-glow-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--ttn-coral) 0%, rgba(255, 92, 53, 0) 70%);
  top: -120px;
  left: -80px;
}

.ambient-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--indigo) 0%, rgba(99, 102, 241, 0) 70%);
  bottom: -150px;
  right: -100px;
  animation-duration: 22s;
  animation-delay: -5s;
}

.ambient-glow-3 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, var(--cyan) 0%, rgba(6, 182, 212, 0) 70%);
  top: 45%;
  left: 55%;
  animation-duration: 26s;
  animation-delay: -10s;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.1); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

.player-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.search-bar-mock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.78rem;
  width: min(320px, 40vw);
}

.player-brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-badge-live {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #34d399;
}

.btn-sound {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-sound.is-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.player-window-frame {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: min(1140px, 94vw);
  max-height: calc(100vh - 120px);
  background: #0b132b;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 45px rgba(99, 102, 241, 0.14);
  overflow: hidden;
}

.player-window-header {
  height: 38px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  flex-shrink: 0;
  user-select: none;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.w-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.w-dot.red { background: #ff5f56; }
.w-dot.yellow { background: #ffbd2e; }
.w-dot.green { background: #27c93f; }

.window-url-bar {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.simulated-typing-box {
  position: absolute;
  z-index: 37;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  pointer-events: none;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ttn-coral);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.ttn-guidance-cue {
  position: absolute;
  z-index: 38;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #c7d2fe;
  pointer-events: none;
}

.player-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.coach-quick-autoplay {
  border: none;
  background: var(--ttn-coral-subtle);
  color: var(--ttn-coral-light);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hotspot-drag-handle {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: move;
}

.form-row {
  margin-bottom: 0;
}

.prop-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-input);
  color: #fff;
  font-size: 0.84rem;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.player-viewport {
  position: relative;
  line-height: 0;
  background: #0b132b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.player-screen-wrapper {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  overflow: visible;
  user-select: none;
  flex-shrink: 0;
}

#player-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Target field — sole interactive typing surface in screenshot preview */
.player-target-input {
  position: absolute;
  z-index: 28;
  margin: 0;
  padding: 0 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.1vw, 0.9rem);
  font-weight: 600;
  box-sizing: border-box;
  pointer-events: auto;
  outline: none;
  transition:
    left 0.45s var(--ease-smooth),
    top 0.45s var(--ease-smooth),
    width 0.45s var(--ease-smooth),
    height 0.45s var(--ease-smooth);
}

.player-target-input:focus {
  border-color: var(--ttn-coral);
  box-shadow: 0 0 0 3px rgba(255, 92, 53, 0.35);
}

.player-target-input[hidden] {
  display: none !important;
}

/* TTN PLAYER SPOTLIGHT OVERLAY */
.ttn-player-spotlight {
  position: absolute;
  border: 2.5px solid var(--ttn-coral);
  background: rgba(255, 92, 53, 0.08);
  box-shadow:
    0 0 0 4px rgba(255, 92, 53, 0.3),
    0 0 35px var(--ttn-coral-glow),
    0 0 0 9999px rgba(10, 18, 36, 0.72);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 30;
  transition:
    top 0.45s var(--ease-smooth),
    left 0.45s var(--ease-smooth),
    width 0.45s var(--ease-smooth),
    height 0.45s var(--ease-smooth),
    opacity 0.2s ease;
}

.spotlight-border-glow {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.7);
  animation: glowPulse 2s infinite alternate;
}

.spotlight-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #fff;
  border-style: solid;
}

.spotlight-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-top-left-radius: 6px; }
.spotlight-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-top-right-radius: 6px; }
.spotlight-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-bottom-left-radius: 6px; }
.spotlight-corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-bottom-right-radius: 6px; }

/* TTN PLAYER RADAR BEACON */
.ttn-player-beacon {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 35;
  transition:
    top 0.45s var(--ease-smooth),
    left 0.45s var(--ease-smooth);
}

/* TTN PLAYER ACTION BADGE */
.ttn-player-badge {
  position: absolute;
  z-index: 36;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--ttn-coral), #FF7243);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 20px var(--ttn-coral-glow);
  pointer-events: none;
  transform: translate(-50%, -100%);
  animation: badgeBob 2s ease-in-out infinite alternate;
  transition:
    top 0.45s var(--ease-smooth),
    left 0.45s var(--ease-smooth);
}

/* TTN PLAYER ANIMATED CURSOR */
.ttn-player-cursor {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  transition:
    top 0.45s var(--ease-smooth),
    left 0.45s var(--ease-smooth),
    transform 0.15s ease;
}

.ttn-player-cursor.is-clicking {
  animation: cursorTap 0.35s var(--ease-spring);
}

@keyframes cursorTap {
  0% { transform: scale(1); }
  40% { transform: scale(0.8) translate(-2px, -2px); }
  100% { transform: scale(1); }
}

.player-ripple-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 42;
}

.player-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--ttn-coral);
  transform: translate(-50%, -50%);
  animation: ripplePop 0.6s ease-out forwards;
}

/* TTN PLAYER COACH CARD */
.player-coach {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: min(420px, calc(100vw - 36px));
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 12px 28px var(--indigo-glow);
  color: #0F172A;
  z-index: 100;
  backdrop-filter: blur(28px) saturate(190%);
  overflow: hidden;
}

.player-coach-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 8px;
  color: #64748B;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.coach-grip {
  width: 16px;
  height: 2px;
  background: #64748B;
  border-radius: 2px;
  box-shadow: 0 4px 0 #64748B, 0 -4px 0 #64748B;
}

.player-coach-progress {
  height: 4px;
  background: rgba(99, 102, 241, 0.12);
  overflow: hidden;
  position: relative;
}

.player-coach-progress-bar {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--ttn-coral), var(--indigo), var(--cyan));
  position: relative;
  transition: width 0.35s ease;
}

.progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmerMove 2s infinite;
}

.player-coach-copy {
  padding: 16px 22px 14px;
}

.coach-kicker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.coach-icon {
  font-size: 1rem;
}

.coach-kicker {
  color: var(--ttn-coral);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.coach-pill {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  background: var(--indigo-subtle);
  color: var(--indigo-dark);
  border-radius: 999px;
}

.player-coach-copy h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.player-coach-copy p {
  margin: 0;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.6;
}

.player-coach-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px 4px;
}

.player-coach-nav .btn {
  flex: 0 0 auto;
}

.player-coach-nav .btn {
  color: #0F172A;
}

.player-coach-nav .btn-primary {
  color: #fff;
}

.player-coach-nav .btn-secondary {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.player-dots {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.p-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #CBD5E1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.p-dot.is-on {
  width: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ttn-coral), var(--indigo));
}

.player-coach-hints {
  text-align: center;
  margin: 10px 22px 14px;
  padding-top: 8px;
  border-top: 1px solid #E2E8F0;
  font-size: 0.66rem;
  color: #94A3B8;
}

.hint-pill {
  font-family: var(--font-mono);
  background: #F1F5F9;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  color: #475569;
}

/* CONFETTI CANVAS */
.player-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 150;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111C44;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s var(--ease-spring);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glowPulse {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

@keyframes ripplePop {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

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

/* PUBLISH MODAL */
.studio-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(7, 13, 30, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.studio-modal-backdrop[hidden] {
  display: none !important;
}

.studio-modal {
  width: min(480px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: linear-gradient(165deg, #111c44 0%, #0b132b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  padding: 22px 24px 20px;
}

.studio-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.studio-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.studio-modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.studio-modal-lead {
  margin: 0 0 16px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #94a3b8;
}

.studio-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.studio-modal-form input[type="text"],
.studio-modal-form input[type="email"],
.studio-modal-form input[type="password"] {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.88rem;
}

.field-hint {
  font-weight: 500;
  font-size: 0.72rem;
  color: #64748b;
}

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 600;
}

.publish-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  font-size: 0.8rem;
}

.publish-status.is-error {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.publish-status[hidden] {
  display: none !important;
}

.studio-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.publish-result {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 12px;
}

.publish-result-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #6ee7b7;
  font-weight: 700;
}

.publish-result-url {
  display: block;
  word-break: break-all;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 14px;
}

.publish-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-modal-foot {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #64748b;
}

.studio-modal-foot a {
  color: var(--ttn-coral-light);
}
