/* ===== AI Playbook Portal — Design System ===== */
:root {
  /* Core palette */
  --bg-primary: #0a0b0f;
  --bg-secondary: #12131a;
  --bg-tertiary: #1a1b26;
  --bg-card: rgba(22, 23, 34, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border-active: rgba(139, 92, 246, 0.4);
  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-bright: #f8fafc;
  /* Accents */
  --accent: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.25);
  --accent-hover: #a78bfa;
  --accent-2: #06b6d4;
  --accent-3: #f59e0b;
  --accent-4: #10b981;
  --accent-5: #f43f5e;
  --accent-6: #3b82f6;
  /* Badges */
  --badge-architect: linear-gradient(135deg, #8b5cf6, #6366f1);
  --badge-agent: linear-gradient(135deg, #06b6d4, #0ea5e9);
  --badge-librarian: linear-gradient(135deg, #f59e0b, #f97316);
  --badge-verified: linear-gradient(135deg, #10b981, #14b8a6);
  /* Radius & Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.08);
  --transition: 0.2s cubic-bezier(.4, 0, .2, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .logo {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.sidebar-brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-brand span {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-hover);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.nav-item .icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.nav-item .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--badge-architect);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

.sidebar-user .user-info {
  flex: 1;
}

.sidebar-user .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-user .user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.sidebar-user .xp-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin-top: 4px;
}

.sidebar-user .xp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  height: 56px;
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all var(--transition);
  outline: none;
}

.topbar-search input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.82rem !important;
  padding: 8px 16px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

/* ===== Page Container ===== */
.page {
  flex: 1;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-bright);
}

.page-header p {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ===== Tab Bar ===== */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-top: 4px;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  color: var(--accent-4);
  margin-top: 2px;
}

.stat-card .stat-icon {
  float: right;
  font-size: 1.6rem;
  opacity: 0.5;
}

/* ===== Playbook Cards ===== */
.playbook-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playbook-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.playbook-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.playbook-card:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.playbook-card:hover::before {
  opacity: 1;
}

.playbook-card .card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.playbook-card .card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

.playbook-card .card-meta {
  flex: 1;
  min-width: 0;
}

.playbook-card .card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 2px;
}

.playbook-card .card-author {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.playbook-card .card-author strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.playbook-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.tag.verified {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-4);
  border-color: rgba(16, 185, 129, 0.25);
}

.tag.hot {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-5);
  border-color: rgba(244, 63, 94, 0.25);
}

.playbook-card .card-problem {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playbook-card .card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.card-action:hover {
  color: var(--accent);
}

.card-action.upvoted {
  color: var(--accent);
}

.card-action .count {
  font-weight: 600;
}

.card-timestamp {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Verified / Hall of Fame ===== */
.hof-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--badge-verified);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Modal / Slide Panel ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.modal-wide {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

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

/* ===== Form Fields ===== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label .required {
  color: var(--accent-5);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: all var(--transition);
  outline: none;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ===== Detail View ===== */
.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section h4::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.detail-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.detail-content pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  color: var(--accent-2);
}

.detail-content code {
  background: var(--bg-glass);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--accent-2);
}

/* Version History */
.version-timeline {
  position: relative;
  padding-left: 24px;
}

.version-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.version-item {
  position: relative;
  margin-bottom: 16px;
}

.version-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-secondary);
}

.version-item .v-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.version-item .v-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.version-item .v-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Comments */
.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.comment-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-left: 38px;
}

.comment-reply {
  margin-left: 38px;
}

.comment-input-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.comment-input-row input {
  flex: 1;
}

/* ===== Sandbox ===== */
.sandbox-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 400px;
}

.sandbox-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sandbox-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sandbox-editor {
  flex: 1;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  background: transparent;
  border: none;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 300px;
}

.sandbox-output {
  flex: 1;
  padding: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-y: auto;
}

.sandbox-run {
  padding: 6px 14px;
  background: var(--accent-4);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.sandbox-run:hover {
  opacity: 0.85;
}

/* ===== Weekly Pulse Report ===== */
.pulse-report {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.pulse-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pulse-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-5), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.pulse-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

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

.pulse-section {
  margin-bottom: 18px;
}

.pulse-section h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.pulse-item {
  padding: 10px 14px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
}

.pulse-challenge {
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--accent-5);
  border-left: 3px solid var(--accent-5);
}

/* ===== Leaderboard ===== */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.lb-item:hover {
  border-color: var(--border-active);
}

.lb-rank {
  font-size: 1.2rem;
  font-weight: 800;
  width: 32px;
  text-align: center;
  color: var(--text-muted);
}

.lb-rank.gold {
  color: #fbbf24;
}

.lb-rank.silver {
  color: #94a3b8;
}

.lb-rank.bronze {
  color: #f97316;
}

.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.lb-info {
  flex: 1;
}

.lb-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-bright);
}

.lb-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.lb-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
}

.lb-xp {
  text-align: right;
}

.lb-xp .xp-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.lb-xp .xp-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ===== Prompt Analysis Widget ===== */
.prompt-analysis {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 12px;
  animation: slideUp 0.3s ease;
}

.analysis-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.analysis-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.score-box {
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border);
}

.score-box .score-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.score-box .score-value {
  font-size: 1.4rem;
  font-weight: 800;
}

.analysis-details {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
}

.analysis-suggestions {
  margin-top: 8px;
}

.suggestion-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.suggestion-item:last-child {
  border-bottom: none;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.animate-in {
  animation: slideUp 0.35s ease both;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sandbox-container {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 16px;
  }
}