/* ==========================================================================
   MafLabs Design System - .env File Compare & Checker
   Light Theme Only • 100% Offline • Zero CDN Dependencies
   ========================================================================== */

/* --- 1. LOCAL SELF-HOSTED FONTS --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/outfit-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/outfit-800.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* --- 2. CSS VARIABLES & TOKENS --- */
:root {
  --heading: #0f172a;
  --body: #475569;
  --muted: #64748b;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-active: #1e40af;
  --brand-violet: #7c3aed;
  --brand-gradient: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
  --badge-text: #1d4ed8;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: #e2e8f0;
  --card-hover-border: rgba(37, 99, 235, 0.3);
  --radius-card: 14px;
  --radius-btn: 10px;
  --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-popover: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-btn: 0 6px 16px rgba(79, 70, 229, 0.28);
  
  --status-success-text: #16a34a;
  --status-success-bg: #f0fdf4;
  --status-success-border: #bbf7d0;

  --status-warning-text: #b45309;
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;

  --status-error-text: #dc2626;
  --status-error-bg: #fef2f2;
  --status-error-border: #fecaca;

  --font-headings: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, "SF Mono", monospace;
}

/* --- 3. BASE RESET & LAYOUT --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--body);
  background-color: #ffffff;
  min-height: 100vh;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Blobs (Fixed across entire viewport) */
.blob-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  -webkit-filter: blur(80px);
  opacity: 0.85;
  will-change: transform;
}

.blob-1 {
  top: -12vh;
  left: -8vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, rgba(59, 130, 246, 0.16) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-1 20s infinite ease-in-out alternate;
}

.blob-2 {
  top: -10vh;
  right: -10vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.28) 0%, rgba(168, 85, 247, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-2 24s infinite ease-in-out alternate;
}

.blob-3 {
  bottom: -15vh;
  left: -10vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(14, 165, 233, 0.14) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-3 22s infinite ease-in-out alternate;
}

.blob-4 {
  bottom: -10vh;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(236, 72, 153, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-4 26s infinite ease-in-out alternate;
}

@keyframes blob-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5vw, 6vh) scale(1.06); }
  100% { transform: translate(-3vw, 10vh) scale(0.96); }
}

@keyframes blob-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(1.08); }
  100% { transform: translate(4vw, 5vh) scale(0.94); }
}

@keyframes blob-float-3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -8vh) scale(1.06); }
  100% { transform: translate(-4vw, -4vh) scale(0.95); }
}

@keyframes blob-float-4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(1.08); }
  100% { transform: translate(6vw, -10vh) scale(0.95); }
}

.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  color: var(--heading);
  letter-spacing: -0.025em;
  font-weight: 700;
}

.brand-gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

code, kbd, pre, samp {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- 4. HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  height: 60px;
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-headings);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--brand-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-logo .brand-maf {
  color: #0f172a;
}

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

.brand-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--body);
  transition: color 0.15s ease;
}

.header-nav a:hover, .header-nav a.active {
  color: var(--brand-blue);
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--heading);
  min-width: 44px;
  min-height: 44px;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-popover);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-drawer.open {
  display: flex;
}

/* --- 5. COMPACT HERO (<140px tall) --- */
.hero-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  animation: pulseAnim 2s infinite ease-in-out;
}

@keyframes pulseAnim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.hero-privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  background: rgba(241, 245, 249, 0.7);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.hero-privacy-note svg {
  color: var(--status-success-text);
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--body);
  line-height: 1.4;
}

/* --- 6. TOOLBAR --- */
.tool-toolbar {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-tabs {
  display: flex;
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  padding: 3px;
  border-radius: 10px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  min-height: 36px;
}

.view-tab-btn.active {
  background: #ffffff;
  color: var(--heading);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.view-tab-btn .tab-badge {
  font-size: 0.7rem;
  background: var(--status-error-bg);
  color: var(--status-error-text);
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
}

/* Common Button Styles */
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  min-height: 40px;
  min-width: 44px;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

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

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--heading);
}

