* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --text: #e0e0e8;
  --accent: #3a3a4f;
  --green: #00ff88;
  --yellow: #ffcc00;
  --red: #ff3355;
  --card-bg: #12121a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#wavelet-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#root {
  position: relative;
  z-index: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-anim {
  animation: shake 0.5s ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--green); }
  50% { border-color: var(--accent); }
}

.pulse-anim {
  animation: pulse-border 0.6s ease-in-out 2;
}

@keyframes typewriter-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink::after {
  content: '█';
  animation: typewriter-cursor 0.8s infinite;
  margin-left: 2px;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes glow-green {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }
  50% { box-shadow: 0 0 16px rgba(0, 255, 136, 0.5); }
}

@keyframes glow-yellow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 204, 0, 0.3); }
  50% { box-shadow: 0 0 16px rgba(255, 204, 0, 0.5); }
}

@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 51, 85, 0.3); }
  50% { box-shadow: 0 0 16px rgba(255, 51, 85, 0.5); }
}

.glow-green { animation: glow-green 3s infinite; border-color: var(--green) !important; }
.glow-yellow { animation: glow-yellow 3s infinite; border-color: var(--yellow) !important; }
.glow-red { animation: glow-red 3s infinite; border-color: var(--red) !important; }

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

.scanline-overlay {
  position: relative;
}

.scanline-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  animation: scanlines 0.5s linear infinite;
}

.progress-bar-glow {
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.4), 0 0 16px rgba(0, 255, 136, 0.2);
}

@keyframes shutter-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(30deg); }
}

.drop-zone:hover .shutter-icon {
  animation: shutter-rotate 0.3s ease-in-out;
}

.drop-zone {
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.drop-zone-active {
  border-color: var(--green) !important;
  background-color: rgba(0, 255, 136, 0.03) !important;
}

.drop-zone-error {
  border-color: var(--red) !important;
  background-color: rgba(255, 51, 85, 0.05) !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* Print styles */
@media print {
  body { background: white; color: black; }
  #wavelet-bg { display: none; }
}

.metadata-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.metadata-panel.open {
  max-height: 600px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.history-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.history-drawer.open {
  max-height: 800px;
  overflow-y: auto;
}