:root {
  --bg-deep: #0a0a1a;
  --bg-main: #0f0f23;
  --bg-card: #161631;
  --bg-card-hover: #1c1c3d;
  --accent-blue: #00d4ff;
  --accent-purple: #7c3aed;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
}

* { box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-deep);
  margin: 0;
}

.font-mono {
  font-family: 'IBM Plex Mono', monospace !important;
}

.bg-forge-bg {
  background: linear-gradient(135deg, #0a0a1a 0%, #0f0f23 40%, #0d1025 100%);
  min-height: 100vh;
}

.glass-card {
  background: rgba(22, 22, 49, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(30, 41, 59, 0.6);
  border-radius: 12px;
}

.glass-card-bright {
  background: rgba(30, 30, 60, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 12px;
}

.drop-zone {
  border: 2px dashed rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}

.drop-zone:hover {
  border-color: rgba(0, 212, 255, 0.5);
}

.encode-btn {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border: none;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 32px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.encode-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

.encode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.encode-btn.encoding {
  animation: pulse-encode 2s ease-in-out infinite;
}

@keyframes pulse-encode {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
  50% { box-shadow: 0 0 20px 5px rgba(0, 212, 255, 0.2); }
}

.download-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 32px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.cancel-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: white;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.terminal-log {
  background: #0c0c0c;
  border: 1px solid #1e293b;
  border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #10b981;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.terminal-log::-webkit-scrollbar {
  width: 6px;
}

.terminal-log::-webkit-scrollbar-track {
  background: #0c0c0c;
}

.terminal-log::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring circle {
  transition: stroke-dashoffset 0.3s ease;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  border: 2px solid #0f0f23;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  border: 2px solid #0f0f23;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #1e293b;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-switch.active {
  background: var(--accent-blue);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

.film-reel {
  display: inline-block;
  animation: spin-slow 8s linear infinite;
}

.film-reel.active {
  animation: spin-fast 1s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-fast {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

select, input[type="number"], input[type="text"] {
  background: #0f0f23;
  border: 1px solid #1e293b;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

select:focus, input[type="number"]:focus, input[type="text"]:focus {
  border-color: var(--accent-blue);
}

@media (max-width: 768px) {
  .layout-panels {
    flex-direction: column !important;
  }
}

.frame-preview-canvas {
  border: 1px solid #1e293b;
  border-radius: 6px;
  background: #0a0a0a;
}