/* ==================== MODERN PREMIUM DESIGN FOR WEBSITE SCANNER ==================== */
/* This CSS replaces the old inline styles with glassmorphism and modern animations */
/* ALL HTML structure and functionality remains unchanged */

:root {
  /* Tagshot.app Design - Light Mode (Always) */
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #000000;
  --muted: #4b5563;  /* WCAG AAA compliant contrast (was #555555) */

  /* Tagshot.app Colors */
  --brand: #0ea8ea;        /* Turquoise/Cyan */
  --brand-light: #a2d9e7;  /* Light Turquoise */
  --brand2: #7EBEC5;       /* Teal accent */
  --cta: #E02B20;          /* Red for CTAs */
  --cream: #f9f3d5;        /* Light cream for sections */

  --warn: #f59e0b;
  --bad: #E02B20;
  --ok: #10b981;

  --chip: #f3f4f6;
  --border: #d1d5db;

  /* Tagshot.app Drop Shadows (hard shadows, not blur) */
  --shadow-sm: 2px 2px 0px 0px rgba(0, 0, 0, 0.1);
  --shadow-md: 6px 6px 0px 0px rgba(0, 0, 0, 0.1);
  --shadow-lg: 10px 10px 0px 0px rgba(0, 0, 0, 0.15);
  --glow-cyan: 0 0 20px rgba(14, 168, 234, 0.3);
  --glow-red: 0 0 20px rgba(224, 43, 32, 0.3);

  /* Typography Scale - Consistent Hierarchy */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
}

/* Dark Mode with Neon Accents - 2025 Premium Design */
[data-theme="dark"] {
  /* Dark Backgrounds */
  --bg: #0a0e27;
  --panel: #141b35;
  --ink: #e8eaed;
  --muted: #9ca3af;

  /* Neon Brand Colors for Dark Mode */
  --brand: #00d4ff;           /* Brighter Cyan for dark */
  --brand-light: #66e0ff;     /* Light neon cyan */
  --brand2: #00ffcc;          /* Neon teal */
  --cta: #ff0844;             /* Neon red/pink */
  --cream: #1a2238;           /* Dark cream replacement */

  /* Dark UI Elements */
  --chip: #1f2937;
  --border: #374151;

  /* Dark Mode Shadows with Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);

  /* Neon Glows */
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.5), 0 0 40px rgba(0, 212, 255, 0.3);
  --glow-red: 0 0 20px rgba(255, 8, 68, 0.5), 0 0 40px rgba(255, 8, 68, 0.3);
  --glow-green: 0 0 20px rgba(0, 255, 204, 0.4);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);

  /* Success/Warning colors adjusted for dark */
  --ok: #00ffcc;
  --warn: #fbbf24;
  --bad: #ff0844;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

/* ==================== ACCESSIBILITY - WCAG 2.1 AA COMPLIANCE ==================== */
/* ==================== ENHANCED FOCUS STATES ==================== */

/* Remove default outline for non-keyboard navigation */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Beautiful focus for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow:
    0 0 0 6px rgba(14, 168, 234, 0.1),
    0 0 0 1px rgba(14, 168, 234, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Special focus styles for specific elements */

/* Buttons get slight scale */
button:focus-visible,
.btn:focus-visible {
  transform: scale(1.02);
  box-shadow:
    0 0 0 3px rgba(224, 43, 32, 0.2),
    var(--shadow-md);
}

.btn.alt:focus-visible {
  box-shadow:
    0 0 0 3px rgba(14, 168, 234, 0.2),
    var(--shadow-md);
}

/* Tabs get elevation */
.tab:focus-visible,
.pill:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(14, 168, 234, 0.15),
    6px 6px 0px 0px rgba(0, 0, 0, 0.12);
}

.tab.active:focus-visible {
  box-shadow:
    0 0 0 3px rgba(14, 168, 234, 0.3),
    6px 6px 0px 0px rgba(0, 0, 0, 0.15);
}

/* Input fields get glow */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand) !important;
  box-shadow:
    0 0 0 4px rgba(14, 168, 234, 0.15),
    0 0 20px rgba(14, 168, 234, 0.2) !important;
  transform: translateY(-1px);
}

/* Cards get subtle highlight */
.metric-card:focus-visible,
.compliance-item:focus-visible,
.issue-item:focus-visible,
.history-item:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow:
    0 0 0 6px rgba(14, 168, 234, 0.1),
    12px 12px 0px 0px rgba(0, 0, 0, 0.15);
  transform: translate(-2px, -2px);
}

/* Add focus indicator for skip link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em 1.5em;
  background: var(--brand);
  color: white;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-lg);
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  outline: 3px solid white;
  outline-offset: -3px;
}

/* Focus within states for better UX */
.urlfield:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 12px;
}

.toolbar:focus-within {
  background: rgba(14, 168, 234, 0.03);
  border-radius: 8px;
  transition: background 0.2s ease;
}

/* Ensure ARIA labels are properly announced */
[role="img"] {
  display: inline-block;
}

/* ==================== END ACCESSIBILITY ==================== */

