/* ============================================================
   SCAM SHIELD — Design System & Styles
   Premium dark theme with glassmorphism & micro-animations
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Colors - High Contrast Titanium */
  --bg-primary: #050507;
  --bg-secondary: #0c0c0e;
  --bg-card: rgba(20, 20, 25, 0.85);
  --bg-card-hover: rgba(30, 30, 35, 0.95);
  --bg-input: rgba(10, 10, 12, 0.9);

  --text-primary: #ffffff; /* Solid White for clarity */
  --text-secondary: #f4f4f5; /* High-contrast off-white */
  --text-muted: #d1d1d6; /* Increased visibility for muted text */

  --accent-primary: #ffffff; 
  --accent-primary-glow: rgba(255, 255, 255, 0.25);
  --accent-secondary: #a1a1aa; 

  --safe-color: #34d399;
  --safe-bg: rgba(16, 185, 129, 0.15);
  --safe-glow: rgba(16, 185, 129, 0.35);

  --danger-color: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-glow: rgba(239, 68, 68, 0.35);

  --warning-color: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.15);

  --border-subtle: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(255, 255, 255, 0.4);

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

  /* Typography - Sharpened */
  --font-primary: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── High-Gloss Titanium 3D Engine ── */
.icon-window {
  width: 110px; /* Enhanced for maximum impact */
  height: 110px;
  background: linear-gradient(145deg, #32323a 0%, #0a0a0c 100%);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden; 
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  
  /* Multi-layered physical depth */
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8),             /* Large drop shadow */
    0 5px 15px rgba(0, 0, 0, 0.5),              /* Tight drop shadow */
    inset 0 2px 2px rgba(255, 255, 255, 0.12),  /* Top inner highlight */
    inset 0 -2px 5px rgba(0, 0, 0, 0.9),        /* Bottom inner shadow */
    0 0 0 1px rgba(0, 0, 0, 0.4);               /* Outer edge definition */
  
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* NO DOTS HERE - Removed per user request */

/* Glass Reflection Overlay - Static for cleaner look */
.icon-window::after {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 50%;
  background: linear-gradient(
    180deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    transparent 100%
  );
  transform: rotate(-15deg);
  pointer-events: none;
}

i.ph-bold {
  font-size: 3.2rem; /* Scaled up icon size */
  /* High-Contrast Polished Chrome Gradient */
  background: linear-gradient(135deg, 
    #ffffff 0%,   /* Pure White */
    #f8f8f8 20%,
    #e2e2e8 45%,  /* Bright Silver */
    #a1a1aa 70%,
    #71717a 100%  /* Soft Shadow - Never pure black to maintain contrast */
  ) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  
  /* Sharpened 3D Extrusion */
  filter: 
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)) /* Sharper Glow */
    drop-shadow(0 2px 0 #ffffff) /* Crisp Top Edge */
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.95)) !important; /* Deeper, sharper base shadow */
  
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Variants - Scaled up for impact */
.icon-window--sm { width: 64px; height: 64px; border-radius: 18px; }
.icon-window--sm i { font-size: 2.2rem; }
.icon-window--xs { width: 48px; height: 48px; border-radius: 12px; }
.icon-window--xs i { font-size: 1.6rem; }

.stat-item:hover .icon-window, .example-btn:hover .icon-window {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.9),
    0 0 15px rgba(255, 255, 255, 0.1); /* Hover Glow */
}

.stat-item:hover i.ph-bold {
  transform: scale(1.1) rotate(-5deg);
  filter: 
    brightness(1.3) 
    drop-shadow(0 0 20px rgba(255,255,255,0.25))
    drop-shadow(0 3px 0 #ffffff);
}

i.ph-duotone::before {
  opacity: 0.7 !important;
}

.stat-item:hover i, .btn:hover i, .example-btn:hover i {
  transform: perspective(1000px) translateZ(30px) scale(1.1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Animated Background ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 25s ease-in-out infinite;
}

.bg-glow--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(228, 228, 231, 0.12), transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.bg-glow--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(138, 138, 147, 0.1), transparent 70%);
  bottom: 10%;
  left: -100px;
  animation-delay: -7s;
}

