:root {
  --primary-gradient: linear-gradient(90deg, #ff4a36 0%, #dd98ff 100%);
  --bg-dark: #0a0a0b;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-dimmed: rgba(255, 255, 255, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --shadow-sm: 0 4px 15px rgba(255, 74, 54, 0.2);
  --shadow-md: 0 8px 30px rgba(255, 74, 54, 0.3);
  --shadow-lg: 0 12px 45px rgba(255, 74, 54, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

#tutorial-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.05);
}

#tutorial-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(255, 74, 54, 0.4);
}

/* ============================================================
   TUTORIAL ARROW
   ============================================================ */

#tutorial-arrow {
  position: fixed;
  z-index: 10005;
  pointer-events: none;
  /* Wider than the 220px SVG so the absolutely-positioned pill (left:108px)
     isn't width-constrained by its containing block and can wrap naturally. */
  width: 380px;
  height: 130px;
  transition: opacity 0.3s ease;
}

#tutorial-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

#tutorial-arrow.visible {
  opacity: 1;
  animation: arrowFloat 2.6s ease-in-out infinite;
}

/* Gentle, low-amplitude float — eye-catching without being busy */
@keyframes arrowFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.arrow-curve {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

.arrow-curve-line {
  fill: none;
  stroke: #6ca0ff;
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

.arrow-curve-head {
  fill: #6ca0ff;
  stroke: #6ca0ff;
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

.arrow-pill {
  position: absolute;
  /* Anchored by its bottom edge to the curve's start point (y=44 in the SVG),
     so multi-line labels grow upward and stay connected to the arrow. */
  bottom: 86px;
  left: 108px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  max-width: 240px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(255, 74, 54, 0.35);
}

.arrow-pill-emoji {
  font-size: 18px;
  line-height: 1;
}

/* ============================================================
   TUTORIAL BANNER
   ============================================================ */

#tutorial-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 10006;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

#tutorial-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

#tutorial-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#tutorial-banner.success {
  border-color: rgba(0, 200, 83, 0.3);
}

#tutorial-banner.success .banner-icon::before {
  content: "✅";
}

#tutorial-banner.info .banner-icon::before {
  content: "💡";
}

#tutorial-banner.loading .banner-icon::before {
  content: "⏳";
}

#tutorial-banner.error {
  border-color: rgba(255, 74, 54, 0.4);
  animation: bannerShake 0.4s ease;
}

#tutorial-banner.error .banner-icon::before {
  content: "✖";
}

@keyframes bannerShake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  20% { transform: translateX(calc(-50% + 6px)) translateY(0); }
  40% { transform: translateX(calc(-50% - 6px)) translateY(0); }
  60% { transform: translateX(calc(-50% + 4px)) translateY(0); }
  80% { transform: translateX(calc(-50% - 2px)) translateY(0); }
}

.banner-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.banner-text {
  color: var(--text-primary);
}

/* ============================================================
   BUTTON HIGHLIGHT RING (pulsing ring around the button)
   ============================================================ */

.button-highlight-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  border: 2px solid rgba(100, 149, 237, 0.6);
  animation: highlightPulse 1.5s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(100, 149, 237, 0.3);
  }
  50% {
    transform: scale(1.15);
    opacity: 0.4;
    box-shadow: 0 0 20px 8px rgba(100, 149, 237, 0.15);
  }
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 36px 24px 8px;
  background: radial-gradient(ellipse at 50% 0%,
      rgba(255, 74, 54, 0.08) 0%,
      rgba(221, 152, 255, 0.04) 45%,
      transparent 75%);
}

.hero-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px;
}

.hero-logo {
  width: 48px;
  height: 48px;
}

