/* =======================================================================
   ANALYZER V3 - CYBER-INTEL COMMAND CENTER
   High-contrast dark theme with mission-launch experience
   ======================================================================= */

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

/* =======================================================================
   CSS VARIABLES - HIGH CONTRAST DARK THEME
   ======================================================================= */
:root {
  /* Core Colors */
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1419;
  --bg-tertiary: #151b24;
  --bg-card: rgba(20, 27, 38, 0.8);

  /* HIGH CONTRAST Text - WCAG 2.2 AA compliant */
  --text-primary: #ffffff; /* 14.7:1 on #0a0d14 */
  --text-secondary: #c9d1d9; /* 8.5:1 on #0a0d14 */
  --text-tertiary: #b1bac4; /* 6.3:1 on #0a0d14 - was #8b949e (4.0:1 FAIL) */
  --text-muted: #9ca3af; /* 4.6:1 on #0a0d14 - was #6e7681 (3.1:1 FAIL) */

  /* Accent Colors */
  --neon-blue: #58a6ff;
  --neon-purple: #a371f7;
  --neon-green: #3fb950;
  --neon-orange: #d29922;
  --neon-red: #f85149;
  --neon-cyan: #39d4e9;

  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
  --gradient-purple: linear-gradient(135deg, #a371f7 0%, #8957e5 100%);
  --gradient-green: linear-gradient(135deg, #3fb950 0%, #238636 100%);

  /* Glass Effects */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 40px rgba(88, 166, 255, 0.15);
  --shadow-glow-green: 0 0 40px rgba(63, 185, 80, 0.15);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --font-display: "Playfair Display", Georgia, serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* =======================================================================
   BASE STYLES
   ======================================================================= */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Selection */
::selection {
  background: var(--neon-blue);
  color: white;
}

/* =======================================================================
   KEYFRAME ANIMATIONS
   ======================================================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(88, 166, 255, 0);
  }
}

@keyframes gridPan {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(40px, 40px);
  }
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes portalPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(88, 166, 255, 0.3),
      0 0 40px rgba(88, 166, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 20px rgba(88, 166, 255, 0),
      0 0 60px rgba(88, 166, 255, 0.2);
  }
}

@keyframes scanLine {
  0% {
    top: -5%;
    opacity: 1;
  }
  100% {
    top: 105%;
    opacity: 0.3;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 8px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 16px currentColor);
  }
}

@keyframes shieldPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* =======================================================================
   LAYOUT - MAIN CONTAINER
   ======================================================================= */
.analyzer-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

/* Background Effects */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(88, 166, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    black 30%,
    transparent 80%
  );
  animation: gridPan 60s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-orb {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(
    circle,
    rgba(88, 166, 255, 0.08) 0%,
    rgba(163, 113, 247, 0.04) 40%,
    transparent 70%
  );
  filter: blur(80px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-orb-2 {
  position: fixed;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(163, 113, 247, 0.06) 0%,
    transparent 60%
  );
  filter: blur(60px);
  top: 30%;
  right: 10%;
  animation: orbFloat 10s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: 0;
}

/* =======================================================================
   NAVIGATION BAR
   ======================================================================= */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: white;
}

.nav-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

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

.btn-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav:hover {
  background: var(--glass-border);
  border-color: var(--glass-border-hover);
}

.btn-nav svg {
  width: 16px;
  height: 16px;
}

/* =======================================================================
   HERO HEADER
   ======================================================================= */
.analyzer-header {
  text-align: center;
  z-index: 2;
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.6s ease-out;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  color: var(--neon-blue);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #c9d1d9 50%, #8b949e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* =======================================================================
   MAIN INTERFACE CARD
   ======================================================================= */
.scan-interface-card {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  z-index: 2;
  box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
  animation: scaleIn 0.5s ease-out 0.2s backwards;
}

/* =======================================================================
   INPUT TABS
   ======================================================================= */
.input-tabs {
  display: flex;
  gap: var(--space-xs);
  background: rgba(0, 0, 0, 0.3);
  padding: var(--space-sm);
  margin: var(--space-sm);
  border-radius: var(--radius-lg);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: rgba(88, 166, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.tab-btn.active svg {
  opacity: 1;
  color: var(--neon-blue);
}

/* =======================================================================
   PORTAL DROP ZONE
   ======================================================================= */
.portal-drop-zone {
  margin: var(--space-md);
  padding: var(--space-3xl) var(--space-xl);
  border: 2px dashed rgba(88, 166, 255, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.3s ease;
  background: radial-gradient(
    ellipse at center,
    rgba(88, 166, 255, 0.04) 0%,
    transparent 70%
  );
  position: relative;
  cursor: pointer;
}

.portal-drop-zone:hover,
.portal-drop-zone.drag-over {
  border-color: var(--neon-blue);
  background: radial-gradient(
    ellipse at center,
    rgba(88, 166, 255, 0.08) 0%,
    transparent 70%
  );
}

.portal-drop-zone.drag-over {
  transform: scale(0.99);
  animation: portalPulse 1.5s ease-in-out infinite;
}

/* Portal Ring Animation */
.portal-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(88, 166, 255, 0.1);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portal-drop-zone:hover .portal-ring {
  opacity: 1;
  animation: portalPulse 2s ease-in-out infinite;
}

/* Portal Icon */
.portal-icon {
  width: 88px;
  height: 88px;
  background: linear-gradient(
    135deg,
    rgba(88, 166, 255, 0.15) 0%,
    rgba(163, 113, 247, 0.15) 100%
  );
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  color: var(--neon-blue);
  transition: all 0.3s ease;
}

.portal-drop-zone:hover .portal-icon {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.2);
}

.portal-icon svg {
  width: 36px;
  height: 36px;
}

.portal-drop-zone h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.meta-text {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

/* Browse Button */
.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-browse:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

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

/* Security Badge */
.security-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: 10px 16px;
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--neon-green);
}

.security-badge svg {
  animation: shieldPulse 2s ease-in-out infinite;
}

/* =======================================================================
   TEXT INPUT ZONE
   ======================================================================= */
.text-input-zone {
  margin: var(--space-md);
  padding: var(--space-md);
}

.text-input-zone textarea {
  width: 100%;
  min-height: 280px;
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: all 0.2s ease;
}

.text-input-zone textarea::placeholder {
  color: var(--text-muted);
}

.text-input-zone textarea:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.text-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: var(--gradient-blue);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =======================================================================
   PERSONA SELECTOR
   ======================================================================= */
.persona-section {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.persona-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.persona-label svg {
  width: 16px;
  height: 16px;
  color: var(--neon-purple);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.persona-option {
  position: relative;
}

.persona-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.persona-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.persona-option label:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border-hover);
}

.persona-option input:checked + label {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--neon-blue);
}

.persona-icon {
  font-size: 24px;
}

.persona-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.persona-option input:checked + label .persona-name {
  color: var(--text-primary);
}

/* =======================================================================
   SCANNING TERMINAL
   ======================================================================= */
.scan-terminal {
  position: relative;
  margin: var(--space-md);
  background: #000000;
  border: 1px solid #1a1a1a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) {
  background: #ff5f57;
}
.terminal-dots span:nth-child(2) {
  background: #febc2e;
}
.terminal-dots span:nth-child(3) {
  background: #28c840;
}

.terminal-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--neon-blue);
  animation: blink 1s infinite;
}

.terminal-status svg {
  width: 14px;
  height: 14px;
  animation: glowPulse 1.5s ease-in-out infinite;
}

.terminal-window {
  position: relative;
  height: 320px;
  padding: var(--space-md);
  overflow: hidden;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-green),
    transparent
  );
  box-shadow: 0 0 20px var(--neon-green);
  animation: scanLine 2.5s ease-in-out infinite;
  pointer-events: none;
}

