/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.015) 2px,
    rgba(0, 229, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Grid background pattern */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  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: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0f1a; }
::-webkit-scrollbar-thumb { background: #00bcd4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00e5ff; }

/* Pulse glow animation */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 229, 255, 0.3), 0 0 20px rgba(0, 229, 255, 0.1); }
  50% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.6), 0 0 40px rgba(0, 229, 255, 0.2); }
}

@keyframes radarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes flagWave {
  0%, 100% { transform: perspective(400px) rotateY(0deg) scaleX(1); }
  25% { transform: perspective(400px) rotateY(2deg) scaleX(1.01); }
  75% { transform: perspective(400px) rotateY(-2deg) scaleX(0.99); }
}

@keyframes matrixRain {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes stampReveal {
  0% { transform: scale(3) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1) rotate(-15deg); opacity: 0.8; }
  100% { transform: scale(1) rotate(-15deg); opacity: 0.15; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
.animate-radar { animation: radarSweep 3s linear infinite; }
.animate-blink { animation: blink 1.5s ease-in-out infinite; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-slide-in-right { animation: slideInRight 0.4s ease-out forwards; }
.animate-flag-wave { animation: flagWave 4s ease-in-out infinite; }
.animate-stamp { animation: stampReveal 0.5s ease-out forwards; }
.animate-wiggle:hover { animation: wiggle 0.4s ease-in-out; }

/* Textarea terminal effect */
.terminal-input {
  background: #0a0f1a;
  border: 1px solid #1a2233;
  transition: all 0.3s ease;
  position: relative;
}
.terminal-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2), inset 0 0 10px rgba(0, 229, 255, 0.05);
  outline: none;
}

/* Glowing border cards */
.glow-card {
  border: 1px solid rgba(0, 229, 255, 0.15);
  transition: all 0.3s ease;
}
.glow-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
}

/* Category tile hover */
.category-tile {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}
.category-tile::after {
  content: '▶ DECLASSIFY';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.category-tile:hover::after {
  opacity: 1;
}
.category-tile:hover {
  transform: scale(1.02);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

/* Loading globe */
.loading-globe {
  width: 120px;
  height: 120px;
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-radius: 50%;
  position: relative;
}
.loading-globe::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border: 2px solid transparent;
  border-top-color: #00e5ff;
  border-radius: 50%;
  animation: radarSweep 1.5s linear infinite;
}
.loading-globe::after {
  content: '';
  position: absolute;
  top: 10%; left: 10%; right: 10%; bottom: 10%;
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 50%;
}

/* Classified watermark */
.watermark-classified {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-family: 'Orbitron', monospace;
  font-size: 4rem;
  font-weight: 900;
  color: rgba(255, 23, 68, 0.08);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.2em;
}

/* Modal backdrop blur */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* LCD digits */
.lcd-display {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: #00e5ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* Staggered children animations */
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.9s; }
.stagger-children > *:nth-child(10) { animation-delay: 1.0s; }
.stagger-children > *:nth-child(11) { animation-delay: 1.1s; }
.stagger-children > *:nth-child(12) { animation-delay: 1.2s; }

/* Year slider custom */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}
input[type="range"]::-webkit-slider-track {
  height: 4px;
  background: linear-gradient(to right, #1a2233, #00bcd4, #1a2233);
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #00e5ff;
  border-radius: 50%;
  margin-top: -7px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 4px;
  background: linear-gradient(to right, #1a2233, #00bcd4, #1a2233);
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #00e5ff;
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  cursor: pointer;
}

/* History sidebar */
.history-item {
  transition: all 0.2s ease;
  cursor: pointer;
}
.history-item:hover {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.3);
}

/* Copy button feedback */
.copy-flash {
  animation: fadeInUp 0.3s ease-out;
}

@media (max-width: 768px) {
  .watermark-classified {
    font-size: 2rem;
  }
}