.bg-glow--3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 70%);
  top: 40%;
  right: 10%;
  animation-delay: -14s;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(15px, 15px) scale(1.02); }
}

.app {
  width: 100%;
  padding: 160px 0 120px 0;
  display: flex;
  flex-direction: column;
  gap: 120px; /* Enhanced section spacing */
  position: relative;
  z-index: 2;
}

.app__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: flex-start;
  max-width: 1600px;
  width: 95%;
  margin: 0 auto;
}

.app__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

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

/* ── Premium Glass Header ── */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100px; /* Enhanced height for better branding */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header__content {
  width: 95%;
  max-width: 1600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.header__logo-img {
  height: 80px; /* Larger brand presence */
  width: auto;
  transition: all 0.3s ease;
  /* Dark shadow for depth + Light glow for visibility */
  filter: 
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.9)) 
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.2)) 
    brightness(1.1);
}

.header__logo:hover .header__logo-img {
  transform: scale(1.03);
  filter: drop-shadow(0 0 30px rgba(0, 194, 255, 0.7)) brightness(1.25);
}

.header__text {
  display: flex;
  flex-direction: column;
}

.header__title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  /* Polished Titanium Gradient to match icons */
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #f8f8f8 20%,
    #e2e2e8 45%, 
    #a1a1aa 70%,
    #71717a 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.header__subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.8;
}

.footer__logo-img {
  height: 70px; /* Drastically larger */
  width: auto;
  opacity: 1;
  filter: brightness(1.1) contrast(1.1);
  transition: all 0.3s ease;
}

.footer__brand:hover .footer__logo-img {
  filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}

.header__badge {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  color: #34d399;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Disappearance Helper */
.header--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px) scale(0.95) !important;
}

/* Adjust layout spacing */
.app {
  padding-top: 120px !important;
}

/* ── Stats Bar ── */
.stats-bar {
  width: 100%;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) 0;
}

.stats-bar__content {
  max-width: 1600px;
  width: 95%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stat-item .icon-window {
  margin-bottom: 8px;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }

.stat-item:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-8px) scale(1.02);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.stat-item__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.stat-item--danger .stat-item__icon { color: var(--danger-color); background: var(--danger-bg); }
.stat-item--safe .stat-item__icon { color: var(--safe-color); background: var(--safe-bg); }

.stat-item__data {
  display: flex;
  flex-direction: column;
}

.stat-item__number {
  font-size: 2.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}

.stat-item__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ── App Workspace (Edge-to-Edge Layout) ── */
.app__workspace {
  width: 98%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 120px; /* Enhanced vertical breathing room */
}

/* ── Scanner (Analysis Chamber) ── */
.scanner {
  background: #0c0c0e;
  border: 1px solid #333338;
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: entranceScale 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.6s ease, 
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
              margin 0.8s ease, 
              padding 0.8s ease;
  max-height: 1500px; /* Reliable upper limit for content */
  transform-origin: top center;
  will-change: transform, opacity, max-height, margin;
}

/* Smart Collapse when results are shown */
.scanner--collapsed {
  max-height: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0 !important;
  transform: translateY(-40px) scale(0.96) !important;
  pointer-events: none !important;
  border-color: transparent !important;
}

@keyframes entranceScale {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.scanner__templates {
  margin-bottom: var(--space-lg);
}

.scanner__templates-label {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

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

.example-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-base);
}

.example-btn i {
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.example-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.scanner__status-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--safe-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  color: var(--safe-color);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.scanner__title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.scanner__desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7; /* Increased for better readability */
  margin-bottom: var(--space-xl);
  max-width: 700px;
}

.scanner__input-wrapper {
  position: relative;
  margin-bottom: var(--space-lg);
}

.scanner__textarea {
  width: 100%;
  min-height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  color: #fff;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1.7; /* Optimized for long-form reading and input */
  resize: vertical;
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  z-index: 2;
}

.scanner__textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(12, 12, 15, 0.9);
}

