/* 
  SEO Blitz Global Styles 
  Optimized for Core Web Vitals
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.dark ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

* { -webkit-tap-highlight-color: transparent; }

/* GLASS CARDS */
.glass {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  transition: all 0.3s ease;
}

.glass:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(51, 65, 85, 0.5);
}

.dark .glass:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 60px rgba(16, 185, 129, 0.06);
}

:root:not(.dark) .glass {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(226, 232, 240, 0.9);
}

:root:not(.dark) .glass:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 0 60px rgba(16, 185, 129, 0.06);
}

/* INPUTS */
.input-field {
  background: rgba(15, 23, 42, 1);
  border: 2px solid rgba(51, 65, 85, 0.7);
  color: #f1f5f9;
  transition: all 0.25s ease;
}

.input-field::placeholder { color: #64748b; }

.input-field:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12), 0 0 24px rgba(16, 185, 129, 0.1);
}

.dark .input-field {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

:root:not(.dark) .input-field {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

:root:not(.dark) .input-field::placeholder { color: #94a3b8; }

:root:not(.dark) .input-field:focus {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1), 0 0 20px rgba(16, 185, 129, 0.08);
}

/* SCORE RING */
@keyframes scoreReveal {
  from { stroke-dashoffset: 282.74; opacity: 0; transform: scale(0.95); }
  to { stroke-dashoffset: var(--offset); opacity: 1; transform: scale(1); }
}

.score-ring-animate {
  animation: scoreReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes softGlow {
  0%, 100% { filter: drop-shadow(0 0 16px currentColor); opacity: 0.9; }
  50% { filter: drop-shadow(0 0 32px currentColor); opacity: 1; }
}

.score-glow { animation: softGlow 3s ease-in-out infinite; }

/* FADE IN ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-fade {
  opacity: 0;
  animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.19s; }
.d4 { animation-delay: 0.26s; }
.d5 { animation-delay: 0.33s; }
.d6 { animation-delay: 0.40s; }

/* THEME SWITCH */
.switch-track {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.35s ease, border-color 0.35s ease;
  border: 2px solid transparent;
}

.dark .switch-track {
  background: #334155;
  border-color: #475569;
}

:root:not(.dark) .switch-track {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

:root:not(.dark) .switch-thumb {
  left: 24px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.45);
}

.switch-track:hover { border-color: #10b981; }

/* KEYWORD TAGS */
.kw-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--kw-size, 0.85rem);
  cursor: default;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kw-tag:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

/* SUGGESTION ITEMS */
.suggest-item {
  padding-left: 14px;
  margin-left: -14px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  border-radius: 0 8px 8px 0;
}

.suggest-item:hover {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
  padding-left: 18px;
  margin-left: -18px;
}

/* BACKGROUND ORBS */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.orb-1 {
  width: 280px;
  height: 280px;
  background: rgba(16, 185, 129, 0.12);
  top: -80px;
  right: -80px;
  animation: floatOrb 10s ease-in-out infinite;
}

.orb-2 {
  width: 220px;
  height: 220px;
  background: rgba(59, 130, 246, 0.09);
  bottom: 15%;
  left: -70px;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

.dark .orb-1 { background: rgba(16, 185, 129, 0.07); }
.dark .orb-2 { background: rgba(59, 130, 246, 0.05); }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12px, 16px); }
}

/* METRIC CARD HOVER SWEEP */
.metric-card { overflow: hidden; position: relative; }
.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.6), transparent);
  transition: left 0.6s ease;
}
.metric-card:hover::after { left: 110%; }

/* EMPTY STATE ICON FLOAT */
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-icon { animation: gentleFloat 4s ease-in-out infinite; }

/* AD PLACEHOLDER */
.ad-box {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(148,163,184,0.08) 10px,
    rgba(148,163,184,0.08) 11px
  );
}
.dark .ad-box {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(51,65,85,0.3) 10px,
    rgba(51,65,85,0.3) 11px
  );
}

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