/* Tagshot.app Style Background - Subtle Turquoise/Cyan hints */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(162, 217, 231, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(126, 190, 197, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(14, 168, 234, 0.04) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* Theme Toggle - Floating Action Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}

.theme-toggle:active {
  transform: scale(0.95) rotate(0deg);
}

/* Smooth theme transitions */
body,
.hero-section,
.metric-card,
.problem,
.cta-enhanced,
.urgency-banner,
.scan-progress,
input,
button,
.tab,
.card {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Hero Section - Tagshot.app Turquoise with Mesh Gradient */
.hero-section {
  background: linear-gradient(135deg, #a2d9e7 0%, #7EBEC5 100%);
  padding: 100px 20px 80px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

/* Mesh Gradient Background for Hero (Light Mode) */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 0.15) 0, transparent 50%),
    radial-gradient(at 97% 21%, hsla(180, 91%, 65%, 0.12) 0, transparent 50%),
    radial-gradient(at 52% 99%, hsla(186, 87%, 63%, 0.18) 0, transparent 50%),
    radial-gradient(at 10% 29%, hsla(189, 78%, 60%, 0.10) 0, transparent 50%),
    radial-gradient(at 97% 96%, hsla(194, 90%, 58%, 0.13) 0, transparent 50%);
  animation: meshGradient 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes meshGradient {
  0%, 100% {
    filter: hue-rotate(0deg);
    transform: scale(1);
  }
  50% {
    filter: hue-rotate(30deg);
    transform: scale(1.1);
  }
}

/* Dark Mode Hero */
[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #1a2238 0%, #0a0e27 100%);
}

[data-theme="dark"] .hero-section::before {
  background:
    radial-gradient(at 27% 37%, hsla(190, 98%, 61%, 0.25) 0, transparent 50%),
    radial-gradient(at 97% 21%, hsla(180, 91%, 65%, 0.20) 0, transparent 50%),
    radial-gradient(at 52% 99%, hsla(300, 87%, 63%, 0.18) 0, transparent 50%),
    radial-gradient(at 10% 29%, hsla(270, 78%, 60%, 0.15) 0, transparent 50%),
    radial-gradient(at 97% 96%, hsla(200, 90%, 58%, 0.22) 0, transparent 50%);
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin: 0 0 24px 0;
  color: var(--ink);
  line-height: 1.1;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out;
}

.hero-section .subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--muted);
  margin-bottom: 48px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CTA Box - Tagshot.app style with drop shadow */
.cta-enhanced {
  max-width: 600px;
  margin: 0 auto 40px auto;
  background: var(--panel);
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
  animation: fadeInUp 0.8s ease-out 0.4s both;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark Mode Glassmorphism for CTA */
[data-theme="dark"] .cta-enhanced {
  background: rgba(20, 27, 53, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cta-enhanced:hover {
  background: rgba(20, 27, 53, 0.95);
  box-shadow:
    0 20px 60px rgba(0, 212, 255, 0.15),
    var(--glow-cyan);
}

.cta-enhanced:hover {
  transform: translate(-3px, -3px);
  box-shadow: 13px 13px 0px 0px rgba(0, 0, 0, 0.2);
}

.cta-enhanced input {
  width: 100%;
  padding: 18px 24px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.1rem;
  margin-bottom: 16px;
  background: var(--panel);
  color: var(--ink);
  transition: all 0.3s ease;
  font-family: inherit;
}

.cta-enhanced input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 168, 234, 0.2);
  transform: translateY(-2px);
}

.cta-enhanced button {
  width: 100%;
  background: var(--cta);
  color: white;
  border: none;
  padding: 18px 56px 18px 28px; /* Extra right padding for arrow */
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* GPU acceleration */
  will-change: transform;
}

/* Enhanced Ripple Effect */
.cta-enhanced button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
  opacity: 0;
}

.cta-enhanced button:active::before {
  width: 400px;
  height: 400px;
  opacity: 1;
}

/* Dark Mode Button Glow */
[data-theme="dark"] .cta-enhanced button {
  background: linear-gradient(135deg, var(--cta) 0%, #d6002e 100%);
  box-shadow: var(--shadow-md), var(--glow-red);
}

[data-theme="dark"] .cta-enhanced button:hover {
  box-shadow:
    0 12px 40px rgba(255, 8, 68, 0.4),
    var(--glow-red);
  transform: translateY(-2px) scale(1.02);
}

/* Animated arrow on hover */
.cta-enhanced button::after {
  content: '→';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translate(-10px, -50%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.3rem;
  font-weight: 700;
}

.cta-enhanced button:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
  right: 20px;
}

.cta-enhanced button:hover {
  background: #c42418;
  transform: translate(-2px, -2px) scale(1.02);
  box-shadow: 12px 12px 0px 0px rgba(0, 0, 0, 0.2), var(--glow-red);
}

.cta-enhanced button:active {
  transform: translate(0, 0) scale(0.98);
  transition: all 0.1s ease;
}

.trust-signals {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--ok);
  flex-wrap: wrap;
}

.trust-signals span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Urgency Banner - Tagshot.app style */
.urgency-banner {
  background: var(--panel);
  border: 2px solid var(--bad);
  padding: 24px;
  margin: 0 20px 40px;
  border-radius: 8px;
  text-align: center;
  animation: pulseGlow 3s infinite;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-md);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: var(--shadow-md);
    transform: scale(1);
  }
  50% {
    box-shadow: 12px 12px 0px 0px rgba(224, 43, 32, 0.3);
    transform: scale(1.01);
  }
}

.urgency-banner h3 {
  color: var(--bad);
  margin: 0 0 12px 0;
  font-size: 1.4rem;
}

.urgency-banner p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

/* Example Problems Grid */
.example-findings {
  margin: 80px 0;
  padding: 0 20px;
}

.example-findings h3 {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 40px;
  color: var(--ink);
  font-weight: 800;
}

