/* ==========================================================================
   AEO & GEO Audit Agent - CSS Design System & Theme Variables
   ========================================================================== */

:root {
  /* Color Palette - Dark Glassmorphism Theme */
  --bg-dark: #07090e;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --bg-elevated: #151d2e;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.3);
  --border-emerald: rgba(16, 185, 129, 0.3);

  /* Primary Accent Colors */
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;

  --orange-500: #f97316;

  --rose-400: #fb7185;
  --rose-500: #f43f5e;

  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Glass effects */
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.05);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --backdrop-blur: blur(16px);
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* Card Utility */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  margin-bottom: 2rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

/* Card Collapsible Engine */
.card:not(.score-overview-section) .section-header {
  cursor: pointer;
  user-select: none;
}

.btn-toggle-collapse {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.card:hover .btn-toggle-collapse {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.btn-toggle-collapse .chevron-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.is-collapsed .btn-toggle-collapse .chevron-icon {
  transform: rotate(-90deg);
}

.card.is-collapsed {
  padding-bottom: 1.25rem !important;
  margin-bottom: 1rem !important;
}

.card.is-collapsed > *:not(.section-header) {
  display: none !important;
}

.card.is-collapsed .section-header {
  margin-bottom: 0 !important;
}

/* Header Component */
.app-header {
  margin-bottom: 2rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(18, 24, 38, 0.6);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--blue-400);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-sparkle {
  position: absolute;
  top: -4px;
  right: -4px;
  color: var(--amber-400);
  font-size: 14px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.825rem;
  color: #94a3b8;
  display: block;
}

.header-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.target-badge {
  font-size: 0.775rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: var(--emerald-400); box-shadow: 0 0 8px var(--emerald-500); }
.dot.blue { background: var(--blue-400); box-shadow: 0 0 8px var(--blue-500); }
.dot.amber { background: var(--amber-400); box-shadow: 0 0 8px var(--amber-500); }
.dot.red { background: var(--rose-400); box-shadow: 0 0 8px var(--rose-500); }

/* Input Section Component */
.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.tab-group {
  display: flex;
  gap: 0.5rem;
  background: rgba(10, 14, 23, 0.6);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-elevated);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
}

.sample-loader {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sample-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.sample-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sample-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue-400);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sample-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--blue-400);
  color: #ffffff;
}

.pane {
  display: none;
}

.pane.active {
  display: block;
}

.url-input-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.input-wrapper {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: #64748b;
  pointer-events: none;
}

input[type="url"], textarea {
  width: 100%;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  padding: 1rem;
  font-family: var(--font-sans);
  resize: vertical;
}

input[type="url"]:focus, textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--blue-600);
  background-image: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.input-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.6rem;
  display: block;
}

.pane-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Loading & Error States */
.loading-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  margin-top: 1rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--blue-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.loading-title {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.95rem;
}

.loading-sub {
  font-size: 0.825rem;
  color: #94a3b8;
}

.error-container {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: var(--rose-400);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.hidden { display: none !important; }

/* Score Overview Component */
.score-overview-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .score-overview-grid {
    grid-template-columns: 1fr;
  }
}

.main-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
}

.gauge-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-svg {
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
}

.gauge-progress {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
}

.gauge-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.gauge-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.grade-badge-wrapper {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.grade-pill {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0.25rem 1.25rem;
  border-radius: 20px;
  border: 1px solid transparent;
}

.score-status {
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
}

.document-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.meta-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.sub-metrics-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #f8fafc;
}

.sub-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metric-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.metric-weight {
  font-size: 0.75rem;
  color: #64748b;
}

.metric-score-val {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
}

.metric-score-val.emerald { color: var(--emerald-400); }
.metric-score-val.amber { color: var(--amber-400); }
.metric-score-val.rose { color: var(--rose-400); }

.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-in-out;
}

.progress-bar-fill.emerald { background: var(--emerald-gradient); }
.progress-bar-fill.amber { background: var(--gold-gradient); }
.progress-bar-fill.rose { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }

.metric-desc {
  font-size: 0.775rem;
  color: #64748b;
}

