/* ══════════════════════════════════════════════════════════════
   REAL OR AI — FUTURISTIC DESIGN SYSTEM
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --c-bg: #06060e;
  --c-bg2: #0a0a1a;
  --c-surface: rgba(12, 12, 30, 0.7);
  --c-surface-solid: #0c0c1e;
  --c-glass: rgba(15, 15, 40, 0.55);
  --c-border: rgba(100, 220, 255, 0.12);
  --c-border-bright: rgba(100, 220, 255, 0.3);

  /* Neon accents */
  --c-cyan: #00e5ff;
  --c-purple: #b44aff;
  --c-pink: #ff2d7b;
  --c-green: #00ff88;
  --c-orange: #ff9100;
  --c-red: #ff3d3d;

  /* Gradients */
  --g-main: linear-gradient(135deg, #00e5ff, #b44aff);
  --g-hot: linear-gradient(135deg, #ff2d7b, #ff9100);
  --g-success: linear-gradient(135deg, #00ff88, #00e5ff);
  --g-danger: linear-gradient(135deg, #ff3d3d, #ff2d7b);

  /* Text */
  --c-text: #e8eaf6;
  --c-text-dim: #7a7ea8;
  --c-text-bright: #ffffff;

  /* Glow */
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.35), 0 0 60px rgba(0, 229, 255, 0.1);
  --glow-purple: 0 0 20px rgba(180, 74, 255, 0.35), 0 0 60px rgba(180, 74, 255, 0.1);
  --glow-pink: 0 0 20px rgba(255, 45, 123, 0.35);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.35);

  /* Sizing */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Transitions */
  --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', 'Noto Sans', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-cyan), var(--c-purple));
  border-radius: 3px;
}

/* ── Animated Background ── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.bg-glow--cyan {
  width: 500px;
  height: 500px;
  background: var(--c-cyan);
  top: -200px;
  right: -100px;
  opacity: 0.08;
}

.bg-glow--purple {
  width: 600px;
  height: 600px;
  background: var(--c-purple);
  bottom: -200px;
  left: -150px;
  opacity: 0.07;
}

/* ── Layout ── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(6, 6, 14, 0.75);
  border-bottom: 1px solid var(--c-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--c-text-bright);
}

.logo__icon {
  width: 36px;
  height: 36px;
  background: var(--g-main);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--c-bg);
  letter-spacing: -0.5px;
}

.logo__text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo__text span {
  background: var(--g-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Nav Tabs ── */
.nav {
  display: flex;
  gap: 2px;
  background: var(--c-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

.nav__tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--t-base);
  cursor: pointer;
  border: none;
  background: none;
  white-space: nowrap;
  font-family: inherit;
}

.nav__tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav__tab:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.04);
}

.nav__tab--active {
  color: var(--c-text-bright);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.2);
}

/* ── Language Switcher ── */
.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--c-surface);
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--c-border);
}

.lang-switch__btn {
  padding: 5px 10px;
  border: none;
  background: none;
  color: var(--c-text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: var(--t-fast);
}

.lang-switch__btn:hover {
  color: var(--c-text);
}

.lang-switch__btn--active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--c-cyan);
}

/* ── Glass Card ── */
.card {
  background: var(--c-glass);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--t-base);
}

.card:hover {
  border-color: var(--c-border-bright);
  box-shadow: var(--glow-cyan);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--t-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: var(--t-fast);
}

.btn:hover::before { opacity: 1; }

.btn--primary {
  background: var(--g-main);
  color: var(--c-bg);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.35);
}

.btn--success {
  background: var(--g-success);
  color: var(--c-bg);
}

.btn--danger {
  background: var(--g-danger);
  color: white;
}

.btn--ghost {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

.btn--ghost:hover {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
}

.btn--large {
  padding: 16px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Section Titles ── */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--c-text-bright);
}

.section-title--gradient {
  background: var(--g-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--c-text-dim);
  max-width: 600px;
  line-height: 1.6;
}

/* ── Upload Zone ── */
.upload-zone {
  position: relative;
  width: 100%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 229, 255, 0.02);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text-dim);
  cursor: pointer;
  transition: var(--t-base);
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.05), transparent 70%);
  opacity: 0;
  transition: var(--t-base);
}

.upload-zone:hover {
  border-color: var(--c-cyan);
  color: var(--c-text);
}

.upload-zone:hover::before { opacity: 1; }

