/* ==========================================================================
   ImgCSE — Minimalist On-Device Photo Curator Design System
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-app: #090a0f;
  --bg-card: #12151e;
  --bg-card-elevated: #181c28;
  --bg-card-hover: #1e2434;
  --bg-input: #10131c;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  --accent-emerald: #10b981;
  --accent-cyan: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --grad-primary: linear-gradient(135deg, #10b981 0%, #38bdf8 50%, #6366f1 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.25);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================= Header ================= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
}

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

.brand-icon {
  font-size: 28px;
  line-height: 1;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  line-height: 1.3;
}

.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ================= Screen Flow ================= */
.app-main {
  flex: 1;
}

.view-screen {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view-screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ================= 1. Upload Screen ================= */
.hero-section {
  text-align: center;
  max-width: 680px;
  margin: 16px auto 36px auto;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.6;
}

/* Dropzone */
.dropzone-card {
  position: relative;
  background-color: var(--bg-card);
  background-image: var(--grad-surface);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-normal), background-color var(--transition-normal), transform var(--transition-normal);
  max-width: 760px;
  margin: 0 auto 28px auto;
}

.dropzone-card:hover, .dropzone-card.drag-over {
  border-color: var(--accent-cyan);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.dropzone-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dropzone-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: inherit;
}

.dropzone-formats {
  font-size: 12px;
  color: var(--text-muted);
}

/* Staged Files Preview Strip */
.staged-container {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 20;
}

.staged-container.hidden {
  display: none;
}

.staged-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.staged-count {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.staged-thumbs-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.staged-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Settings Accordion */
.settings-wrapper {
  max-width: 760px;
  margin: 0 auto 32px auto;
}

.settings-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.settings-toggle-btn:hover {
  background-color: var(--bg-card-elevated);
  color: var(--text-primary);
}

.settings-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chevron-icon {
  font-size: 11px;
  transition: transform var(--transition-normal);
}

.settings-toggle-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.settings-panel {
  margin-top: 10px;
  padding: 20px;
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.settings-panel.hidden {
  display: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value-badge {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.custom-range:hover {
  background: rgba(255, 255, 255, 0.18);
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  border: 2px solid #ffffff;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-range::-webkit-slider-thumb:hover, .custom-range:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.custom-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  border: 2px solid #ffffff;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 2px;
}

/* Segmented Control for Crop Ratio */
.crop-item {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.segmented-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  max-width: 420px;
}

.segmented-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.active {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Action Buttons */
.action-footer {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--grad-primary);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  padding: 14px 28px;
  font-size: 15px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.btn-primary.btn-large {
  padding: 18px 36px;
  font-size: 17px;
  width: 100%;
  max-width: 440px;
}

.btn-primary.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

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

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

/* Feature Strip */
.feature-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.feature-pill {
  font-size: 12px;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
}

.feature-pill b {
  color: var(--text-primary);
}

/* ================= 2. Live Processing Screen ================= */
.processing-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 60px 24px;
  max-width: 580px;
  margin: 40px auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.spinner-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px auto;
}

.glowing-spinner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-emerald);
  animation: spin 1s linear infinite;
  box-shadow: var(--shadow-glow);
}

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

.spinner-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.processing-status-group {
  margin-bottom: 24px;
}

.progress-percent {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.processing-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.processing-subtext {
  font-size: 14px;
  color: var(--text-secondary);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-input);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 28px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.processing-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= 3. Curated Results Screen ================= */
.results-header-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.results-title-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-emerald);
  margin-bottom: 6px;
}

.results-main-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.stats-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  font-size: 12px;
  padding: 6px 12px;
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.stat-pill.stat-accent {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.stat-pill b {
  color: var(--text-primary);
}

.results-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.photo-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.photo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.photo-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: #000;
  overflow: hidden;
}

.photo-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.photo-card:hover .photo-card-img {
  transform: scale(1.02);
}

.card-top-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.badge-label {
  background: rgba(18, 21, 30, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
}

.badge-score {
  background: rgba(16, 185, 129, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card-scene-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-meta-text {
  font-size: 12px;
  color: var(--text-muted);
}

.card-action-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-card-action {
  flex: 1;
  padding: 8px 12px;
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-card-action:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-card-download {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.btn-card-download:hover {
  background-color: var(--accent-emerald);
  color: #fff;
}

/* Alternates Drawer inside card */
.alternates-drawer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.alternates-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.alt-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.alt-thumb:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* ================= Interactive Modal ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.modal-photo-name {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.btn-icon-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compare-view-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.compare-image-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4 / 5;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.modal-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.modal-nav-arrow:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.prev-arrow {
  left: 12px;
}

.next-arrow {
  right: 12px;
}

.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.compare-img.active {
  opacity: 1;
}

.compare-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.btn-toggle-active {
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-fast);
}

.btn-toggle-active:hover {
  background-color: var(--bg-card-hover);
}

/* Modal Filmstrip Carousel */
.modal-filmstrip-section {
  width: 100%;
  margin-top: 4px;
}

.filmstrip-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.filmstrip-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filmstrip-counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.modal-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
}

.filmstrip-item {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.65;
  transition: all var(--transition-fast);
}

.filmstrip-item:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.filmstrip-item.active {
  opacity: 1;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  transform: translateY(-2px);
}

.filmstrip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filmstrip-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}

.filmstrip-badge.best-badge {
  background: var(--accent-emerald);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-set-best {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.3));
  border: 1px solid rgba(234, 179, 8, 0.6);
  color: #fef08a;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-set-best:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.4), rgba(245, 158, 11, 0.5));
  border-color: #facc15;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.4);
}


/* ================= Toast & Footer ================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-card-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

.toast.hidden {
  display: none;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.app-footer {
  margin-top: auto;
  text-align: center;
  padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= Mobile Responsiveness ================= */
@media (max-width: 640px) {
  .app-container {
    padding: 0 16px 40px 16px;
  }

  .results-header-card {
    padding: 20px 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .results-header-actions {
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 26px;
  }

  .dropzone-card {
    padding: 32px 16px;
  }

  .feature-strip {
    flex-direction: column;
    align-items: center;
  }
}

/* ================= App Footer ================= */
.app-footer {
  margin-top: 56px;
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent-cyan);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: var(--bg-hover);
  transform: translateY(-1px);
}