.btn-secondary:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: #fafbff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--body);
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--heading);
}

.btn-icon {
  padding: 0.5rem;
  min-width: 40px;
  min-height: 40px;
}

/* Progress Bar (Worker) */
.worker-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(37, 99, 235, 0.1);
  overflow: hidden;
  position: relative;
  display: none;
}

.worker-progress-bar.active {
  display: block;
}

.worker-progress-inner {
  height: 100%;
  background: var(--brand-gradient);
  width: 0%;
  transition: width 0.2s ease;
}

/* --- 7. WORKSPACE (SPLIT SCREEN) --- */
.workspace-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Live Summary Sub-bar */
.summary-subbar {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.summary-chips-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.summary-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--heading);
  margin-right: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-chip {
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  min-height: 28px;
}

.filter-chip:hover {
  background: #e2e8f0;
  color: var(--heading);
}

.filter-chip.active {
  background: var(--heading);
  color: #ffffff;
  border-color: var(--heading);
  font-weight: 600;
}

.filter-chip .chip-count {
  font-weight: 700;
}

.summary-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.search-input-box svg {
  position: absolute;
  left: 0.65rem;
  color: var(--muted);
  pointer-events: none;
}

.search-input-box input {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--heading);
  width: 190px;
  transition: width 0.2s ease, border-color 0.15s ease;
}

.search-input-box input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  width: 230px;
}

/* Split Pane Grid Container */
.split-panes-container {
  display: flex;
  width: 100%;
  height: calc(100dvh - 210px);
  min-height: 560px;
  position: relative;
  gap: 0;
}

/* Editor Pane Card */
.editor-pane {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  position: relative;
  flex: 1;
}

.pane-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.pane-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pane-indicator-a { background: #2563eb; }
.pane-indicator-b { background: #7c3aed; }
.pane-indicator-c { background: #10b981; }

.pane-name-input {
  font-family: var(--font-headings);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--heading);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  width: auto;
  max-width: 220px;
  cursor: text;
}

.pane-name-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--card-border);
}

.pane-actions-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pane-stats-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.pane-action-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  min-width: 32px;
  min-height: 32px;
}

.pane-action-btn:hover {
  background: #e2e8f0;
  color: var(--heading);
}

.pane-action-btn.btn-danger:hover {
  background: #fee2e2;
  color: var(--status-error-text);
}

/* Editor Body & Line Number Gutter */
.editor-body-wrapper {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fbfcfe;
}

.line-numbers-gutter {
  width: 46px;
  background: #f1f5f9;
  border-right: 1px solid var(--card-border);
  padding: 0.75rem 0.4rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #94a3b8;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}

.editor-textarea {
  flex: 1;
  height: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--heading);
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

.editor-textarea::placeholder {
  color: #94a3b8;
  font-style: italic;
}

/* Draggable Vertical Divider */
.split-divider {
  width: 12px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 0 -3px;
  user-select: none;
}

.split-divider::after {
  content: '';
  width: 2px;
  height: 48px;
  border-radius: 2px;
  background: #cbd5e1;
  transition: all 0.15s ease;
}

.split-divider:hover::after, .split-divider.dragging::after {
  background: var(--brand-blue);
  width: 4px;
  height: 80px;
}

/* Drop Overlay during drag & drop file upload */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 2px dashed var(--brand-blue);
  border-radius: var(--radius-card);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  font-family: var(--font-headings);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-blue);
  backdrop-filter: blur(2px);
}

.editor-pane.drag-over .drop-overlay {
  display: flex;
}

/* --- 8. RESULTS MATRIX TABLE (TAB 2) --- */
.results-matrix-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0.5rem;
}

.matrix-header-bar {
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.matrix-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 65vh;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.matrix-table th {
  background: #f1f5f9;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  vertical-align: middle;
}

.matrix-table tr:hover {
  background: rgba(248, 250, 252, 0.75);
}

.key-code-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand-violet);
  background: rgba(124, 58, 237, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: inline-block;
}

