/* Pixaroid Premium Design System v2.0 */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #ec4899;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-dropzone: #f1f5f9;
  --bg-dropzone-active: #e0e7ff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-dropzone: #334155;
  --bg-dropzone-active: #312e81;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Premium Dropzone */
.dropzone-premium {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 60px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.dropzone-premium:hover, .dropzone-premium.drag-over {
  border-color: var(--primary);
  background: var(--bg-dropzone-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.dropzone-icon {
  width: 80px; height: 80px; margin: 0 auto 24px;
  background: linear-gradient(135deg, #e0e7ff, #fae8ff);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--primary);
}
.dropzone-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.dropzone-sub { color: var(--text-muted); font-size: 1rem; }
.dropzone-hint { margin-top: 16px; font-size: 0.875rem; color: var(--text-light); display: flex; justify-content: center; gap: 12px; }
.kbd { background: var(--border); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.75rem; }

/* Tool Controls */
.tool-controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin: 32px 0; opacity: 0; transform: translateY(20px);
  transition: all 0.4s ease; pointer-events: none;
}
.tool-controls.active { opacity: 1; transform: translateY(0); pointer-events: all; }
.control-card {
  background: var(--bg-card); padding: 20px; border-radius: var(--radius-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.control-label { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; display: block; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-btn {
  background: var(--bg-dropzone); border: 1px solid transparent;
  padding: 10px; border-radius: 6px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; color: var(--text-main);
}
.preset-btn:hover { background: var(--border); }
.preset-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3); }

/* Progress */
.processing-area { display: none; margin-top: 32px; }
.processing-area.active { display: block; }
.progress-container { background: var(--bg-dropzone); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.progress-bar-bg { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 12px 0; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; transition: width 0.3s ease; border-radius: 4px; }
.progress-text { display: flex; justify-content: space-between; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }

/* Comparison Slider */
.comparison-wrapper {
  position: relative; width: 100%; max-width: 800px;
  margin: 32px auto; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  display: none;
}
.comparison-wrapper.active { display: block; }
.comparison-container { position: relative; width: 100%; padding-top: 66.66%; overflow: hidden; }
.comp-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.comp-img-after { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); z-index: 2; }
.comp-slider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 4px;
  background: white; z-index: 10; cursor: ew-resize;
  transform: translateX(-50%); box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.comp-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.comp-label {
  position: absolute; top: 16px; padding: 4px 12px;
  background: rgba(0,0,0,0.7); color: white; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; backdrop-filter: blur(4px); z-index: 5;
}
.label-before { left: 16px; }
.label-after { right: 16px; }

/* Action Buttons */
.action-buttons {
  display: flex; gap: 16px; justify-content: center; margin-top: 32px;
  opacity: 0; transform: translateY(20px); transition: all 0.4s ease; pointer-events: none;
}
.action-buttons.active { opacity: 1; transform: translateY(0); pointer-events: all; }
.btn {
  padding: 14px 32px; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem;
  cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}
.btn-secondary {
  background: var(--bg-card); color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-dropzone); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.stat-card {
  background: var(--bg-card); padding: 16px; border-radius: var(--radius-md);
  text-align: center; border: 1px solid var(--border);
}
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: 0.875rem; color: var(--text-muted); }

/* Toast */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 12px;
}
.toast {
  background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1); border-left: 4px solid var(--primary);
  display: flex; align-items: center; gap: 12px; min-width: 300px;
  animation: slideIn 0.3s ease forwards;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr; }
  .comparison-container { padding-top: 100%; }
  .action-buttons { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
