/* ==========================================================================
   忆彩 AI · 老照片高清修复工作室 (Old Photo Studio)
   UI/UX Pro Max Enterprise Glassmorphism Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Modern CSS Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --slider-pos: 50%;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg-deep: #030712;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.35);
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --emerald-500: #10b981;
  --amber-500: #f59e0b;
  --accent-glow: rgba(14, 165, 233, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Polished Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: #030712;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.14) 0%, rgba(99, 102, 241, 0.06) 40%, transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.04) 0%, transparent 40%);
}

/* Header */
.app-header {
  height: 60px;
  min-height: 60px;
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-engine {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Version Pill Container */
.version-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 41, 59, 0.7);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.version-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.version-pill.active {
  background: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--indigo-500));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.45);
}

/* Main Workspace */
.app-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Stage Area (Left / Center) */
.stage-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Empty Dropzone State */
.dropzone-card {
  width: 100%;
  max-w-width: 480px;
  max-width: 480px;
  padding: 40px 24px;
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropzone-card:hover, .dropzone-card.drag-over {
  border-color: var(--primary-500);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 32px rgba(14, 165, 233, 0.2);
  transform: translateY(-2px);
}

.dropzone-icon-box {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 18px;
}

.dropzone-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.dropzone-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 360px;
  margin-bottom: 22px;
}

.dropzone-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.feature-tag {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 9999px;
}

/* Comparison Stage Window */
.comparison-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 960px;
  max-height: calc(100vh - 100px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.1);
  touch-action: none;
  user-select: none;
}

.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

#beforeClippedContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  clip-path: polygon(0 0, var(--slider-pos) 0, var(--slider-pos) 100%, 0 100%);
  will-change: clip-path;
}

/* Slider Handle Line & Knob */
#sliderHandle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos);
  transform: translateX(-50%);
  width: 2px;
  background: #ffffff;
  cursor: ew-resize;
  z-index: 25;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: left;
}

.slider-knob {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #090d16;
  backdrop-filter: blur(12px);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), 0 4px 14px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-knob-grip {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.slider-knob-grip span {
  width: 2px;
  height: 11px;
  background: #e0f2fe;
  border-radius: 1px;
  opacity: 0.9;
}

/* Comparison Badges */
.stage-badge {
  position: absolute;
  top: 14px;
  z-index: 20;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.stage-badge-left {
  left: 14px;
  background: rgba(8, 12, 22, 0.85);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stage-badge-right {
  right: 14px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.25);
}

/* Float Stage Controls Toolbar */
.stage-toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.tool-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tool-btn:active {
  transform: scale(0.95);
}

.tool-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
}

/* Loading Overlay & Animation */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.spinner-box {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.loading-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.loading-desc {
  font-size: 12px;
  color: #94a3b8;
  max-width: 320px;
  line-height: 1.5;
}

.progress-track {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  margin-top: 18px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  border-radius: 9999px;
  animation: progressPulse 2.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0% { left: -40%; width: 40%; }
  50% { left: 40%; width: 60%; }
  100% { left: 100%; width: 40%; }
}

/* Chat Assistant Panel (Right Column) */
.chat-aside {
  width: 360px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: width 0.3s ease;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.chat-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.chat-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* Preset Chips */
.presets-scroller {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.presets-scroller::-webkit-scrollbar {
  display: none;
}

.preset-chip {
  font-size: 11px;
  white-space: nowrap;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.preset-chip:active {
  transform: scale(0.96);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg-row.user-msg {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.msg-avatar-ai {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.msg-avatar-user {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-bubble-ai {
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

.msg-bubble-user {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* Chat Input Bar */
.chat-form {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.chat-send-btn {
  background: var(--primary-500);
  color: #ffffff;
  border: none;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  background: var(--primary-600);
}

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

/* Utilities */
.hidden {
  display: none !important;
}

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

/* Responsive Rules (Mobile & Tablet) */
@media (max-width: 1024px) {
  html, body {
    overflow: auto;
  }
  .app-container {
    height: auto;
    min-height: 100vh;
  }
  .app-workspace {
    flex-direction: column;
    overflow: visible;
  }
  .stage-section {
    padding: 10px;
    min-height: 55vh;
  }
  .comparison-container {
    height: 55vh;
    max-height: none;
  }
  .chat-aside {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    min-height: 380px;
  }
  .app-header {
    padding: 0 12px;
  }
}

/* ==========================================================================
   UI/UX Pro Max - Advanced Micro-interactions & Toast System
   ========================================================================== */

/* Toast Notification System */
#toastContainer {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 20px rgba(14, 165, 233, 0.15);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(40px) scale(0.95);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-success { border-color: rgba(16, 185, 129, 0.45); }
.toast-success .toast-icon { color: #34d399; }

.toast-error { border-color: rgba(244, 63, 94, 0.45); }
.toast-error .toast-icon { color: #fb7185; }

.toast-warning { border-color: rgba(245, 158, 11, 0.45); }
.toast-warning .toast-icon { color: #fbbf24; }

.toast-info { border-color: rgba(14, 165, 233, 0.45); }
.toast-info .toast-icon { color: #38bdf8; }

.toast-body {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.toast-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Sample Photo Quick Try Cards */
.sample-shelf {
  width: 100%;
  max-width: 480px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sample-shelf-title {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-cards-row {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.sample-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.sample-chip:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2);
}

.sample-chip:active {
  transform: scale(0.97);
}

.sample-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sample-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sample-name {
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-tag {
  font-size: 9px;
  color: #38bdf8;
}

/* Slider Knob Aura & Ripple */
.slider-knob::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.25);
  z-index: -1;
  animation: knobPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes knobPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 0; }
}

/* Fullscreen Comparison Container Mode */
.comparison-container.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  z-index: 1000 !important;
  background: #000000 !important;
}

/* Modal Pop-In Animation */
.modal-dialog {
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Animated QR Code Scanline */
.qr-scanner-box {
  position: relative;
  overflow: hidden;
}

.qr-scanner-box::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  box-shadow: 0 0 10px #38bdf8;
  animation: qrScan 2.4s ease-in-out infinite;
}

@keyframes qrScan {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Tool Buttons Active State */
.tool-btn.active {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
