/* ===================================================================
   css/screen-studio.css — Ada's Interactive Screen Demonstration Studio
   Semicolon's simulated workstation screen for code walkthroughs.
   =================================================================== */

:root {
  --studio-bg: #0d1117;
  --studio-header: #161b22;
  --studio-border: rgba(255, 255, 255, 0.12);
  --studio-text: #e6edf3;
  --studio-muted: #8b949e;
  --studio-accent: #38bdf8;
  --studio-accent-bg: rgba(56, 189, 248, 0.12);
  --studio-line-num: #484f58;
  --studio-highlight-line: rgba(56, 189, 248, 0.18);
  --studio-term-bg: #090d13;
  --studio-green: #3fb950;
  --studio-yellow: #d29922;
  --studio-red: #f85149;
}

/* Outer Screen Frame - Looks like a premium operating system window */
.screen-studio {
  background: var(--studio-bg);
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--studio-text);
  margin: 1.5rem 0;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.screen-studio:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 20px 48px rgba(13, 17, 23, 0.55);
}

/* Window Chrome / Titlebar */
.studio-titlebar {
  background: var(--studio-header);
  border-bottom: 1px solid var(--studio-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  user-select: none;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.studio-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.studio-dot--red { background: var(--studio-red); }
.studio-dot--yellow { background: var(--studio-yellow); }
.studio-dot--green { background: var(--studio-green); }

.studio-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.studio-tab {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.studio-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-badge--live {
  background: rgba(248, 81, 73, 0.2);
  color: #ff7b72;
  border: 1px solid rgba(248, 81, 73, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.studio-badge--live::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff7b72;
  animation: pulse-red 1.4s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Ada Narration Banner - Spoken explanation synced with code */
.studio-narration {
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.18), rgba(79, 70, 229, 0.12));
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.92rem;
  color: #f0f6fc;
  line-height: 1.45;
}

.studio-ada-avatar {
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.4);
}

.studio-narration-body {
  flex: 1;
}

.studio-narration-title {
  font-weight: 600;
  color: #38bdf8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

/* Studio Main Workspace (Editor + Output) */
.studio-workspace {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 220px;
}

@media (min-width: 768px) {
  .studio-workspace--split {
    grid-template-columns: 1.25fr 1fr;
  }
}

/* Code Editor Pane */
.studio-editor {
  padding: 1rem 0;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  background: var(--studio-bg);
  position: relative;
}

.studio-line {
  display: flex;
  padding: 0 1rem;
  transition: background 0.15s ease;
  white-space: pre;
}

.studio-line.is-active {
  background: var(--studio-highlight-line);
  border-left: 3px solid var(--studio-accent);
}

.studio-line-number {
  color: var(--studio-line-num);
  width: 2.2rem;
  user-select: none;
  text-align: right;
  padding-right: 1rem;
  flex-shrink: 0;
}

.studio-code-text {
  flex: 1;
  color: #c9d1d9;
}

/* Syntax colors */
.studio-keyword { color: #ff7b72; font-weight: 600; }
.studio-function { color: #d2a8ff; }
.studio-string { color: #a5d6ff; }
.studio-comment { color: #8b949e; font-style: italic; }
.studio-number { color: #79c0ff; }
.studio-builtin { color: #ffa657; }

/* Blinking cursor */
.studio-cursor {
  display: inline-block;
  width: 7px;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--studio-accent);
  animation: studio-blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes studio-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Terminal / Output Pane */
.studio-terminal {
  background: var(--studio-term-bg);
  border-top: 1px solid var(--studio-border);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .studio-workspace--split .studio-terminal {
    border-top: none;
    border-left: 1px solid var(--studio-border);
  }
}

.studio-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: var(--studio-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.studio-term-output {
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #7ee787;
  overflow-y: auto;
  max-height: 160px;
  white-space: pre-wrap;
  font-family: inherit;
}

.studio-term-prompt {
  color: #8b949e;
}

/* Variables Inspection Bar */
.studio-vars {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.studio-var-pill {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: #cbd5e1;
}

.studio-var-pill strong {
  color: #38bdf8;
}

/* Studio Controls Bar */
.studio-controls {
  background: var(--studio-header);
  border-top: 1px solid var(--studio-border);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.studio-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.studio-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6edf3;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.studio-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.studio-btn--primary {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: white;
  font-weight: 500;
}

.studio-btn--primary:hover {
  background: #2563eb;
}

.studio-speed-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6edf3;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
}

/* Scrubber / Progress Bar */
.studio-progress-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.studio-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1d4ed8, #38bdf8);
  width: 0%;
  transition: width 0.2s ease;
}

/* Embedded Section in Lesson Page */
.ada-screen-section {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1.5rem 0 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .ada-screen-section {
  background: #111827;
  border-color: #1f2937;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ada-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.ada-screen-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ada-avatar-badge {
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: white;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.ada-screen-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.ada-screen-header p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted, #64748b);
}
