:root {
  --bg-deep: #0d0d1a;
  --bg-card: rgba(30, 28, 50, 0.6);
  --bg-card-hover: rgba(40, 38, 65, 0.7);
  --text-primary: #eee8f5;
  --text-muted: #8a839e;
  --accent-amber: #f0a050;
  --accent-rose: #e06090;
  --accent-violet: #9060e0;
  --accent-teal: #50c0b0;
}

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

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Bricolage Grotesque', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated top gradient bar */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.top-bar {
  height: 3px;
  background: linear-gradient(90deg, #c4713b, var(--accent-amber), var(--accent-rose), var(--accent-teal), var(--accent-violet), var(--accent-amber));
  background-size: 300% 100%;
  animation: gradientShift 6s ease infinite;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Rainbow gradient text */
.chromashift-title {
  font-weight: 800;
  font-size: 3rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose), var(--accent-violet), var(--accent-teal));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

@media (max-width: 640px) {
  .chromashift-title { font-size: 2rem; }
}

/* Glassmorphism panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}

/* Upload drop zone */
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 16px;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(240,160,80,0.0), rgba(224,96,144,0.0), rgba(144,96,224,0.0));
  transition: all 0.5s ease;
  border-radius: 16px;
}

.drop-zone:hover {
  border-color: rgba(240,160,80,0.4);
}

.drop-zone:hover::before {
  background: linear-gradient(135deg, rgba(240,160,80,0.05), rgba(224,96,144,0.08), rgba(144,96,224,0.05));
}

.drop-zone.drag-over {
  border-color: var(--accent-rose);
  transform: scale(1.01);
}

.drop-zone.drag-over::before {
  background: linear-gradient(135deg, rgba(240,160,80,0.1), rgba(224,96,144,0.12), rgba(144,96,224,0.08));
}

/* Colorize button */
.colorize-btn {
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-rose), var(--accent-amber));
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  border: none;
  color: white;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 40px;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 25px rgba(144, 96, 224, 0.3);
}

.colorize-btn:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 6px 35px rgba(224, 96, 144, 0.4);
}

.colorize-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Style pills */
.style-pill {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.style-pill:hover {
  border-color: rgba(240,160,80,0.3);
  color: var(--text-primary);
}

.style-pill.active {
  border-color: var(--accent-rose);
  background: rgba(224,96,144,0.12);
  color: var(--text-primary);
}

/* Before/After slider */
.comparison-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  cursor: col-resize;
  touch-action: none;
}

.comparison-container img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.comparison-after img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: white;
  z-index: 10;
  pointer-events: none;
}

.comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  pointer-events: none;
}

.comparison-label {
  position: absolute;
  top: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 5;
}

.label-before {
  left: 12px;
  background: rgba(0,0,0,0.5);
  color: #999;
}

.label-after {
  right: 12px;
  background: rgba(224,96,144,0.3);
  color: var(--accent-rose);
}

/* Processing animation */
@keyframes colorWash {
  0% { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.color-wash-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(240,160,80,0.15), 
    rgba(224,96,144,0.15), 
    rgba(144,96,224,0.15), 
    rgba(80,192,176,0.15)
  );
  animation: colorWash 3s ease-in-out infinite;
  border-radius: 12px;
  pointer-events: none;
}

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

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

/* History strip */
.history-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.history-thumb:hover {
  border-color: var(--accent-amber);
  transform: scale(1.08);
}

/* Scrollbar */
.history-strip::-webkit-scrollbar {
  height: 4px;
}
.history-strip::-webkit-scrollbar-track {
  background: transparent;
}
.history-strip::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

/* Pulse animation for processing */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse-text {
  animation: pulse 2s ease-in-out infinite;
}

/* Spin animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 2s linear infinite;
}

/* Secondary button */
.btn-secondary {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}

.sample-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.sample-btn:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

/* Input */
.hint-input {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}

.hint-input:focus {
  border-color: rgba(144,96,224,0.4);
}

.hint-input::placeholder {
  color: rgba(138,131,158,0.5);
}

/* Footer */
footer a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent-amber);
}