.scanner__glow-border {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent-primary), transparent, var(--accent-secondary));
  border-radius: calc(var(--radius-lg) + 2px);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.scanner__textarea:focus + .scanner__glow-border {
  opacity: 0.3;
}

.scanner__char-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  z-index: 3;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.scanner__actions {
  display: flex;
  gap: var(--space-xl); /* Increased spacing for actions */
  margin-top: var(--space-xl);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  will-change: transform, opacity, max-width, margin;
}

.btn--hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-20px) scale(0.9) !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  flex: 0 0 0 !important;
  overflow: hidden !important;
}

.btn .btn__icon {
  font-size: 1.3rem !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: currentColor !important;
  filter: none !important;
  flex-shrink: 0 !important;
}

.btn--primary .btn__icon {
  color: #09090b !important;
}

.btn--ghost .btn__icon {
  color: var(--accent-primary) !important;
}

.btn--primary {
  flex: 1;
  background: linear-gradient(135deg, #e4e4e7, #a1a1aa);
  color: #09090b;
  box-shadow: 0 4px 20px rgba(228, 228, 231, 0.2);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(228, 228, 231, 0.4);
}

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

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary.loading .btn__text {
  opacity: 0;
}

.btn--primary.loading .btn__icon {
  opacity: 0;
}

.btn--primary.loading .btn__loader {
  display: flex;
}

.btn__loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(9, 9, 11, 0.2);
  border-top-color: #09090b;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
}

.btn--ghost:hover {
  background: rgba(100, 100, 150, 0.08);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ── Result (Diagnostic Report) ── */
.result {
  background: #0c0c0e;
  border: 1px solid #333338;
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: resultEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes resultEntrance {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ── Result Header ── */
.result__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.result__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary-glow);
  animation: dotPulse 2s infinite ease-in-out;
}

.result--scam .result__status-dot { background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.result--safe .result__status-dot { background: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
.result--warning .result__status-dot { background: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.result__title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.result__timestamp {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Hero Section: Gauge + Verdict ── */
.result__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2xl) 0 var(--space-xl);
  position: relative;
}

.result__gauge-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ambient Glow behind the gauge */
.result__gauge-zone::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  transition: background 0.6s ease;
}

.result--scam .result__gauge-zone::before {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, transparent 65%);
  animation: ambientPulse 4s infinite ease-in-out;
}

.result--safe .result__gauge-zone::before {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 65%);
}

.result--warning .result__gauge-zone::before {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.07) 0%, transparent 65%);
}

@keyframes ambientPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.6; }
}

.result__gauge {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
}

.gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.gauge__glow {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  stroke-linecap: round;
  filter: url(#gauge-glow-filter);
  opacity: 0.45;
  transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.5s ease;
}

.gauge__fill {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.5s ease;
}

.result--scam .gauge__fill { stroke: #ef4444; }
.result--scam .gauge__glow { stroke: #ef4444; }

.result--safe .gauge__fill { stroke: #34d399; }
.result--safe .gauge__glow { stroke: #34d399; }

.result--warning .gauge__fill { stroke: #fbbf24; }
.result--warning .gauge__glow { stroke: #fbbf24; }

.result__gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.result__score {
  font-size: 5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.05em;
  line-height: 1;
}

.result__score-unit {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ── Verdict Label ── */
.result__verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-xl);
  position: relative;
  width: 100%;
}

.result__verdict::before {
  content: '';
  width: 100px;
  height: 4px;
  background: 
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.2) 80%, transparent),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 60%, transparent);
  background-size: 100% 1px, 100% 1px;
  background-position: top, bottom;
  background-repeat: no-repeat;
  margin-bottom: var(--space-lg);
}

.result__label {
  font-size: 2.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1.2;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result--scam .result__label {
  color: #ff4444;
  text-shadow: 
    0 0 20px rgba(255, 68, 68, 0.5),
    0 0 40px rgba(255, 68, 68, 0.2);
  transform: scale(1.05);
}
.result--safe .result__label {
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}
.result--warning .result__label {
  color: #ffcc00;
  text-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.result__sublabel-text {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Metrics Strip ── */
.result__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg); /* Increased gap between cards */
  padding: var(--space-2xl) 0; /* More vertical breathing room */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 16px; /* More space between title and value */
  padding: var(--space-xl); /* More internal padding */
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), background var(--transition-base);
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.result--scam .metric-card { border-color: rgba(239, 68, 68, 0.1); }
.result--safe .metric-card { border-color: rgba(16, 185, 129, 0.08); }

.metric-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 1rem;
}

.metric-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 12px; /* Extra space before value */
}

.metric-card__bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: rgba(20, 20, 25, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px;
  border-radius: 16px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  pointer-events: auto;
}

.toast--error { border-left: 4px solid var(--danger-color); }
.toast--success { border-left: 4px solid var(--safe-color); }
.toast--warning { border-left: 4px solid var(--warning-color); }

.toast__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast--error .toast__icon { color: var(--danger-color); }
.toast--success .toast__icon { color: var(--safe-color); }
.toast--warning .toast__icon { color: var(--warning-color); }

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

.toast--exit {
  animation: toastExit 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastExit {
  to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

@media (max-width: 768px) {
  .toast-container {
    bottom: 24px;
    width: 95%;
  }
  .toast {
    padding: 14px 16px;
    font-size: 0.85rem;
  }
}

.metric-card__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.result--scam .metric-card__bar-fill { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
.result--safe .metric-card__bar-fill { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.3); }

.metric-card__value {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.metric-card__value--risk {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-card__value--risk::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.result--scam .metric-card__value--risk::before { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.result--safe .metric-card__value--risk::before { background: #34d399; box-shadow: 0 0 6px #34d399; }
.result--warning .metric-card__value--risk::before { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

/* ── Intel Section (Advice + Flags) ── */
.result__intel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl); /* Massive spacing for clarity */
  padding-top: var(--space-2xl);
}

.result__advice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.result--scam .result__advice { border-color: rgba(239, 68, 68, 0.15); background: rgba(239, 68, 68, 0.03); }
.result--safe .result__advice { border-color: rgba(16, 185, 129, 0.12); background: rgba(16, 185, 129, 0.02); }

.result__advice-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result__advice-text {
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.7; /* Better readability for long advice */
  font-weight: 500;
  flex: 1;
}

/* ── Suspicious Words ── */
.suspicious-words {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.suspicious-words__heading {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f87171;
  margin-bottom: var(--space-xl); /* More space below heading */
}

.suspicious-words__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suspicious-words__badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ── Deep Analysis UI ── */
/* ── Examples ── */



/* ── Footer ── */
.footer {
  width: 100%;
  margin-top: var(--space-2xl);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  position: relative;
  z-index: 10;
}

.footer__content {
  max-width: 1600px;
  width: 95%;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-xl);
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer__brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer__brand:hover {
  color: var(--accent-primary);
}

.footer__copyright {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer__tagline {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.footer__link--accent {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.footer__link--accent:hover {
  border-bottom-color: var(--accent-primary);
}

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

.footer__project-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #64748b;
  margin-right: 8px;
}

.footer__project-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__project-link {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.footer__project-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.3s ease;
}

.footer__project-link:hover {
  color: #fff;
}

.footer__project-link:hover::after {
  width: 100%;
}

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

.footer__right {
  display: flex;
  gap: var(--space-lg);
}

.footer__social {
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer__social:hover .icon-window {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.1);
}

/* ── Responsive ── */

/* === TABLET (601px – 1024px) === */
@media (max-width: 1024px) {
  .app__grid {
    grid-template-columns: 1fr;
    max-width: 700px;
    width: 92%;
  }

  .app__workspace {
    width: 92%;
    max-width: 700px;
  }

  .stats-bar__content {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 92%;
    max-width: 700px;
  }

  .result__metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .scanner__templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .footer__center {
    order: -1;
  }
}

/* === MOBILE (≤600px) — Full Redesign === */
@media (max-width: 600px) {

  /* ── 1. HEADER: Slim top bar ── */
  .header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 52px; /* More compact */
    border-radius: 0;
    opacity: 1;
    background: rgba(5, 5, 7, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0;
    z-index: 1000;
    transition: background 0.3s ease;
  }

  .header__content {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 16px !important;
    height: 52px;
  }

  .header__logo {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .header__logo .icon-window {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  .header__logo .icon-window i.ph-bold {
    font-size: 1.1rem !important;
  }

  .header__title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #fff !important;
  }

  .header__subtitle {
    display: none !important;
  }

  .header__actions {
    margin: 0 !important;
  }

  .lang-btn {
    padding: 4px 10px !important;
    font-size: 0.7rem !important;
    border-radius: 6px !important;
  }

  .lang-btn i.ph-bold {
    font-size: 0.9rem !important;
    filter: none !important;
  }

  /* Tooltip on mobile */
  .tooltip-popup {
    position: fixed !important;
    top: 55px !important;
    right: 16px !important;
    left: auto !important;
    width: 180px;
    font-size: 0.7rem;
    transform: translateY(-8px) !important;
    padding: 10px !important;
  }
  .tooltip-popup.show {
    transform: translateY(0) !important;
  }
  .tooltip-arrow {
    right: 20px !important;
    left: auto !important;
  }

  /* ── 2. APP LAYOUT ── */
  .app {
    padding: 100px 0 60px 0 !important;
    gap: 100px !important; /* Maximum section breathing room */
  }

  /* ── 3. STATS BAR: Ultra-Compact Horizontal Cards ── */
  .stats-bar {
    margin: 8px 0 !important;
    padding: 0 12px !important;
  }

  .stats-bar__content {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .stat-item {
    flex-direction: column !important;
    padding: 8px 4px !important;
    gap: 4px !important;
  }

  .stat-item .icon-window {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
  }

  .stat-item .icon-window i.ph-bold {
    font-size: 0.9rem !important;
  }

  .stat-item__number {
    font-size: 1rem !important;
    line-height: 1 !important;
  }

  .stat-item__label {
    font-size: 0.45rem !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* ── 4. SCANNER CARD ── */
  .app__workspace {
    width: 100% !important;
    max-width: none !important;
    padding: 0 16px !important;
    margin: 0 !important;
    gap: 20px !important;
  }

  .scanner {
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
  }

  .scanner__status-tag {
    font-size: 0.55rem !important;
    padding: 3px 8px !important;
    margin-bottom: 8px !important;
  }

  .scanner__title {
    font-size: 1.2rem !important;
    margin-bottom: 4px !important;
  }

  .scanner__desc {
    font-size: 0.85rem !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
  }

  .scanner__templates {
    margin-bottom: 14px !important;
  }

  .scanner__templates-label {
    font-size: 0.65rem !important;
    margin-bottom: 8px !important;
  }

  .scanner__templates-grid {
    display: flex !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    scrollbar-width: none;
  }

  .scanner__templates-grid::-webkit-scrollbar {
    display: none;
  }

  .example-btn {
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .example-btn .icon-window {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
  }

  .example-btn .icon-window i.ph-bold {
    font-size: 0.9rem !important;
  }

  .scanner__textarea {
    min-height: 130px !important;
    padding: 16px !important;
    font-size: 0.95rem !important;
    border-radius: 14px !important;
    margin-bottom: 4px !important;
  }

  .scanner__char-count {
    font-size: 0.65rem !important;
    bottom: 8px !important;
    right: 12px !important;
  }

  .scanner__actions, .result__actions {
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 24px !important;
  }

  .btn {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .btn .btn__icon {
    font-size: 1.1rem !important;
    margin-right: 2px !important;
    flex-shrink: 0 !important;
  }

  /* ── 5. RESULT CARD ── */
  .result {
    padding: 20px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
  }

  .result__header {
    padding-bottom: 12px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .result__title {
    font-size: 0.8rem !important;
    letter-spacing: 0.08em !important;
  }

  .result__timestamp {
    font-size: 0.6rem !important;
  }

  /* Gauge */
  .result__hero {
    padding: 16px 0 12px !important;
  }

  .result__gauge {
    width: 140px !important;
    height: 140px !important;
  }

  .result__gauge-zone::before {
    width: 180px !important;
    height: 180px !important;
  }

  .result__score {
    font-size: 3rem !important;
  }

  .result__score-unit {
    font-size: 1.1rem !important;
  }

  .result__verdict {
    margin-top: 14px !important;
    gap: 8px !important;
  }

  .result__verdict::before {
    width: 60px !important;
    margin-bottom: 10px !important;
  }

  .result__label {
    font-size: 1.1rem !important;
    text-align: center !important;
    padding: 0 5px !important;
  }

  .result__sublabel-text {
    font-size: 0.7rem !important;
  }

  /* Metrics */
  .result__metrics {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 14px 0 !important;
  }

  .metric-card {
    padding: 14px !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }

  .metric-card__header {
    gap: 8px !important;
  }

  .metric-card__header .icon-window {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    box-shadow: none !important;
  }

  .metric-card__header .icon-window i.ph-bold {
    font-size: 1rem !important;
  }

  .metric-card__title {
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
  }

  .metric-card__value {
    font-size: 1rem !important;
  }

  /* Intel section */
  .result__intel {
    gap: 16px !important;
    padding-top: 16px !important;
  }

  .result__advice {
    padding: 16px !important;
    gap: 12px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    border-radius: 14px !important;
  }

  .result__advice .icon-window {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
  }

  .result__advice-text {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }

  .suspicious-words {
    padding: 14px !important;
    border-radius: 14px !important;
  }

  .suspicious-words__heading {
    font-size: 0.75rem !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .suspicious-words__heading .icon-window {
    width: 28px !important;
    height: 28px !important;
  }

  /* ── 6. FOOTER ── */
  .footer {
    padding: 24px 0 !important; /* Even more compact */
    margin-top: 20px !important;
  }

  .footer__content {
    flex-direction: column !important;
    text-align: center !important;
    gap: 20px !important; /* Tighter spacing */
    padding: 0 16px !important;
  }

  .footer__center {
    order: 1 !important; /* Move tagline/projects to top */
  }

  .footer__tagline {
    font-size: 0.85rem !important;
    margin-bottom: 6px !important;
  }

  .footer__projects {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .footer__project-links {
    justify-content: center !important;
    gap: 8px !important;
    font-size: 0.75rem !important;
  }

  .footer__divider {
    display: inline !important;
    opacity: 0.3;
  }

  .footer__left {
    order: 2 !important;
    gap: 4px !important;
  }

  .footer__brand {
    font-size: 0.95rem !important;
  }

  .footer__copyright {
    font-size: 0.7rem !important;
    opacity: 0.4 !important;
  }

  .footer__right {
    order: 3 !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 4px !important;
  }

  .footer__right .icon-window {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }

  .footer__right .icon-window i.ph-bold {
    font-size: 1rem !important;
  }

  /* ── 7. LOADING SCREEN ── */
  .loading-screen__logo {
    height: 80px !important;
  }

  .loading-screen__title {
    font-size: 1.8rem !important;
    letter-spacing: 0.08em !important;
  }

  .loading-screen__status-text {
    font-size: 0.7rem !important;
  }

  .loading-bar {
    width: 200px !important;
    margin-top: 24px !important;
  }

  /* ── 8. BACKGROUND ── */
  .bg-glow {
    display: none !important; /* Save GPU on mobile */
  }

  /* Mobile Branding Scaling */
  .header {
    height: 70px !important;
  }

  .header__logo-img {
    height: 48px !important;
  }

  .header__title {
    font-size: 1.4rem !important;
  }

  .header__subtitle {
    font-size: 0.6rem !important;
    letter-spacing: 0.1em !important;
  }

  .app {
    padding-top: 80px !important;
    gap: 80px !important; /* Mobile breathing room */
  }

  .stats-bar__content {
    grid-template-columns: repeat(3, 1fr) !important; /* Enforce horizontal layout */
    gap: 8px !important;
  }

  .stat-item {
    padding: 10px 4px !important;
    gap: 4px !important;
  }

  .stat-item .icon-window {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
  }

  .stat-item .icon-window i.ph-bold {
    font-size: 1rem !important;
  }

  .stat-item__number {
    font-size: 1rem !important;
  }

  .stat-item__label {
    font-size: 0.45rem !important;
  }

  .btn {
    padding: 12px 24px !important;
    font-size: 0.95rem !important;
  }

  .btn__icon {
    font-size: 1.1rem !important;
  }

  .scanner, .result {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Hidden utility */
[hidden] {
  display: none !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 150, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 150, 0.35);
}

/* ── Recent History Section ── */
.recent-history {
  background: rgba(12, 12, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(20px);
  animation: entranceScale 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin-top: 120px;
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.recent-history--collapsed {
  padding-bottom: 40px !important;
}

.recent-history__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  transition: margin 0.5s ease;
}

.recent-history--collapsed .recent-history__header {
  margin-bottom: 0;
}

.recent-history__title {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.recent-history__badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px;
}

.recent-history__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 1200px;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 1;
}

.recent-history__list--collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

.history-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  padding: 0 !important;
  line-height: 0 !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.history-toggle-btn i {
  font-size: 1.1rem !important;
  margin: 0 !important;
  display: block !important;
}

.history-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
}

.history-toggle-btn--active {
  transform: rotate(180deg);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(5px);
}

.history-item__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.history-item__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item__text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item__time {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.history-item__score {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}

/* History Mobile Overrides */
@media (max-width: 768px) {
  .recent-history {
    padding: 24px 16px !important;
    margin-bottom: 40px !important;
  }
  
  .recent-history__title {
    font-size: 1.1rem !important;
  }

  .history-item {
    padding: 10px 14px !important;
    gap: 12px !important;
  }
  
  .history-item__left {
    gap: 12px !important;
  }

  .history-item__text {
    font-size: 0.85rem !important;
    -webkit-line-clamp: 2 !important; /* Allow 2 lines on mobile for better context */
  }

  .history-item__score {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .recent-history__badge {
    font-size: 0.55rem !important;
    padding: 4px 10px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .history-item__time {
    display: none !important; /* Hide time on ultra-small screens to prevent overlap */
  }
  
  .history-item__text {
    font-size: 0.8rem !important;
  }
}

/* ── Professional Loading Screen ── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #111116 0%, #050507 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: visible;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

.loading-screen__logo-zone {
  margin-bottom: 40px;
  position: relative;
  animation: logoBreathe 4s infinite ease-in-out;
}

@keyframes logoBreathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.25)); }
}

.loading-screen__logo {
  height: 120px;
  width: auto;
}

.loading-screen__title {
  font-size: 2.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.loading-screen__status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.loading-screen__status-dot {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 10px #34d399;
  animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.loading-screen__status-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loading-bar {
  width: 280px;
  height: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
}

.loading-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  background-size: 200% 100%;
  animation: loadingBarFill 3s cubic-bezier(0.65, 0, 0.35, 1) forwards,
             shimmer 2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes loadingBarFill {
  0% { width: 0%; }
  30% { width: 40%; }
  60% { width: 75%; }
  100% { width: 100%; }
}

/* ── Language Tooltip & Header Layout ── */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.lang-wrapper {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lang-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.lang-btn i.ph-bold {
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.tooltip-popup {
  position: absolute;
  top: calc(100% + 15px);
  right: -20px;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.tooltip-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-arrow {
  position: absolute;
  top: -6px;
  right: 32px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--accent-primary);
  border-left: 1px solid var(--accent-primary);
  transform: rotate(45deg);
}

/* ── Scroll Reveal System ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal--visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }

/* Custom selection */
::selection {
  background: var(--accent-primary-glow);
  color: #fff;
}

/* ── Mobile History Spacing ── */
@media (max-width: 480px) {
  .recent-history {
    margin-top: 80px !important;
    padding: 24px 20px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    border-radius: 20px !important;
  }
}