.hero-text {
  text-align: left;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-badge.active {
  border-color: rgba(0, 200, 83, 0.3);
}

.status-badge.error {
  border-color: rgba(255, 74, 54, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.status-badge.active .status-dot {
  background: #00c853;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.5);
}

.status-badge.error .status-dot {
  background: #ff4a36;
  box-shadow: 0 0 8px rgba(255, 74, 54, 0.5);
}

/* ============================================================
   TUTORIAL SECTIONS
   ============================================================ */

.tutorial-section {
  padding: 64px 24px;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tutorial-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* First section sits right under the compact hero so the question is
   visible immediately — drop the user straight into it. */
#section-quiz {
  padding-top: 24px;
}

.section-container {
  width: 100%;
}

.section-header {
  margin-bottom: 40px;
}

.section-number {
  font-size: 14px;
  font-weight: 600;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-header h2 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.section-description {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

.section-description strong {
  color: var(--text-primary);
}

/* ============================================================
   QUIZ CARD
   ============================================================ */

.quiz-card {
  background: #1a1a2e;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.quiz-header {
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-header-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.quiz-header-badge {
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  color: var(--text-dimmed);
  font-weight: 500;
}

.quiz-question {
  padding: 24px;
}

.question-text {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.quiz-option input[type="radio"] {
  display: none;
}

.option-letter {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.option-text {
  color: var(--text-primary);
  line-height: 1.4;
}

.quiz-option:has(input:checked) {
  border-color: rgba(100, 149, 237, 0.5);
  background: rgba(100, 149, 237, 0.08);
}

.quiz-option:has(input:checked) .option-letter {
  background: rgba(100, 149, 237, 0.3);
  color: #fff;
}

/* ============================================================
   SHORTCUT HINT (standalone, below quiz)
   ============================================================ */

.shortcut-hint-standalone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dimmed);
  margin-top: 8px;
}

.shortcut-label {
  margin-left: 8px;
  color: var(--text-dimmed);
}

kbd {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ============================================================
   FOOTER
   ============================================================ */

.demo-footer {
  text-align: center;
  padding: 80px 24px 100px;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.demo-footer.visible {
  opacity: 1;
}

.done-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.demo-footer h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.demo-footer p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.cta-button {
  padding: 14px 40px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  letter-spacing: -0.2px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-button.pulse {
  animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: var(--shadow-lg); }
}

/* ============================================================
   SNAPGPT BUTTON (ported from css/button.css + content.js)
   ============================================================ */

#gpt-screenshot-button {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 10000;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #0a0a0b;
  color: white;
  border: none;
  cursor: pointer;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 15px rgba(45, 55, 72, 0.2);
  font-family: var(--font-family);
  font-weight: 500;
  overflow: hidden;
  line-height: 1;
}

#gpt-screenshot-button:hover:not(.loading):not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(45, 55, 72, 0.3);
}

#gpt-screenshot-button.loading {
  background: #4a5568;
  cursor: not-allowed;
  pointer-events: none;
}

#gpt-screenshot-button.error {
  background: #e53e3e;
  animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

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

@keyframes smoothRainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes glowingGradient {
  0% { filter: drop-shadow(0 0 10px rgba(255, 74, 54, 0.5)) drop-shadow(0 0 20px rgba(221, 152, 255, 0)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 74, 54, 0)) drop-shadow(0 0 25px rgba(221, 152, 255, 0.5)); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 74, 54, 0.5)) drop-shadow(0 0 20px rgba(221, 152, 255, 0)); }
}

.rainbow-button {
  background: linear-gradient(90deg, #ff4a36 0%, #dd98ff 100%) !important;
  background-size: 200% 100% !important;
  animation: smoothRainbow 2s ease infinite, glowingGradient 2s ease-in-out infinite !important;
  border-color: transparent !important;
}

.shift-glow {
  box-shadow: 0 0 12px 3px rgba(100, 149, 237, 0.45), 0 0 24px 6px rgba(100, 149, 237, 0.2) !important;
  border: 1px solid rgba(100, 149, 237, 0.5) !important;
}

@keyframes typing {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .section-header h2 { font-size: 28px; }
  .tutorial-section { padding: 80px 16px; }
  .quiz-question { padding: 20px 16px; }
  .quiz-header { padding: 12px 16px; }
  .arrow-label { font-size: 13px; max-width: 260px; }
}

/* ============================================================
   SETTINGS POPUP MOCK (step 03 — mirrors html/popup.html)
   ============================================================ */

.settings-mock {
  width: 380px;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.mock-header {
  text-align: center;
  padding: 18px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.2px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border-color);
}

.mock-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 16px 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.mock-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dimmed);
  border-radius: 12px;
}

.mock-tab.active {
  color: var(--text-primary);
  background: rgba(255, 74, 54, 0.15);
}

.mock-tab-content {
  padding: 12px 16px 18px;
}

.mock-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}

.mock-group:last-child {
  margin-bottom: 0;
}

.mock-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #ff6a5a;
  margin-bottom: 12px;
}

.mock-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

.mock-toggle-row label {
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.mock-nested {
  margin-left: 24px;
}

.mock-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.mock-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.mock-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  overflow: hidden;
  transition: var(--transition);
  pointer-events: none;
}

.mock-slider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.mock-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.mock-switch input:checked + .mock-slider {
  border-color: transparent;
}

.mock-switch input:checked + .mock-slider::after {
  opacity: 1;
}

.mock-switch input:checked + .mock-slider::before {
  transform: translateX(22px);
}

/* The one live control — highlighted so it stands out from the greyed UI */
.mock-highlight {
  margin: -4px -10px 6px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 74, 54, 0.07);
  border: 1px solid rgba(255, 74, 54, 0.3);
}

/* Everything else is greyed out and non-interactive */
.mock-dim {
  opacity: 0.4;
  pointer-events: none;
}

/* Answer Popup Position grid (static preview) */
.mock-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mock-position-cell {
  aspect-ratio: 1;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  position: relative;
}

.mock-position-cell::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.mock-position-cell.selected {
  border-color: #ff4a36;
  background: var(--primary-gradient);
}