.value-masked-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.value-masked-box .reveal-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-blue);
  padding: 2px;
  border-radius: 4px;
}

.value-revealed-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--heading);
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  word-break: break-all;
}

/* Status Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.badge-success {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}

.badge-warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning-text);
}

.badge-danger {
  background: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  color: var(--status-error-text);
}

.badge-info {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
}

.badge-purple {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #7e22ce;
}

.badge-neutral {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: var(--muted);
}

/* Issues in Table */
.issue-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.issue-chip:last-child {
  margin-bottom: 0;
}

.issue-chip.issue-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.issue-chip.issue-security {
  background: var(--status-error-bg);
  color: var(--status-error-text);
  border: 1px solid var(--status-error-border);
  font-weight: 600;
}

/* Empty State */
.table-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.table-empty-state svg {
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

/* --- 9. FOCUS MODE (FULLSCREEN OVERLAY) --- */
body.focus-mode-active .workspace-wrapper {
  position: fixed;
  inset: 0;
  max-width: 100vw;
  height: 100vh;
  z-index: 100;
  background: #ffffff;
  padding: 1rem;
  margin: 0;
}

body.focus-mode-active .site-header,
body.focus-mode-active .hero-section,
body.focus-mode-active .seo-content-section,
body.focus-mode-active .site-footer {
  display: none !important;
}

body.focus-mode-active .split-panes-container {
  height: calc(100vh - 120px);
}

/* --- 10. MODALS & FLYOUTS --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.15s ease-out;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
  min-width: 32px;
  min-height: 32px;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--heading);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.9rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Modal Textarea */
.modal-code-area {
  width: 100%;
  height: 280px;
  background: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 1rem;
  border-radius: 8px;
  border: none;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}

/* Popover Menu */
.popover-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  min-width: 240px;
  z-index: 50;
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.popover-menu.open {
  display: flex;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  color: var(--heading);
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s ease;
}

.popover-item:hover {
  background: #f1f5f9;
}

/* --- 11. TOAST / NOTIFICATION (Copied! Green State) --- */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 300;
  border-left: 4px solid var(--status-success-text);
  animation: toastFade 0.2s ease-out;
}

.toast-notification.show {
  display: flex;
}

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

/* Live aria-status announcer (visually hidden) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 12. SEO CONTENT SECTION (Below The Fold) --- */
.seo-content-section {
  max-width: 1100px;
  width: 100%;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.seo-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.seo-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.seo-card h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

.seo-card p {
  color: var(--body);
  margin-bottom: 1rem;
  line-height: 1.65;
}

.seo-card ol, .seo-card ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--body);
  line-height: 1.65;
}

.seo-card li {
  margin-bottom: 0.5rem;
}

.seo-code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}

/* FAQ Details Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand-blue);
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--body);
  font-size: 0.925rem;
  line-height: 1.6;
}

/* --- 13. FOOTER --- */
.site-footer {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 2rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-tools-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-tools-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.footer-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.footer-tool-card {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.footer-tool-card:hover {
  background: #ffffff;
  border-color: var(--brand-blue);
  transform: translateY(-1px);
}

.footer-tool-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--card-border);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Sticky Bottom Action Bar for Mobile (<900px) */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 0.65rem 1rem;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* --- 14. RESPONSIVE BREAKPOINTS --- */
@media (max-width: 900px) {
  .split-panes-container {
    flex-direction: column;
    height: auto;
    min-height: auto;
    gap: 1rem;
  }

  .editor-pane {
    min-height: 60dvh;
    height: 60dvh;
  }

  .split-divider {
    display: none;
  }

  .mobile-sticky-bar {
    display: flex;
  }

  .workspace-wrapper {
    padding-bottom: 70px;
  }
}

@media (max-width: 700px) {
  .header-nav {
    display: none;
  }

  .hamburger-btn {
    display: inline-flex;
  }

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

  .tool-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left, .toolbar-right {
    justify-content: space-between;
  }

  .search-input-box {
    width: 100%;
  }

  .search-input-box input {
    width: 100% !important;
  }

  .summary-subbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