.upload-zone--active {
  border-color: var(--c-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.upload-zone__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t-base);
}

.upload-zone:hover .upload-zone__icon {
  background: rgba(0, 229, 255, 0.15);
  box-shadow: var(--glow-cyan);
}

.upload-zone__text {
  font-size: 1rem;
  font-weight: 500;
}

.upload-zone__hint {
  font-size: 0.8rem;
  color: var(--c-text-dim);
}

/* ── Stat Badge ── */
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat__value {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat__value--cyan { color: var(--c-cyan); }
.stat__value--green { color: var(--c-green); }
.stat__value--red { color: var(--c-red); }
.stat__value--purple { color: var(--c-purple); }

.stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-dim);
}

/* ── Progress Bar ── */
.progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--g-main);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Analysis Result ── */
.analysis-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-bar__label {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 80px;
  color: var(--c-text-dim);
}

.analysis-bar__track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.analysis-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
  width: 0;
}

.analysis-bar__fill--ai {
  background: var(--g-danger);
}

.analysis-bar__fill--human {
  background: var(--g-success);
}

.analysis-bar__value {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
}

/* ── Textarea ── */
.textarea {
  width: 100%;
  min-height: 200px;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  transition: var(--t-base);
}

.textarea:focus {
  outline: none;
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

.textarea::placeholder {
  color: var(--c-text-dim);
}

/* ── Result Banner ── */
.result-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  animation: slideUp 0.4s ease;
}

.result-banner--correct {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.25);
  color: var(--c-green);
}

.result-banner--wrong {
  background: rgba(255, 61, 61, 0.08);
  border: 1px solid rgba(255, 61, 61, 0.25);
  color: var(--c-red);
}

/* ── Scanner Animation ── */
.scanner {
  position: relative;
  overflow: hidden;
}

.scanner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--g-main);
  box-shadow: 0 0 20px var(--c-cyan), 0 0 60px var(--c-cyan);
  animation: scan 2s ease-in-out infinite;
  opacity: 0;
  pointer-events: none;
}

.scanner--active::after {
  opacity: 1;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

/* ── Pulse Ring ── */
.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: var(--g-main);
  opacity: 0;
  z-index: -1;
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.02); }
}

/* ── Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.15); }
  50% { box-shadow: 0 0 40px rgba(0, 229, 255, 0.3); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: slideUp 0.5s ease both; }
.animate-in-delay-1 { animation: slideUp 0.5s ease 0.1s both; }
.animate-in-delay-2 { animation: slideUp 0.5s ease 0.2s both; }
.animate-in-delay-3 { animation: slideUp 0.5s ease 0.3s both; }

/* ── Tooltip ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--cyan {
  background: rgba(0, 229, 255, 0.1);
  color: var(--c-cyan);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.badge--green {
  background: rgba(0, 255, 136, 0.1);
  color: var(--c-green);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.badge--red {
  background: rgba(255, 61, 61, 0.1);
  color: var(--c-red);
  border: 1px solid rgba(255, 61, 61, 0.2);
}

.badge--purple {
  background: rgba(180, 74, 255, 0.1);
  color: var(--c-purple);
  border: 1px solid rgba(180, 74, 255, 0.2);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--c-border);
  width: 100%;
}

/* ── Image Display ── */
.image-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-surface-solid);
  transition: var(--t-base);
}

.image-frame:hover {
  border-color: var(--c-border-bright);
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Footer ── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--c-border);
  text-align: center;
  color: var(--c-text-dim);
  font-size: 0.8rem;
  margin-top: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header__inner {
    height: 56px;
  }

  .nav {
    padding: 3px;
  }

  .nav__tab {
    padding: 6px 12px;
    font-size: 0.72rem;
  }

  .nav__tab svg {
    display: none;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .card {
    padding: 1.25rem;
  }

  .btn--large {
    padding: 14px 28px;
    font-size: 1rem;
  }

  .lang-switch__btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .nav__tab {
    padding: 6px 8px;
    font-size: 0.68rem;
  }

  .stat__value {
    font-size: 1.4rem;
  }
}

/* ── Focus & a11y ── */
:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-cyan { color: var(--c-cyan); }
.text-green { color: var(--c-green); }
.text-red { color: var(--c-red); }
.text-purple { color: var(--c-purple); }
.text-dim { color: var(--c-text-dim); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