.problem-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.problem {
  background: var(--panel);
  border-left: 4px solid var(--bad);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid var(--border);
  border-left: 4px solid var(--bad);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark Mode Glassmorphism for Problem Cards */
[data-theme="dark"] .problem {
  background: rgba(20, 27, 53, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--bad);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .problem:hover {
  background: rgba(20, 27, 53, 0.8);
  box-shadow:
    0 12px 32px rgba(255, 8, 68, 0.15),
    var(--glow-red);
  border-left-color: var(--cta);
}

.problem:hover {
  transform: translate(-3px, -3px);
  box-shadow: 13px 13px 0px 0px rgba(0, 0, 0, 0.15);
  border-left-width: 6px;
}

.problem-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.problem-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.problem-impact {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Progress Container - Tagshot.app style */
.scan-progress {
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 8px;
  padding: 32px;
  margin: 40px auto;
  max-width: 800px;
  display: none;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease-out;
}

.scan-progress.active {
  display: block;
}

.progress-header {
  text-align: center;
  margin-bottom: 28px;
}

.progress-header h3 {
  margin: 0 0 12px 0;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
}

/* Progress Bar */
.main-progress {
  margin-bottom: 32px;
}

.progress-bar {
  height: 12px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand2) 100%);
  transition: width 0.5s ease;
  width: 0%;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

/* Scan Steps */
.scan-steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  padding: 16px;
  border-left: 3px solid transparent;
  padding-left: 20px;
  margin-left: 12px;
  border-radius: 0 12px 12px 0;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
}

.step.completed {
  border-color: var(--ok);
  background: rgba(34, 197, 94, 0.1);
}

.step.active {
  border-color: var(--brand);
  background: rgba(124, 58, 237, 0.1);
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
  0%, 100% { border-color: var(--brand); }
  50% { border-color: #6d28d9; }
}

.step.pending {
  border-color: var(--border);
  color: var(--muted);
}

.step-icon {
  width: 32px;
  height: 32px;
  margin-right: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step.completed .step-icon {
  background: var(--ok);
  color: white;
  box-shadow: var(--glow-green);
}

.step.active .step-icon {
  background: var(--brand);
  color: white;
  box-shadow: var(--glow-purple);
  animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.step.pending .step-icon {
  background: var(--border);
  color: var(--muted);
}

.step-text {
  flex: 1;
}

.step-duration {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* Live Log */
.live-log {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: 180px;
  overflow-y: auto;
}

.live-log h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}

.log-entry {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  margin: 4px 0;
  color: var(--muted);
  padding: 4px 0;
}

.log-entry.important {
  color: var(--brand);
  font-weight: 700;
}

/* Dashboard Results Metrics */
.results-dashboard {
  grid-column: span 12; /* Take full width in parent grid */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .results-dashboard {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark Mode Glassmorphism */
[data-theme="dark"] .metric-card {
  background: rgba(20, 27, 53, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.5),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .metric-card:hover {
  background: rgba(20, 27, 53, 0.85);
  border-color: var(--brand);
  box-shadow:
    0 8px 32px rgba(0, 212, 255, 0.2),
    var(--glow-cyan);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.metric-card.critical::before { background: linear-gradient(90deg, var(--bad), #dc2626); }
.metric-card.warning::before { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.metric-card.info::before { background: linear-gradient(90deg, var(--ok), #059669); }
.metric-card.money::before { background: linear-gradient(90deg, var(--bad), var(--warn)); }

.metric-card:hover {
  transform: translate(-3px, -3px) scale(1.02);
  box-shadow: 13px 13px 0px 0px rgba(0, 0, 0, 0.15);
}

/* Enhanced Icon Animation on Hover */
.metric-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover .metric-icon {
  animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-8px) scale(1.1); }
  50% { transform: translateY(-4px) scale(1.05); }
  75% { transform: translateY(-6px) scale(1.08); }
}

.metric-value {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover .metric-value {
  transform: scale(1.05);
}

.metric-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.metric-trend {
  font-size: 0.85rem;
  color: var(--ok);
  margin-top: 8px;
}

/* Banner (notifications) */
.banner {
  background: var(--brand);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
  position: sticky;
  top: 72px;
  z-index: 25;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main App Styles */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 100px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar .progress {
  height: 3px;
  background: var(--border);
  width: 100%;
  overflow: hidden;
}

.topbar .progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width 0.3s ease;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand .preview {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--brand), var(--brand2), var(--brand));
  animation: rotate 4s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.urlfield {
  flex: 1;
  display: flex;
  gap: 10px;
}

.urlfield input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--ink);
  font-family: inherit;
  transition: all 0.3s ease;
}

.urlfield input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 168, 234, 0.2);
}

.btn {
  background: var(--cta);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  transform: translateZ(0);
  will-change: transform;
}

.btn:hover {
  background: #c42418;
  transform: translate(-2px, -2px) scale(1.02);
  box-shadow: 8px 8px 0px 0px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translate(0, 0) scale(0.98);
  transition: all 0.1s ease;
}

/* Dark Mode Button Glow Effects */
[data-theme="dark"] .btn {
  background: linear-gradient(135deg, var(--cta) 0%, #d6002e 100%);
  box-shadow: var(--shadow-sm), var(--glow-red);
}

[data-theme="dark"] .btn:hover {
  box-shadow:
    0 8px 24px rgba(255, 8, 68, 0.4),
    var(--glow-red);
  transform: translateY(-2px) scale(1.05);
}

.btn.alt {
  background: var(--chip);
  color: var(--ink);
}

/* Dark Mode Alt Button */
[data-theme="dark"] .btn.alt {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn.alt:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 24px rgba(0, 212, 255, 0.3),
    var(--glow-cyan);
  border-color: var(--brand);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mode Toggle (Manager/Tech) */
.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toggle button {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.toggle button.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.toggle button:hover:not(.active) {
  background: var(--chip);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.1);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.tab {
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--panel);
  color: var(--muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  transform: translateZ(0);
}

.tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.tab:hover:not(.active) {
  background: var(--chip);
  transform: translate(-1px, -1px) scale(1.02);
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Tabs with Neon Glow */
[data-theme="dark"] .tab {
  background: rgba(20, 27, 53, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
}

[data-theme="dark"] .tab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
  color: var(--bg);
  border-color: var(--brand);
  box-shadow:
    var(--shadow-md),
    var(--glow-cyan);
}

[data-theme="dark"] .tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow:
    0 4px 16px rgba(0, 212, 255, 0.2);
}

/* Cards - Tagshot.app style */
.card {
  grid-column: span 12;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translate(-1px, -1px);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.toolbar .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar input {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  transition: all 0.3s ease;
  min-width: 200px;
}

.toolbar input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 168, 234, 0.2);
}

/* Pills (filter buttons) */
.pill {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.pill.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.pill:hover:not(.active) {
  background: var(--chip);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.1);
}

/* Utility row/flex */
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.right {
  margin-left: auto;
}

/* Compliance & Issues Lists - Tagshot.app style */
.compliance-item,
.issue-item {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.compliance-item:hover,
.issue-item:hover {
  box-shadow: 8px 8px 0px 0px rgba(0, 0, 0, 0.1);
  transform: translate(-2px, -2px);
}

.compliance-header,
.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.compliance-name,
.issue-type {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.1rem;
}

.compliance-body,
.issue-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compliance-impact,
.issue-message {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.compliance-meta,
.compliance-states {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.compliance-meta span,
.compliance-states span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.issue-translation {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.issue-fix {
  background: var(--cream);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--brand);
  font-size: 0.9rem;
}

.issue-mode {
  font-size: 0.85rem;
  color: var(--muted);
}

/* List container */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compliance-badge {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-perfect { background: #dcfce7; color: #166534; }
.badge-good { background: #fef9c3; color: #854d0e; }
.badge-inconsistent { background: #fef3c7; color: #92400e; }
.badge-bad { background: #fee2e2; color: #991b1b; }
.badge-missing { background: #f3f4f6; color: #4b5563; }

.issue-priority {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.priority-critical .issue-priority { background: #fee2e2; color: #991b1b; }
.priority-high .issue-priority { background: #fed7aa; color: #9a3412; }
.priority-medium .issue-priority { background: #fef3c7; color: #92400e; }
.priority-low .issue-priority { background: #dbeafe; color: #1e40af; }

/* History - Tagshot.app style */
.history-item {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.history-item:hover {
  box-shadow: 8px 8px 0px 0px rgba(0, 0, 0, 0.1);
  transform: translate(-2px, -2px);
}

/* Evidence Drawer - Tagshot.app style */
.drawer {
  position: fixed;
  top: 0;
  right: -500px;
  width: 500px;
  height: 100vh;
  background: var(--panel);
  border-left: 2px solid var(--border);
  box-shadow: -6px 0px 0px 0px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.drawer.open {
  right: 0;
}

.drawer header {
  padding: 20px 24px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
}

.drawer header .brand {
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Copy/Action Buttons */
button.copy {
  background: var(--chip);
  color: var(--ink);
  border: 2px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

button.copy:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.15);
}

.drawer button.copy {
  background: var(--cta);
  color: white;
  border-color: var(--cta);
}

.drawer button.copy:hover {
  background: #c42418;
  border-color: #c42418;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 2.5rem; }
  .hero-section .subtitle { font-size: 1.1rem; }
  .trust-signals { flex-direction: column; gap: 12px; }
  .problem-examples { grid-template-columns: 1fr; }
  .cta-enhanced { margin: 0 20px 40px 20px; }
  .results-dashboard { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; }
  .urlfield { width: 100%; }

  .drawer {
    width: 100%;
    right: -100%;
  }

  .drawer.open {
    right: 0;
  }
}

/* Utility classes */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-style: italic;
  font-size: 1.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--chip);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
}

/* Additional utility styles */
.risk {
  border-radius: 16px;
  padding: 20px;
  border: 2px solid var(--border);
  margin-top: 16px;
  font-weight: 600;
}

.risk.low { background: rgba(34, 197, 94, 0.1); border-color: var(--ok); }
.risk.med { background: rgba(245, 158, 11, 0.1); border-color: var(--warn); }
.risk.high { background: rgba(239, 68, 68, 0.1); border-color: var(--bad); }

/* Ensure all sections have proper styling */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 900px) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

/* Performance: GPU acceleration for animations */
.metric-card,
.problem,
.btn,
.tab,
.step,
.compliance-item,
.issue-item,
.history-item {
  will-change: transform;
}

/* ==================== COMPLIANCE MATRIX (2D Heatmap) ==================== */
.compliance-matrix-container {
  background: var(--panel);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

.compliance-matrix {
  min-width: 700px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.compliance-matrix-header {
  display: grid;
  grid-template-columns: 200px repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compliance-matrix-row {
  display: grid;
  grid-template-columns: 200px repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.matrix-tool-name {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.matrix-cell {
  position: relative;
  min-height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.matrix-cell:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

/* Cell states */
.matrix-cell.status-good {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.matrix-cell.status-bad {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.matrix-cell.status-unknown {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
}

/* Tooltip on hover */
.matrix-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.matrix-cell:hover::after {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .compliance-matrix-container {
    padding: 16px;
  }

  .compliance-matrix-header,
  .compliance-matrix-row {
    grid-template-columns: 150px repeat(3, 1fr);
    gap: 8px;
  }

  .matrix-tool-name {
    padding: 12px;
    font-size: 0.9rem;
  }

  .matrix-cell {
    min-height: 50px;
    font-size: 0.8rem;
  }
}

/* ==================== END COMPLIANCE MATRIX ==================== */

/* ==================== PREMIUM PRICING ==================== */
.pricing-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--muted);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-badge.pricing-popular {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.pricing-badge.pricing-premium {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.pricing-card h3 {
  margin: 16px 0 8px 0;
  font-size: 1.5rem;
  color: var(--ink);
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--brand);
  margin: 16px 0 24px 0;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.pricing-features li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.pricing-features li:last-child {
  border-bottom: none;
}

.btn-pricing {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-pricing.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
  color: white;
}

.btn-pricing.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-pricing.disabled {
  background: var(--chip);
  color: var(--muted);
  cursor: not-allowed;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table thead {
  background: var(--bg);
}

.comparison-table th,
.comparison-table td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  font-weight: 700;
  color: var(--ink);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.comparison-table tbody tr:hover {
  background: rgba(14, 168, 234, 0.05);
}

/* ==================== END PREMIUM PRICING ==================== */

/* ==================== SKELETON LOADING STATES ==================== */
.skeleton {
  background: linear-gradient(
    90deg,
    #f3f4f6 0%,
    #e5e7eb 50%,
    #f3f4f6 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton metric card */
.metric-card.skeleton {
  pointer-events: none;
  min-height: 180px;
}

.metric-card.skeleton * {
  opacity: 0;
}

.skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 auto 12px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-value {
  width: 80px;
  height: 48px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 auto 12px;
  border-radius: 8px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  animation-delay: 0.1s;
}

.skeleton-label {
  width: 120px;
  height: 20px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 auto;
  border-radius: 4px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  animation-delay: 0.2s;
}

/* Skeleton for compliance/issue items */
.list-item-skeleton {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.skeleton-title {
  width: 60%;
  height: 24px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-badge {
  width: 80px;
  height: 24px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  animation-delay: 0.1s;
}

.skeleton-text {
  width: 100%;
  height: 16px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  margin-bottom: 8px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  animation-delay: 0.2s;
}

.skeleton-text:last-child {
  width: 70%;
}

/* ==================== ENHANCED EMPTY STATES ==================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 5rem;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

.empty-state h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.empty-state p {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.empty-state .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1.05rem;
}

.empty-state .btn::after {
  content: '→';
  transition: transform 0.3s ease;
}

.empty-state .btn:hover::after {
  transform: translateX(4px);
}

/* Specific empty state variations */
.empty-state.no-history .empty-icon::after {
  content: '📜';
}

.empty-state.no-results .empty-icon::after {
  content: '🔍';
}

.empty-state.no-issues .empty-icon::after {
  content: '✅';
}

.empty-state.no-issues h3 {
  color: var(--ok);
}

/* Pulse animation for input when focused via empty state */
@keyframes pulseInput {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 168, 234, 0.7); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(14, 168, 234, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 168, 234, 0); }
}

/* ==================== MOBILE BOTTOM NAVIGATION ==================== */
@media (max-width: 768px) {
  /* Move tabs to bottom on mobile */
  .tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--panel);
    border-top: 3px solid var(--border);
    box-shadow:
      0 -4px 20px rgba(0, 0, 0, 0.1),
      0 -1px 0 rgba(0, 0, 0, 0.05);
    z-index: 100;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    flex-wrap: nowrap;
  }

  .tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  /* Mobile tab styling */
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    gap: 4px;
    min-width: 64px;
    max-width: 80px;
    font-size: 0.65rem;
    border-radius: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  /* Extract emoji from text and show as icon */
  .tab {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  /* Add bottom padding to content for bottom nav */
  .container {
    padding-bottom: 80px !important;
  }

  #mainApp .container {
    padding-bottom: 90px !important;
  }

  /* Make top bar more compact on mobile */
  .topbar {
    padding: 8px 12px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand {
    font-size: 0.95rem;
  }

  .brand .preview {
    display: none; /* Hide "Ergebnisse" text on mobile */
  }

  /* Compact URL input on mobile */
  .urlfield input {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  /* Floating Action Button for export on mobile */
  .fab-export {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cta);
    color: white;
    border: none;
    box-shadow:
      var(--shadow-lg),
      0 4px 20px rgba(224, 43, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99;
  }

  .fab-export:active {
    transform: scale(0.95);
  }

  /* Hide desktop export button on mobile */
  .topbar #exportPDFBtn {
    display: none;
  }

  /* Compact metric cards on mobile */
  .results-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .metric-label {
    font-size: 0.85rem;
  }

  /* Stack cards on very small screens */
  @media (max-width: 400px) {
    .results-dashboard {
      grid-template-columns: 1fr;
    }
  }
}

/* ==================== PROGRESSIVE DISCLOSURE / ACCORDIONS ==================== */
.accordion {
  border: 2px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  background: var(--panel);
}

.accordion:hover {
  box-shadow: var(--shadow-md);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.accordion-header:hover {
  background: rgba(14, 168, 234, 0.05);
}

.accordion-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.accordion-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(14, 168, 234, 0.1);
}

.accordion-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.accordion-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
}

.accordion-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.accordion-badge.status-ok {
  background: #dcfce7;
  color: #166534;
}

.accordion-badge.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.accordion-badge.status-critical {
  background: #fee2e2;
  color: #991b1b;
}

.accordion-arrow {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 12px;
}

.accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg);
}

.accordion.open .accordion-content {
  max-height: 5000px; /* Large enough for content */
}

.accordion-body {
  padding: 24px;
}

/* Stagger animation for items inside accordion */
.accordion.open .accordion-body > * {
  animation: fadeInUp 0.4s ease-out backwards;
}

.accordion.open .accordion-body > *:nth-child(1) { animation-delay: 0.05s; }
.accordion.open .accordion-body > *:nth-child(2) { animation-delay: 0.1s; }
.accordion.open .accordion-body > *:nth-child(3) { animation-delay: 0.15s; }
.accordion.open .accordion-body > *:nth-child(4) { animation-delay: 0.2s; }
.accordion.open .accordion-body > *:nth-child(5) { animation-delay: 0.25s; }

/* Control buttons */
.accordion-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.accordion-control-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accordion-control-btn:hover {
  background: var(--chip);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.1);
}

/* ==================== SMART FILTERING & SEARCH ==================== */
.search-filter-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  transition: all 0.3s ease;
  background: var(--panel);
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 168, 234, 0.1);
  outline: none;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Filter dropdown */
.filter-select {
  padding: 12px 36px 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23555" d="M1 1l5 5 5-5"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:hover {
  border-color: var(--brand);
  background-color: rgba(14, 168, 234, 0.02);
}

.filter-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 168, 234, 0.1);
  outline: none;
}

/* Filter pills */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  background: var(--chip);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.filter-pill.active:hover {
  background: #0c93cd;
  border-color: #0c93cd;
}

/* Search result highlighting */
.search-highlight {
  background: #fef08a;
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Results count */
.results-count {
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.results-count strong {
  color: var(--brand);
  font-weight: 700;
}

/* No results state */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.no-results .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.no-results p {
  margin: 0;
  font-size: 1.05rem;
}

/* ==================== CONTEXTUAL HELP & TOOLTIPS ==================== */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(14, 168, 234, 0.15);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.help-icon::before {
  content: '?';
}

.help-icon:hover {
  background: var(--brand);
  color: white;
  transform: scale(1.15);
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
  max-width: 300px;
  width: max-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Tooltip arrow */
.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

/* Show tooltip on hover */
.tooltip:hover .tooltip-text,
.help-icon:hover + .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip variants for different positions */
.tooltip-text.tooltip-right {
  bottom: auto;
  left: 125%;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
}

.tooltip-text.tooltip-right::after {
  top: 50%;
  left: -6px;
  margin-left: 0;
  margin-top: -6px;
  border-color: transparent var(--ink) transparent transparent;
}

.tooltip:hover .tooltip-text.tooltip-right {
  transform: translateY(-50%) translateX(0);
}

.tooltip-text.tooltip-left {
  bottom: auto;
  left: auto;
  right: 125%;
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
}

.tooltip-text.tooltip-left::after {
  top: 50%;
  right: -6px;
  left: auto;
  margin-top: -6px;
  border-color: transparent transparent transparent var(--ink);
}

.tooltip:hover .tooltip-text.tooltip-left {
  transform: translateY(-50%) translateX(0);
}

.tooltip-text.tooltip-bottom {
  bottom: auto;
  top: 125%;
  transform: translateX(-50%) translateY(8px);
}

.tooltip-text.tooltip-bottom::after {
  top: -6px;
  bottom: auto;
  border-color: transparent transparent var(--ink) transparent;
}

.tooltip:hover .tooltip-text.tooltip-bottom {
  transform: translateX(-50%) translateY(0);
}

/* Info box for inline help */
.info-box {
  background: rgba(14, 168, 234, 0.08);
  border-left: 4px solid var(--brand);
  padding: 16px 20px;
  border-radius: 6px;
  margin: 16px 0;
}

.info-box .icon {
  font-size: 1.2rem;
  margin-right: 8px;
}

.info-box p {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

.info-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--warn);
}

.info-box.error {
  background: rgba(224, 43, 32, 0.08);
  border-left-color: var(--bad);
}

.info-box.success {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--ok);
}

/* ==================== ENHANCED DATA VISUALIZATION ==================== */
.chart-container {
  position: relative;
  margin: 20px 0;
  padding: 20px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Interactive chart hover states */
canvas {
  cursor: pointer;
  transition: transform 0.2s ease;
}

canvas:hover {
  transform: scale(1.01);
}

/* Data point labels */
.data-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-item {
  background: var(--panel);
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-change {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: var(--ok);
}

.stat-change.negative {
  color: var(--bad);
}

/* Progress bars */
.progress-bar-enhanced {
  width: 100%;
  height: 24px;
  background: var(--chip);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill-enhanced {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #7EBEC5);
  border-radius: 12px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
}

.progress-fill-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

.progress-label {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ==================== TAB DROPDOWN (Info Architecture) ==================== */
.tab-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

.tab-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.tab-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(14, 168, 234, 0.08);
  color: var(--brand);
  padding-left: 20px;
}

.dropdown-item:active {
  background: rgba(14, 168, 234, 0.15);
}

.dropdown-item.active {
  background: rgba(14, 168, 234, 0.1);
  color: var(--brand);
  font-weight: 700;
}

/* Mobile dropdown adjustments */
@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    min-width: 280px;
  }

  .tab-dropdown.open .dropdown-menu {
    transform: translateX(-50%) translateY(0);
  }
}

/* ==================== METRIC CARD MICRO-INTERACTIONS ==================== */
.metric-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(14, 168, 234, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.metric-card:hover::before {
  left: 100%;
}

.metric-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 8px 30px rgba(14, 168, 234, 0.15);
}

.metric-card:active {
  transform: translateY(-2px) scale(0.99);
  transition: all 0.1s ease;
}

/* Metric icon animation on hover */
.metric-card:hover .metric-icon {
  animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.2) rotate(-5deg); }
  60% { transform: scale(0.95) rotate(5deg); }
}

/* Metric value counter animation */
.metric-value {
  transition: all 0.3s ease;
}

.metric-card:hover .metric-value {
  color: var(--brand);
  transform: scale(1.05);
}

/* ==================== URGENCY BANNER ENHANCEMENT ==================== */
@keyframes urgentPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(224, 43, 32, 0.7);
    transform: scale(1);
    border-color: var(--bad);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(224, 43, 32, 0);
    transform: scale(1.02);
    border-color: #ff6b6b;
  }
}

.urgency-banner {
  animation: urgentPulse 2.5s ease-in-out infinite;
  transition: all 0.3s ease;
}

.urgency-banner:hover {
  animation-play-state: paused;
  transform: scale(1.01);
}

/* ==================== TREND INDICATORS ==================== */
.metric-trend-enhanced {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.trend-arrow {
  font-size: 1rem;
  font-weight: 700;
}

.metric-trend-enhanced.positive {
  color: var(--ok);
}

.metric-trend-enhanced.positive .trend-arrow {
  animation: arrowUp 1s ease infinite;
}

@keyframes arrowUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.metric-trend-enhanced.negative {
  color: var(--bad);
}

.metric-trend-enhanced.negative .trend-arrow {
  animation: arrowDown 1s ease infinite;
}

@keyframes arrowDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.metric-trend-enhanced.neutral {
  color: var(--muted);
}

.trend-value {
  font-weight: 700;
}

.trend-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Sparkline mini-chart */
.sparkline {
  width: 100%;
  height: 30px;
  margin-top: 8px;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* GPU Acceleration for 60fps animations */
.metric-card,
.problem,
.btn,
.tab,
.compliance-item,
.dropdown-menu,
.urgency-banner,
.card,
.cta-enhanced button {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Reduced motion support for Accessibility (WCAG 2.1) */
@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;
  }

  /* Disable hover transforms for reduced motion */
  .metric-card:hover,
  .btn:hover,
  .tab:hover {
    transform: none !important;
  }
}

/* ==================== ACCESSIBILITY ==================== */
/* Screen Reader Only - visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==================== KEYBOARD SHORTCUTS ==================== */
/* Toast animations for keyboard shortcut feedback */
@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100px);
    opacity: 0;
  }
}

/* ==================== TOUCH GESTURES ==================== */
/* Swipe feedback animation */
@keyframes swipeFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* ==================== GAMIFICATION SYSTEM ==================== */
/* Achievement notification animations */
@keyframes achievementSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes achievementSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Achievement notification styling */
.achievement-notification {
  display: flex;
  gap: 16px;
  align-items: center;
}

.achievement-icon {
  font-size: 3rem;
  line-height: 1;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.achievement-content {
  flex: 1;
}

.achievement-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.achievement-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.875rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.achievement-points {
  font-size: 1rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
}

/* Gamification badge in topbar */
.gamification-badge {
  user-select: none;
  cursor: default;
  transition: all 0.3s ease;
}

.gamification-badge:hover {
  transform: scale(1.05);
  background: rgba(14, 168, 234, 0.15) !important;
}

.gam-level,
.gam-points,
.gam-streak {
  white-space: nowrap;
}

/* Responsive - hide some elements on mobile */
@media (max-width: 768px) {
  .gamification-badge {
    font-size: 0.75rem;
    gap: 8px;
    padding: 4px 12px;
  }

  .gam-points {
    display: none;
  }
}

/* ==================== INTERACTIVE ONBOARDING TOUR ==================== */
/* Phase 2 Feature: Guided Product Tour for First-Time Users */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Highlight target element */
.tour-target-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow:
    0 0 0 4px var(--brand),
    0 0 0 9999px rgba(0, 0, 0, 0.75) !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tour Tooltip */
.tour-tooltip {
  position: fixed;
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 10000;
  animation: tourSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--brand);
}

@keyframes tourSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dark Mode Tour Tooltip */
[data-theme="dark"] .tour-tooltip {
  background: rgba(20, 27, 53, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    var(--glow-cyan),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.tour-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tour-close:hover {
  background: var(--chip);
  color: var(--ink);
  transform: scale(1.1);
}

.tour-content {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tour-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tour-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.tour-progress-dot.active {
  background: var(--brand);
  width: 24px;
  border-radius: 4px;
}

.tour-buttons {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tour-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 0.95rem;
}

.tour-btn-skip {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.tour-btn-skip:hover {
  background: var(--chip);
  color: var(--ink);
}

.tour-btn-next {
  background: var(--brand);
  color: white;
  flex: 1;
}

.tour-btn-next:hover {
  background: var(--brand2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 168, 234, 0.3);
}

[data-theme="dark"] .tour-btn-next {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
  box-shadow: var(--glow-cyan);
}

[data-theme="dark"] .tour-btn-next:hover {
  box-shadow:
    0 8px 24px rgba(0, 212, 255, 0.4),
    var(--glow-cyan);
}

/* Tour Arrow Pointer */
.tour-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.tour-arrow.arrow-bottom {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0 10px;
  border-color: var(--panel) transparent transparent transparent;
}

.tour-arrow.arrow-top {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 10px 10px 10px;
  border-color: transparent transparent var(--panel) transparent;
}

.tour-arrow.arrow-left {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--panel) transparent transparent;
}

.tour-arrow.arrow-right {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--panel);
}

/* Welcome Tour Modal */
.tour-welcome-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  z-index: 10000;
  animation: tourSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 2px var(--brand);
  text-align: center;
}

[data-theme="dark"] .tour-welcome-modal {
  background: rgba(20, 27, 53, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    var(--glow-cyan);
}

.tour-welcome-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

.tour-welcome-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--ink);
}

.tour-welcome-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.tour-welcome-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: calc(100vw - 40px);
    padding: 20px;
  }

  .tour-welcome-modal {
    max-width: calc(100vw - 40px);
    padding: 32px 24px;
  }

  .tour-welcome-title {
    font-size: 1.5rem;
  }

  .tour-welcome-subtitle {
    font-size: 1rem;
  }
}

/* ==================== PWA INSTALL BANNER ==================== */
/* Phase 2 Feature: Progressive Web App Installation Prompt */

.pwa-install-banner {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 20px;
  max-width: 600px;
  width: calc(100% - 40px);
  z-index: 1000;
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--brand);
  border-bottom: none;
}

.pwa-install-banner.visible {
  bottom: 0;
}

/* Dark Mode Install Banner */
[data-theme="dark"] .pwa-install-banner {
  background: rgba(20, 27, 53, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.6),
    var(--glow-cyan);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pwa-install-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  animation: bounce 2s infinite;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-text strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.pwa-install-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pwa-install-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-install-close:hover {
  background: var(--chip);
  color: var(--ink);
  transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .pwa-install-banner {
    width: 100%;
    border-radius: 0;
    padding: 16px;
  }

  .pwa-install-content {
    gap: 12px;
  }

  .pwa-install-icon {
    font-size: 2rem;
  }

  .pwa-install-text strong {
    font-size: 1rem;
  }

  .pwa-install-text p {
    font-size: 0.85rem;
  }
}

/* PWA Mode - Hide theme toggle when in standalone */
@media (display-mode: standalone) {
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: var(--panel);
    z-index: 9999;
  }
}


/* ==================== PHASE 3: INNOVATION FEATURES ==================== */

/* Voice Commands Indicator */
.voice-indicator {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--brand);
  box-shadow: var(--shadow-md), var(--glow-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9998;
  user-select: none;
}

.voice-indicator:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}

.voice-indicator.listening {
  background: var(--brand);
  color: var(--bg);
  animation: voicePulse 1.5s ease-in-out infinite;
}

.voice-indicator.processing {
  background: var(--warn);
  color: var(--bg);
  animation: voiceSpin 1s linear infinite;
}

@keyframes voicePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(14, 168, 234, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 0 15px rgba(14, 168, 234, 0);
  }
}

@keyframes voiceSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Keyboard Shortcut Feedback Toast */
.shortcut-feedback {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 12px 24px;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.shortcut-feedback.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.shortcut-feedback kbd {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--border);
}

[data-theme="dark"] .shortcut-feedback kbd {
  background: var(--bg);
  box-shadow: 0 2px 0 var(--brand);
}

/* Help & Voice Buttons */
.help-btn,
.voice-btn {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9997;
  color: var(--brand);
}

.help-btn {
  bottom: 24px;
  left: 24px;
}

.voice-btn {
  bottom: 24px;
  right: 24px;
}

.help-btn:hover,
.voice-btn:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  background: var(--brand);
  color: var(--bg);
}

/* Shortcut Help Modal */
.shortcut-help-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 24px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.shortcut-help-modal.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.shortcut-help-modal h2 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--brand);
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcut-help-modal .shortcuts-grid {
  display: grid;
  gap: 16px;
}

.shortcut-help-modal .shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--chip);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.shortcut-help-modal .shortcut-item:hover {
  background: var(--brand-light);
  transform: translateX(4px);
}

.shortcut-help-modal .shortcut-item kbd {
  background: var(--bg);
  border: 2px solid var(--brand);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  box-shadow: 0 2px 0 var(--brand);
}

.shortcut-help-modal .close-help {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.shortcut-help-modal .close-help:hover {
  background: var(--chip);
  color: var(--cta);
  transform: scale(1.1);
}

/* Export Modal */
.export-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 24px;
  padding: 32px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.export-modal.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.export-modal h2 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.export-modal .subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.export-formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.export-format-card {
  background: var(--chip);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.export-format-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(14, 168, 234, 0.2), transparent);
  transition: left 0.5s ease;
}

.export-format-card:hover::before {
  left: 100%;
}

.export-format-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.export-format-card.selected {
  background: var(--brand);
  color: var(--bg);
  border-color: var(--brand);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.export-format-card .format-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}

.export-format-card .format-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.export-format-card .format-desc {
  font-size: 0.85rem;
  opacity: 0.8;
}

.export-options {
  background: var(--chip);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.export-options h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.export-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

.export-options input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--brand);
}

.export-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.export-actions .btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.export-actions .btn-primary {
  background: var(--brand);
  color: var(--bg);
  border-color: var(--brand);
}

.export-actions .btn-primary:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.export-actions .btn-secondary {
  background: transparent;
  color: var(--muted);
}

.export-actions .btn-secondary:hover {
  background: var(--chip);
  color: var(--ink);
}

.close-export {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.close-export:hover {
  background: var(--chip);
  color: var(--cta);
  transform: scale(1.1);
}

/* Predictions Panel */
.predictions-panel {
  background: linear-gradient(135deg, var(--panel) 0%, var(--chip) 100%);
  border: 2px solid var(--brand);
  border-radius: 20px;
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.predictions-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(14, 168, 234, 0.1) 0%, transparent 70%);
  animation: predictGlow 8s ease-in-out infinite;
}

@keyframes predictGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, -20px) scale(1.1); }
}

.predictions-panel h3 {
  margin-top: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  color: var(--brand);
  position: relative;
  z-index: 1;
}

.predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
}

.prediction-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.prediction-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.prediction-card .pred-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.prediction-card .pred-score {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 4px;
  display: block;
}

.prediction-card .pred-change {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.prediction-card .pred-change.positive {
  color: var(--ok);
}

.prediction-card .pred-change.negative {
  color: var(--bad);
}

.prediction-confidence {
  margin-top: 16px;
  padding: 12px;
  background: var(--panel);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  position: relative;
  z-index: 1;
}

.prediction-confidence strong {
  color: var(--brand);
}

/* Modal Overlay for All Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* Mobile Responsive for Phase 3 */
@media (max-width: 768px) {
  .voice-indicator {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .help-btn,
  .voice-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .help-btn {
    bottom: 16px;
    left: 16px;
  }

  .shortcut-help-modal,
  .export-modal {
    width: 95%;
    padding: 24px;
    max-height: 85vh;
  }

  .shortcut-help-modal h2,
  .export-modal h2 {
    font-size: 1.5rem;
  }

  .export-formats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .predictions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .prediction-card {
    padding: 16px;
  }

  .prediction-card .pred-score {
    font-size: 2rem;
  }
}

/* Dark mode specific adjustments for Phase 3 */
[data-theme="dark"] .export-format-card.selected {
  background: var(--brand);
  color: var(--bg);
}

[data-theme="dark"] .predictions-panel {
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg) 100%);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

[data-theme="dark"] .prediction-card {
  background: var(--bg);
  border-color: var(--brand);
}

/* Animation for modal entrance */
@keyframes modalSlideIn {
  from {
    transform: translate(-50%, -60%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.export-modal.visible,
.shortcut-help-modal.visible {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* ==================== PHASE 4: PREMIUM FEATURES ==================== */

/* ==================== 1. DATA VISUALIZATION ==================== */

.data-viz-container {
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.viz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.viz-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--brand);
}

.viz-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.viz-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: var(--chip);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--ink);
}

.viz-btn:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.viz-btn.active {
  background: var(--brand);
  color: var(--bg);
  border-color: var(--brand);
  box-shadow: var(--glow-cyan);
}

.viz-canvas-container {
  background: var(--bg);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  overflow: hidden;
}

.viz-canvas-container canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border);
}

.legend-label {
  color: var(--ink);
  font-weight: 500;
}


/* ==================== 2. COMMAND PALETTE ==================== */

.command-palette {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.command-palette.visible {
  opacity: 1;
  pointer-events: all;
}

.command-palette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.command-palette-modal {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.command-palette.visible .command-palette-modal {
  transform: scale(1);
}

.command-palette-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
}

.command-palette-icon {
  font-size: 1.5rem;
  color: var(--brand);
}

.command-palette-header input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 500;
}

.command-palette-header input::placeholder {
  color: var(--muted);
}

.command-palette-hint {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.command-palette-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.command-group {
  margin-bottom: 16px;
}

.command-group-title {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.command-item:hover,
.command-item.selected {
  background: var(--brand);
  color: var(--bg);
  transform: translateX(4px);
}

.command-item-icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.command-item-name {
  flex: 1;
  font-weight: 500;
}

.command-empty {
  padding: 60px 20px;
  text-align: center;
}

.command-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.command-empty-text {
  color: var(--muted);
  font-size: 1.1rem;
}

.command-palette-footer {
  padding: 12px 20px;
  border-top: 2px solid var(--border);
  background: var(--chip);
}

.command-palette-tips {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  align-items: center;
  justify-content: center;
}

.command-palette-tips kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  margin-right: 4px;
}


/* ==================== 3. NOTIFICATION SYSTEM ==================== */

.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10003;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.notification {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

.notification.visible {
  transform: translateX(0);
  opacity: 1;
}

.notification-success {
  border-color: var(--ok);
}

.notification-error {
  border-color: var(--bad);
}

.notification-warning {
  border-color: var(--warn);
}

.notification-info {
  border-color: var(--brand);
}

.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.notification-message {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.notification-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background: var(--chip);
  color: var(--ink);
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brand);
  width: 100%;
  transform-origin: left;
}

@keyframes notificationProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.notification-success .notification-progress {
  background: var(--ok);
}

.notification-error .notification-progress {
  background: var(--bad);
}

.notification-warning .notification-progress {
  background: var(--warn);
}


/* ==================== 4. SCROLL ANIMATIONS ==================== */

.animate-element {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-element.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays are set via JS */


/* ==================== 5. THEME BUILDER ==================== */

.theme-builder {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10004;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.theme-builder.visible {
  opacity: 1;
  pointer-events: all;
}

.theme-builder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.theme-builder-modal {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-builder.visible .theme-builder-modal {
  transform: scale(1);
}

.theme-builder-header {
  padding: 24px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-builder-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--brand);
}

.theme-builder-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.theme-builder-close:hover {
  background: var(--chip);
  color: var(--cta);
  transform: scale(1.1);
}

.theme-builder-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.theme-section {
  margin-bottom: 32px;
}

.theme-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--ink);
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.theme-preset-btn {
  padding: 16px 12px;
  border: 2px solid var(--border);
  background: var(--chip);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.theme-preset-btn:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--bg);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.theme-colors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.theme-color-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-color-input label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.theme-color-input input[type="color"] {
  width: 100%;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-color-input input[type="color"]:hover {
  border-color: var(--brand);
  transform: scale(1.05);
}

.theme-preview {
  background: var(--chip);
  border-radius: 16px;
  padding: 24px;
}

.theme-preview-card {
  --preview-brand: #0ea8ea;
  --preview-cta: #E02B20;
  --preview-bg: #ffffff;
  --preview-panel: #ffffff;

  background: var(--preview-panel);
  border: 2px solid var(--preview-brand);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.theme-preview-card h4 {
  margin-top: 0;
  color: var(--preview-brand);
  font-size: 1.3rem;
}

.theme-preview-card p {
  color: var(--ink);
  margin: 12px 0 20px;
}

.theme-preview-btn {
  background: var(--preview-brand);
  color: var(--preview-bg);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-preview-btn:hover {
  background: var(--preview-cta);
  transform: scale(1.05);
}

.theme-builder-footer {
  padding: 20px 24px;
  border-top: 2px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}


/* ==================== 6. SHARE & COLLABORATION ==================== */

.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.share-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.share-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.share-modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-modal.visible .share-modal-content {
  transform: scale(1);
}

.share-modal-header {
  padding: 24px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--brand);
}

.share-modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.share-modal-close:hover {
  background: var(--chip);
  color: var(--cta);
  transform: scale(1.1);
}

.share-modal-body {
  padding: 24px;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.share-option-btn {
  background: var(--chip);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.share-option-btn:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--bg);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.share-option-icon {
  font-size: 2rem;
}

.share-option-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.qr-container {
  text-align: center;
  padding: 24px;
  background: var(--chip);
  border-radius: 16px;
  margin-top: 16px;
}

.qr-container canvas {
  border: 4px solid var(--brand);
  border-radius: 16px;
  margin-bottom: 16px;
}

.qr-container p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.share-link-container {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  background: var(--chip);
  border-radius: 12px;
}

.share-link-container input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: 'Monaco', 'Courier New', monospace;
}

.share-link-container input:focus {
  outline: none;
  border-color: var(--brand);
}


/* ==================== MOBILE RESPONSIVE FOR PHASE 4 ==================== */

@media (max-width: 768px) {
  .data-viz-container {
    padding: 16px;
  }

  .viz-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .viz-controls {
    width: 100%;
  }

  .viz-btn {
    flex: 1;
    min-width: 100px;
  }

  .command-palette {
    padding-top: 60px;
  }

  .command-palette-modal {
    width: 95%;
    max-width: none;
  }

  .notification-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .notification {
    min-width: auto;
    width: 100%;
  }

  .theme-builder-modal,
  .share-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .theme-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .share-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .share-link-container {
    flex-direction: column;
  }
}

/* Dark mode specific adjustments for Phase 4 */
[data-theme="dark"] .command-palette-modal,
[data-theme="dark"] .theme-builder-modal,
[data-theme="dark"] .share-modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-cyan);
}

[data-theme="dark"] .notification {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