.terminal-log {
  height: 100%;
  overflow-y: auto;
  color: var(--neon-green);
  font-size: 13px;
  line-height: 1.8;
}

.terminal-log::-webkit-scrollbar {
  width: 6px;
}

.terminal-log::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-log::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.terminal-line {
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.3s ease;
}

.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.terminal-line .ok {
  color: var(--neon-green);
  font-weight: 600;
}

.terminal-line .warn {
  color: var(--neon-orange);
}

.terminal-line .error {
  color: var(--neon-red);
}

.terminal-line .info {
  color: var(--neon-blue);
}

.terminal-line .timestamp {
  color: var(--text-muted);
  font-size: 11px;
}

.terminal-line.dim {
  color: var(--text-tertiary);
  opacity: 0.8;
}

.terminal-line.header {
  color: var(--neon-cyan);
  font-weight: 600;
  font-size: 14px;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--neon-green);
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}

/* Progress Bar in Terminal */
.terminal-progress {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--text-tertiary);
}

.progress-meta strong {
  color: var(--neon-cyan);
  font-weight: 600;
}

/* =======================================================================
   SCAN FAQ (shown during analysis)
   v27.3: Collapsible FAQ to answer common questions while scanning
   ======================================================================= */
.scan-faq {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.faq-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.faq-header svg {
  color: var(--neon-cyan);
  opacity: 0.7;
}

.faq-item {
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  list-style: none;
}

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

.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}

.faq-item[open] summary {
  background: rgba(0, 255, 136, 0.05);
  border-color: rgba(0, 255, 136, 0.2);
  color: var(--text-primary);
}