/* Recommendations Component */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.filter-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
  background: rgba(10, 14, 23, 0.6);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.filter-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: var(--bg-elevated);
  color: #ffffff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  color: #64748b;
}

.search-box input {
  padding-left: 2.2rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  font-size: 0.825rem;
  width: 200px;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rec-card {
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.rec-card.severity-critical { border-left: 4px solid var(--rose-500); }
.rec-card.severity-high { border-left: 4px solid var(--amber-500); }
.rec-card.severity-medium { border-left: 4px solid var(--blue-500); }
.rec-card.severity-low { border-left: 4px solid var(--emerald-500); }

.rec-card-header {
  margin-bottom: 0.875rem;
}

.rec-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-severity.critical { background: rgba(244, 63, 94, 0.2); color: var(--rose-400); border: 1px solid rgba(244, 63, 94, 0.4); }
.badge-severity.high { background: rgba(245, 158, 11, 0.2); color: var(--amber-400); border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-severity.medium { background: rgba(59, 130, 246, 0.2); color: var(--blue-400); border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-severity.low { background: rgba(16, 185, 129, 0.2); color: var(--emerald-400); border: 1px solid rgba(16, 185, 129, 0.4); }

.badge-category { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
.badge-impact { background: rgba(59, 130, 246, 0.1); color: var(--blue-400); }

.rec-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.rec-summary-block {
  font-size: 0.875rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.875rem;
}

.rec-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

@media (max-width: 768px) {
  .rec-details-grid { grid-template-columns: 1fr; }
}

.detail-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  display: block;
  margin-bottom: 0.25rem;
}

.detail-box p {
  font-size: 0.825rem;
  color: #e2e8f0;
}

.rec-code-block {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  color: #94a3b8;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-copy-snippet, .btn-copy-schema {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-copy-snippet:hover, .btn-copy-schema:hover {
  background: var(--blue-600);
  color: #ffffff;
}

pre {
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a5f3fc;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Before vs After Rewrite Section */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 850px) {
  .before-after-grid {
    grid-template-columns: 1fr;
  }
  .transform-arrow {
    transform: rotate(90deg);
    margin: 0.5rem auto;
  }
}

.transform-card {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.transform-card.before { border-top: 3px solid var(--rose-500); }
.transform-card.after { border-top: 3px solid var(--emerald-500); }

.transform-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tldr-format-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(10, 14, 23, 0.6);
  padding: 0.2rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.tldr-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tldr-toggle-btn.active {
  background: var(--bg-elevated);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.transform-badge {
  font-size: 0.8rem;
  font-weight: 700;
}

.transform-badge.red { color: var(--rose-400); }
.transform-badge.green { color: var(--emerald-400); }

.transform-score {
  font-size: 0.75rem;
  color: #94a3b8;
}

.sample-text {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.tldr-preview-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.825rem;
}

.tldr-preview-header {
  color: var(--emerald-400);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.tldr-list {
  padding-left: 1.2rem;
  color: #e2e8f0;
}

.tldr-list li {
  margin-bottom: 0.3rem;
}

.fluff-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.fluff-pill {
  font-size: 0.7rem;
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-400);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.fluff-pill.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.transform-arrow {
  display: flex;
  justify-content: center;
  color: var(--blue-400);
}

/* Schema Generator Section */
.schema-tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(10, 14, 23, 0.6);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.schema-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.schema-tab-btn.active {
  background: var(--bg-elevated);
  color: #ffffff;
}

.schema-editor-wrapper {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  margin-bottom: 0;
}

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

.modal-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
}

.export-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.export-option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.export-option-card:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--blue-400);
}

.export-icon { font-size: 1.5rem; }

.export-info {
  display: flex;
  flex-direction: column;
}

.export-info strong { font-size: 0.9rem; color: #ffffff; }
.export-info span { font-size: 0.775rem; color: #94a3b8; }

.export-category-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.export-category-title {
  font-size: 0.775rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.export-option-card.highlighted-blue {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.export-option-card.highlighted-blue:hover {
  background: rgba(59, 130, 246, 0.22);
}

.export-option-card.highlighted-purple {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.export-option-card.highlighted-purple:hover {
  background: rgba(168, 85, 247, 0.22);
}

.modal-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.export-tab-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(10, 14, 23, 0.6);
  padding: 0.2rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.export-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-tab-btn.active {
  background: var(--bg-elevated);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.preview-hint {
  font-size: 0.725rem;
  color: #64748b;
}

.markdown-preview-box textarea {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  background: #090d16;
  color: #cbd5e1;
}

/* Heading Suggestions Table Styles */
.heading-suggestions-box {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.suggestions-header {
  background: rgba(59, 130, 246, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-400);
}

.table-responsive {
  overflow-x: auto;
}

.suggestions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.suggestions-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.suggestions-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.suggestions-table tr:last-child td {
  border-bottom: none;
}

.orig-heading {
  color: var(--rose-400);
  font-size: 0.8rem;
  width: 30%;
}

.sug-heading {
  color: #f8fafc;
  font-size: 0.85rem;
  width: 45%;
}

.intent-tag {
  width: 25%;
}

.intent-pill {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  display: inline-block;
  font-weight: 500;
}

/* Heading Hierarchy Breakdown & Skipped Map Styles */
.heading-hierarchy-breakdown-box {
  background: rgba(10, 14, 23, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.hierarchy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(59, 130, 246, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-400);
}

.skipped-count-pill {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

.skipped-count-pill.red {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-400);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.skipped-count-pill.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hierarchy-tree-container {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 400px;
  overflow-y: auto;
}

.hierarchy-item {
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-right: 0.5rem;
  border-radius: 0 4px 4px 0;
  transition: background 0.15s ease;
}

.hierarchy-item.has-skipped-jump {
  border-left: 3px solid var(--rose-500);
  background: rgba(244, 63, 94, 0.06);
  border-radius: 6px;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.hierarchy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.h-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}

.h-badge.level-1 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.h-badge.level-2 { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.h-badge.level-3 { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.h-badge.level-4 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.h-badge.level-5, .h-badge.level-6 { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

.h-text {
  font-size: 0.825rem;
  color: #e2e8f0;
  font-weight: 500;
}

.skipped-warning-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-left: auto;
}

.skipped-jump-details-banner {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  line-height: 1.4;
}

.skipped-jump-details-banner code {
  font-family: var(--font-mono);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

.skipped-jumps-summary-bar {
  background: rgba(244, 63, 94, 0.08);
  border-bottom: 1px solid rgba(244, 63, 94, 0.2);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: #fecdd3;
}

.skipped-summary-list {
  padding-left: 1.2rem;
  margin-top: 0.35rem;
  font-size: 0.775rem;
  line-height: 1.5;
}

.skipped-summary-list code {
  font-family: var(--font-mono);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

/* Intent Matching Breakdown Box Styles */
.intent-matching-breakdown-box {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.25rem;
}

.intent-header {
  background: rgba(168, 85, 247, 0.12);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.title-group-intent {
  display: flex;
  flex-direction: column;
}

.title-group-intent span {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e9d5ff;
}

.intent-subtitle {
  font-size: 0.725rem !important;
  color: #c084fc !important;
  font-weight: 400 !important;
}

.intent-coverage-summary-bar {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1rem;
  font-size: 0.775rem;
  color: #cbd5e1;
}

.coverage-pills-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.coverage-pill {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

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

.coverage-pill.fail {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.intent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.775rem;
}

.intent-table th {
  background: rgba(0, 0, 0, 0.3);
  color: #94a3b8;
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.intent-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.intent-row.status-mismatch {
  background: rgba(244, 63, 94, 0.04);
}

.intent-row.status-vague {
  background: rgba(245, 158, 11, 0.04);
}

.intent-detected-tag {
  font-size: 0.725rem;
  background: rgba(255, 255, 255, 0.06);
  color: #a5f3fc;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-block;
}

.diag-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.diag-badge.red { background: rgba(244, 63, 94, 0.2); color: #fecdd3; border: 1px solid rgba(244, 63, 94, 0.4); }
.diag-badge.amber { background: rgba(245, 158, 11, 0.2); color: #fef3c7; border: 1px solid rgba(245, 158, 11, 0.4); }
.diag-badge.green { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }

.diag-desc {
  font-size: 0.725rem;
  color: #94a3b8;
  line-height: 1.35;
}

.remediation-text {
  font-size: 0.775rem;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.target-badge {
  font-size: 0.675rem;
  color: #c084fc;
  font-family: var(--font-mono);
}

.tree-legend {
  font-size: 0.725rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.h-index-pill {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  color: #64748b;
  font-weight: 700;
}

.h-ok-pill {
  font-size: 0.675rem;
  color: var(--emerald-400);
  margin-left: auto;
  font-weight: 500;
  opacity: 0.8;
}

.banner-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: #ffe4e6;
}

.fix-tip {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px dashed rgba(244, 63, 94, 0.3);
  color: #ffffff;
}

.red-pulse {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

/* Transformer Guidance Banner & Steps */
.transformer-guidance-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
}

.banner-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.banner-text strong {
  color: var(--blue-400);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.2rem;
}

.banner-text p {
  font-size: 0.825rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.banner-text code {
  font-family: var(--font-mono);
  color: #a5f3fc;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.775rem;
}

.transformer-action-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 800px) {
  .transformer-action-steps {
    grid-template-columns: 1fr;
  }
}

.step-card {
  display: flex;
  gap: 0.75rem;
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content strong {
  font-size: 0.825rem;
  color: #ffffff;
  display: block;
  margin-bottom: 0.15rem;
}

.step-content p {
  font-size: 0.775rem;
  color: #94a3b8;
  line-height: 1.4;
}

.step-content code {
  font-family: var(--font-mono);
  color: #a5f3fc;
}

/* Technical Engineering Ticket Styles */
.technical-ticket-section {
  margin-top: 1.5rem;
}

.ticket-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ticket-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.ticket-step-card {
  display: flex;
  gap: 1rem;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  align-items: flex-start;
}

.ticket-step-card.step-1 { border-left: 4px solid var(--blue-500); }
.ticket-step-card.step-2 { border-left: 4px solid var(--purple-500); }
.ticket-step-card.step-3 { border-left: 4px solid var(--emerald-500); }

.step-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #a5f3fc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

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

.step-label {
  font-size: 0.775rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.5rem;
}

.ticket-title-box {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ticket-title-box code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #f8fafc;
  word-break: break-word;
}

.ticket-meta-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.ticket-meta-pill.priority-highest { background: rgba(244, 63, 94, 0.15); color: var(--rose-400); border-color: rgba(244, 63, 94, 0.3); }
.ticket-meta-pill.priority-high { background: rgba(245, 158, 11, 0.15); color: var(--amber-400); border-color: rgba(245, 158, 11, 0.3); }

.ticket-description-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 800px) {
  .ticket-description-grid { grid-template-columns: 1fr; }
  .ticket-step-card { flex-direction: column; }
}

.desc-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
}

.desc-box h4 {
  font-size: 0.825rem;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}

.desc-box p {
  font-size: 0.785rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.tech-specs-box {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
}

.tech-specs-box h4 {
  font-size: 0.825rem;
  color: var(--blue-400);
  margin-bottom: 0.6rem;
}

.spec-block {
  margin-bottom: 0.75rem;
}

.spec-block:last-child {
  margin-bottom: 0;
}

.spec-block strong {
  font-size: 0.775rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 0.25rem;
}

.spec-block pre {
  background: #04060a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a5f3fc;
  margin: 0;
}

.spec-skipped-list {
  padding-left: 1.2rem;
  font-size: 0.775rem;
  color: #fecdd3;
  line-height: 1.5;
}

.acceptance-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.check-item input[type="checkbox"] {
  accent-color: var(--emerald-500);
  margin-top: 0.2rem;
}

.check-item label {
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.45;
  cursor: pointer;
}

.check-item label code {
  font-family: var(--font-mono);
  color: #34d399;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* Print CSS */
@media print {
  body { background: #ffffff; color: #000000; }
  .card { background: #ffffff; border: 1px solid #ccc; color: #000000; box-shadow: none; }
  .input-section, .filter-controls, .btn, .modal-overlay { display: none !important; }
}
