/* ==========================================================================
   PromptForge Design System & Styles
   ========================================================================== */

/* -----------------------------
   CSS Custom Properties (Theme)
   ----------------------------- */
:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0d14;
  --bg-secondary: #101524;
  --bg-tertiary: #171f34;
  --bg-card: rgba(18, 24, 40, 0.75);
  --bg-card-hover: rgba(28, 38, 64, 0.85);
  --bg-input: rgba(10, 14, 26, 0.8);
  --bg-input-focus: rgba(15, 22, 40, 0.95);
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(139, 92, 246, 0.35);
  --border-cyan-glow: rgba(6, 182, 212, 0.35);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d16;

  /* Accent & Gradients */
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
  --grad-hover: linear-gradient(135deg, #9d74f7 0%, #4d8ff7 50%, #15c3e0 100%);
  --grad-card: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  --grad-text: linear-gradient(135deg, #c084fc 0%, #60a5fa 50%, #38bdf8 100%);

  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.25);
  --shadow-cyan-glow: 0 0 30px rgba(6, 182, 212, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-glow: rgba(139, 92, 246, 0.3);
  --border-cyan-glow: rgba(6, 182, 212, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --grad-card: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* -----------------------------
   Base Resets & Globals
   ----------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Background Glowing Mesh Spheres */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  transition: all 1s ease-in-out;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  top: -150px;
  right: -100px;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: 10%;
  left: -150px;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 40%;
  right: 20%;
  opacity: 0.2;
}

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

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* -----------------------------
   Typography Helpers
   ----------------------------- */
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* -----------------------------
   Glassmorphic Panels & Cards
   ----------------------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-medium);
}

/* -----------------------------
   Header / Navbar
   ----------------------------- */