.faq-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.faq-question {
  flex: 1;
  font-weight: 500;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--neon-green);
}

.faq-answer {
  padding: var(--space-md);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.faq-answer strong {
  color: var(--neon-green);
}

.faq-answer a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

/* v27.4: Enhanced FAQ header with trust badges */
.faq-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.faq-trust-badges {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  color: var(--neon-green);
  white-space: nowrap;
}

.trust-badge svg {
  flex-shrink: 0;
}

/* v27.4: Icon wrap in summary */
.faq-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.faq-icon-wrap svg {
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

.faq-item[open] .faq-icon-wrap {
  background: rgba(0, 255, 136, 0.1);
}

.faq-item[open] .faq-icon-wrap svg {
  color: var(--neon-green);
}

/* v27.4: Answer grid with points */
.faq-answer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.faq-point:hover {
  background: rgba(255, 255, 255, 0.04);
}

.faq-point-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

.faq-point-secure {
  background: rgba(0, 255, 136, 0.15);
  color: var(--neon-green);
}

.faq-point-info {
  background: rgba(0, 212, 255, 0.15);
  color: var(--neon-cyan);
}

.faq-point-warn {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.faq-point span:last-child {
  flex: 1;
  line-height: 1.5;
}

.faq-point strong {
  color: var(--text-primary);
}

/* Responsive: Stack trust badges on mobile */
@media (max-width: 600px) {
  .faq-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .faq-trust-badges {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .trust-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* =======================================================================
   UPLOAD PROGRESS BAR (new)
   ======================================================================= */
.upload-progress {
  margin: var(--space-md);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.upload-progress-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.upload-progress-percent {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--neon-blue);
  font-size: 14px;
}

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

.upload-progress-fill {
  height: 100%;
  background: var(--gradient-blue);
  border-radius: 4px;
  transition: width 0.1s linear;
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* =======================================================================
   FILE PREVIEW (after selection)
   ======================================================================= */
.file-preview {
  margin: var(--space-md);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.file-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.file-icon {
  width: 56px;
  height: 56px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-blue);
}

.file-icon svg {
  width: 28px;
  height: 28px;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-all;
}

.file-meta {
  font-size: 13px;
  color: var(--text-tertiary);
}

.file-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-icon.danger:hover {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--neon-red);
}

.file-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--glass-border);
}

.btn-secondary {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-scan {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  background: var(--gradient-blue);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-scan:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
}

.btn-scan svg {
  width: 18px;
  height: 18px;
}

/* =======================================================================
   TRUST INDICATORS
   ======================================================================= */
.trust-section {
  margin-top: var(--space-2xl);
  text-align: center;
  z-index: 2;
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.trust-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.trust-badge svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* =======================================================================
   FOOTER - Centered, polished dark theme footer
   ======================================================================= */
.analyzer-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(
    to top,
    rgba(10, 13, 20, 0.98) 0%,
    rgba(10, 13, 20, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  z-index: 50;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
  padding: 4px 8px;
  border-radius: 4px;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.footer-link:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Separator dots between links */
.footer-links .footer-link:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  margin-left: var(--space-lg);
  opacity: 0.4;
  vertical-align: middle;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

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

/* v28.5: Tablet breakpoint (768-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .analyzer-container {
    padding: 120px var(--space-lg) 80px;
  }

  .scan-interface-card {
    max-width: 700px;
  }

  .persona-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .trust-badges {
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .hero-sub {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .analyzer-container {
    padding: 100px var(--space-md) 80px;
  }

  .nav-bar {
    padding: var(--space-sm) var(--space-md);
  }

  .nav-link {
    display: none;
  }

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

  .hero-sub {
    font-size: 1rem;
  }

  .scan-interface-card {
    border-radius: var(--radius-lg);
  }

  .input-tabs {
    margin: var(--space-xs);
    padding: var(--space-xs);
  }

  .tab-btn {
    padding: 12px var(--space-sm);
    font-size: 13px;
  }

  .portal-drop-zone {
    margin: var(--space-sm);
    padding: var(--space-xl) var(--space-md);
  }

  .portal-icon {
    width: 72px;
    height: 72px;
  }

  .portal-icon svg {
    width: 28px;
    height: 28px;
  }

  .persona-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-badges {
    gap: var(--space-md);
  }

  .trust-badge {
    font-size: 12px;
  }

  .analyzer-footer {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-xs);
  }

  .footer-links {
    gap: var(--space-sm);
  }

  .footer-link {
    font-size: 12px;
    padding: 3px 6px;
  }

  /* Hide separators on mobile for cleaner look */
  .footer-links .footer-link:not(:last-child)::after {
    display: none;
  }

  .footer-copy {
    font-size: 11px;
  }

  /* v28.5: Prevent iOS zoom on input focus - must be 16px minimum */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Text input zone adjustments */
  .text-input-zone textarea {
    min-height: 200px;
    font-size: 16px;
  }
}

/* =======================================================================
   ACCESSIBILITY - FOCUS STATES
   ======================================================================= */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-scan:focus-visible,
.btn-browse:focus-visible,
.btn-nav:focus-visible,
.btn-icon:focus-visible {
  outline: 3px solid var(--neon-blue);
  outline-offset: 2px;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: -2px;
}

.persona-option input:focus-visible + label {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
}

textarea:focus-visible {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* =======================================================================
   v28.5: CHARACTER COUNTER THRESHOLD ANIMATION
   ======================================================================= */
.char-counter.threshold-reached {
  animation: thresholdPulse 0.6s ease-out;
}

@keyframes thresholdPulse {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* =======================================================================
   v28.5: BUTTON LOADING SPINNER
   ======================================================================= */
button .spinner {
  margin-right: 8px;
}

button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.85;
}

/* =======================================================================
   REDUCED MOTION SUPPORT
   ======================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg-grid,
  .bg-glow-orb,
  .bg-glow-orb-2 {
    animation: none !important;
  }

  .scan-line {
    display: none;
  }
}

/* =======================================================================
   CHARACTER COUNTER
   ======================================================================= */
.char-counter {
  font-size: 12px;
  font-weight: 500;
  margin-top: var(--space-sm);
  transition: color 0.2s ease;
}

.char-counter.insufficient {
  color: var(--text-muted);
}

.char-counter.sufficient {
  color: var(--neon-green);
}

/* =======================================================================
   FILE SIZE INDICATOR
   ======================================================================= */
.file-size-indicator {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  margin-left: var(--space-sm);
}

.file-size-indicator.size-small {
  background: rgba(63, 185, 80, 0.15);
  color: var(--neon-green);
}

.file-size-indicator.size-medium {
  background: rgba(251, 191, 36, 0.15);
  color: var(--neon-orange);
}

.file-size-indicator.size-large {
  background: rgba(248, 81, 73, 0.15);
  color: var(--neon-red);
}

/* =======================================================================
   SKIP ANIMATION BUTTON
   ======================================================================= */
.btn-skip {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-skip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-skip:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
}

/* =======================================================================
   NOTIFICATION SYSTEM
   ======================================================================= */
.notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 14px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 200;
}

.notification.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.notification.error {
  background: rgba(248, 81, 73, 0.15);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--neon-red);
}

.notification.success {
  background: rgba(63, 185, 80, 0.15);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--neon-green);
}

/* =======================================================================
   UTILITY CLASSES
   ======================================================================= */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =======================================================================
   v29.5: PREFLIGHT WARNING - High demand notification
   ======================================================================= */
.preflight-warning {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(100, 181, 246, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

.preflight-warning.high {
  background: linear-gradient(135deg, #5c1e1e 0%, #8b3232 100%);
  border-color: rgba(248, 113, 113, 0.4);
}

.preflight-warning.medium {
  background: linear-gradient(135deg, #5c4b1e 0%, #8b7632 100%);
  border-color: rgba(251, 191, 36, 0.4);
}

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

.preflight-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.preflight-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.preflight-text {
  flex: 1;
}

.preflight-text strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.preflight-text p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.preflight-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.preflight-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.preflight-btn.primary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.preflight-btn.primary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.preflight-btn.secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

@media (max-width: 600px) {
  .preflight-content {
    flex-wrap: wrap;
  }
  .preflight-actions {
    width: 100%;
    margin-top: 12px;
  }
  .preflight-btn {
    flex: 1;
    text-align: center;
  }
}

/* =======================================================================
   v29.6: SKIP LINK - Moved from inline styles for CSP compliance
   ======================================================================= */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--neon-blue);
  color: white;
  padding: 8px 16px;
  z-index: 9999;
  transition: top 0.2s ease;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* =======================================================================
   v29.6: CANCEL ANALYSIS BUTTON
   ======================================================================= */
.btn-cancel {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: 8px 16px;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-full);
  color: var(--neon-red);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-cancel:hover {
  background: rgba(248, 81, 73, 0.2);
  border-color: rgba(248, 81, 73, 0.5);
}

.btn-cancel:focus-visible {
  outline: 2px solid var(--neon-red);
  outline-offset: 2px;
}

/* =======================================================================
   v29.6: FIREFOX SCROLLBAR SUPPORT
   ======================================================================= */
.terminal-log {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

/* =======================================================================
   v29.6: KEYBOARD SHORTCUT HINTS
   ======================================================================= */
.keyboard-hints {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .keyboard-hints {
    display: none; /* Hide on mobile - keyboard shortcuts less relevant */
  }
}