.app-header {
  position: sticky;
  top: 1rem;
  z-index: 100;
  margin-bottom: 2rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.logo-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: var(--shadow-glow);
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-primary);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab i {
  font-size: 1.05rem;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

/* -----------------------------
   Main Content Layout
   ----------------------------- */
.main-content {
  flex: 1;
  margin-bottom: 3rem;
}

.tab-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-banner {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 2.5rem auto;
  padding: 1rem 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-glow);
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-desc strong {
  color: var(--text-primary);
}

/* Section Headings */
.section-intro {
  margin-bottom: 2rem;
}

.section-heading {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.section-heading i {
  color: var(--accent-purple);
}

.section-subtext {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* -----------------------------
   Generator Grid (2-Column)
   ----------------------------- */
.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Panel Common */
.panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-title i {
  color: var(--accent-cyan);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.text-btn:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* -----------------------------
   Form Inputs & Controls
   ----------------------------- */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label i {
  color: var(--accent-purple);
  margin-right: 0.3rem;
}

.label-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.textarea-wrapper {
  position: relative;
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), background-color var(--transition-smooth);
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input-char-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Quick Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.chips-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chip {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

/* Config Grid */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.custom-select-wrapper {
  position: relative;
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.form-select option {
  background-color: #101524;
  color: #f8fafc;
  padding: 8px;
}

[data-theme="light"] .form-select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* Advanced Options Toggle */
.advanced-toggle-wrapper {
  margin: 0.75rem 0 1.25rem 0;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.75rem;
}

.advanced-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.advanced-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.toggle-caret {
  transition: transform var(--transition-fast);
}

.toggle-caret.open {
  transform: rotate(180deg);
}

.advanced-options-body {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}

/* -----------------------------
   Buttons & Actions
   ----------------------------- */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--grad-primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.primary-btn:hover {
  background: var(--grad-hover);
  box-shadow: 0 0 35px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

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

.primary-btn.pulse-glow {
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 32px rgba(139, 92, 246, 0.6); }
  100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
}

.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-shortcut {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-left: 0.5rem;
}

.accent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-purple);
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.accent-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

.action-btn.danger:hover {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* -----------------------------
   Output Deck (Right Panel)
   ----------------------------- */
.output-header-bar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.output-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.output-title i {
  color: var(--accent-purple);
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Output Subtabs */
.output-subtabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-primary);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.subtab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.subtab-btn.active {
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
  border: 1px solid var(--border-cyan-glow);
  box-shadow: var(--shadow-sm);
}

.count-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
}

/* Output Panes */
.output-content-deck {
  flex: 1;
  min-height: 380px;
  margin-bottom: 1.25rem;
}

.outtab-pane {
  display: none;
}

.outtab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeIn 0.25s ease;
}

.pane-instruction {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid var(--accent-purple);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pane-instruction i {
  color: var(--accent-purple);
  margin-top: 2px;
}

/* Code Block Wrapper */
.code-block-wrapper {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
}

.code-block-wrapper pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Question Tree Cards List */
.question-tree-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.question-node-card {
  padding: 0.95rem 1.15rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.question-node-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-tertiary);
  transform: translateX(3px);
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.node-copy-btn {
  opacity: 0.6;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.question-node-card:hover .node-copy-btn {
  opacity: 1;
  color: var(--accent-cyan);
}

.node-question-text {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
}

.node-purpose-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Output Footer Actions */
.output-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.primary-actions .action-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.action-btn.copy-btn {
  background: var(--grad-primary);
  border: none;
  color: #fff;
}

.action-btn.copy-btn:hover {
  background: var(--grad-hover);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.direct-ai-launchers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}

.launch-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ai-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.ai-launch-btn .ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.ai-launch-btn.chatgpt .ai-dot { background-color: #10a37f; }
.ai-launch-btn.chatgpt:hover { border-color: #10a37f; }

.ai-launch-btn.claude .ai-dot { background-color: #d97706; }
.ai-launch-btn.claude:hover { border-color: #d97706; }

.ai-launch-btn.gemini .ai-dot { background-color: #3b82f6; }
.ai-launch-btn.gemini:hover { border-color: #3b82f6; }

/* -----------------------------
   Framework Builder Section
   ----------------------------- */
.framework-selector-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.framework-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.framework-tab-btn:hover {
  border-color: var(--accent-purple);
  background: var(--bg-card-hover);
}

.framework-tab-btn.active {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.fw-abbr {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.framework-tab-btn.active .fw-abbr {
  color: #c084fc;
}

.fw-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.framework-builder-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.framework-footer {
  margin-top: 1rem;
}

.quick-input-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.tag-helper-btn {
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-helper-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border-color: var(--border-glow);
}

/* -----------------------------
   Prompt Inspector Section
   ----------------------------- */
.inspector-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.score-overview-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.overall-score-circle {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.score-progress-circle {
  fill: none;
  stroke: var(--accent-purple);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.8s ease-in-out, stroke 0.4s ease;
}

.score-number-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number-display span:first-child {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.score-total-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.score-summary-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.score-summary-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  padding: 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.metric-top i {
  color: var(--accent-cyan);
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.diagnostic-recommendations {
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.diagnostic-recommendations h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-amber);
}

.recommendation-list {
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.enhanced-output-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.enhanced-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
}

/* -----------------------------
   Template Library Section
   ----------------------------- */
.library-controls {
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-box input {
  padding-left: 2.8rem;
}

.search-box.small input {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.82rem;
}

.category-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-chip {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cat-chip:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.cat-chip.active {
  background: var(--grad-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.library-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.library-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-lg);
}

.lib-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.lib-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.lib-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.lib-card-preview {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.lib-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.lib-tags {
  display: flex;
  gap: 0.35rem;
}

.lib-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.lib-actions {
  display: flex;
  gap: 0.4rem;
}

.lib-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lib-btn:hover {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

/* -----------------------------
   Saved Prompts Section
   ----------------------------- */
.saved-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.saved-header-actions {
  display: flex;
  gap: 0.5rem;
}

.saved-container {
  padding: 1.5rem;
}

.saved-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.saved-tab-toggle {
  display: flex;
  background: var(--bg-primary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.filter-toggle-btn {
  padding: 0.4rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-toggle-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 250px;
}

.saved-card {
  padding: 1.15rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.saved-card:hover {
  border-color: var(--border-medium);
}

.saved-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.saved-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.saved-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.saved-card-body {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.saved-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.4;
}

/* -----------------------------
   Footer
   ----------------------------- */
.app-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.footer-brand i {
  color: var(--accent-purple);
}

.footer-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -----------------------------
   Modal Dialogs
   ----------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid var(--border-cyan-glow);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-alert i {
  color: var(--accent-cyan);
  margin-top: 2px;
  font-size: 1.1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-tertiary);
}

/* -----------------------------
   Toast Notifications
   ----------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success {
  border-color: var(--accent-emerald);
}

.toast.success i {
  color: var(--accent-emerald);
}

.toast.info {
  border-color: var(--accent-cyan);
}

.toast.info i {
  color: var(--accent-cyan);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -----------------------------
   Responsive Breakpoints
   ----------------------------- */
@media (max-width: 1024px) {
  .generator-grid,
  .framework-builder-layout,
  .inspector-layout {
    grid-template-columns: 1fr;
  }
  
  .framework-selector-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .nav-tabs {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .config-grid,
  .metrics-grid,
  .inspector-actions {
    grid-template-columns: 1fr;
  }

  .framework-selector-tabs {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}
