/* ==========================================================================
   Funny Faces Hub - Clean Modern Design System
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #0f1115;
  --surface: #151820;
  --surface-hover: #1b1f29;
  --surface-active: #222734;
  --surface-raised: #1d212c;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-active: rgba(255, 255, 255, 0.24);

  --text: #f5f5f5;
  --text-secondary: #cbd5e1;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  --accent: #7c5cfc;
  --accent-hover: #6d4bf5;
  --accent-subtle: rgba(124, 92, 252, 0.12);
  --accent-border: rgba(124, 92, 252, 0.28);
  --accent-text: #a78bfa;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-subtle: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.28);

  --star: #f59e0b;
  --star-subtle: rgba(245, 158, 11, 0.12);
  --star-border: rgba(245, 158, 11, 0.25);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

/* Light Theme Override */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;
  --surface-raised: #ffffff;
  
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-active: #94a3b8;

  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --accent: #6d4bf5;
  --accent-hover: #5b3bd6;
  --accent-subtle: rgba(109, 75, 245, 0.08);
  --accent-border: rgba(109, 75, 245, 0.2);
  --accent-text: #5b3bd6;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-subtle: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.2);

  --star: #d97706;
  --star-subtle: rgba(217, 119, 6, 0.1);
  --star-border: rgba(217, 119, 6, 0.2);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);

  color-scheme: light;
}

/* ---------- Base Reset & Typography ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Layout ---------- */
.app-layout {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
  flex: 1;
}

@media (max-width: 640px) {
  .app-layout {
    padding: 20px 16px 60px;
  }
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

:root[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}
:root[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}
:root:not([data-theme="light"]) .theme-toggle .sun-icon {
  display: block;
}
:root:not([data-theme="light"]) .theme-toggle .moon-icon {
  display: none;
}

/* ---------- Header / Masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.masthead-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}

.masthead-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

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

/* ---------- Admin Auth Controls ---------- */
.admin-auth-bar {
  display: flex;
  align-items: center;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.admin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.admin-label {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Config Banner ---------- */
.config-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 24px;
  color: var(--star);
  font-size: 13px;
}

.config-banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* ---------- Gallery Controls ---------- */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 440px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  opacity: 0.6;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 8px 14px 8px 36px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:hover {
  border-color: var(--border-hover);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.16);
  background: var(--surface-raised);
}

.stats-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ---------- Button System ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  line-height: 1;
  white-space: nowrap;
  outline: none;
}

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

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn--primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.btn--primary:hover:not([disabled]) {
  background: var(--accent-hover);
}

/* Secondary Button */
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover:not([disabled]) {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* Ghost / Quiet Button */
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

:root[data-theme="light"] .btn--ghost:hover:not([disabled]) {
  background: rgba(0, 0, 0, 0.05);
}

/* Danger Button */
.btn--danger {
  background: var(--danger-subtle);
  color: #f87171;
  border-color: var(--danger-border);
}

.btn--danger:hover:not([disabled]) {
  background: var(--danger);
  color: #ffffff;
  border-color: transparent;
}

/* Small Button */
.btn--sm {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

/* Extra Small Button */
.btn--xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

/* Icon Button (Close, Edit, Delete) */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

:root[data-theme="light"] .btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ---------- Spinners ---------- */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- Faces Grid ---------- */
.faces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .faces-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .faces-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Face Card ---------- */
.face-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.face-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #090a0d;
  overflow: hidden;
  cursor: pointer;
}

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

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

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 8px;
}

/* Badges */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}

.badge-category {
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: blur(6px);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-score {
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: blur(6px);
  color: var(--star);
  border: 1px solid var(--star-border);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  cursor: pointer;
  line-height: 1.3;
}

.card-title:hover {
  color: var(--accent-text);
}

.card-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.45;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-actions .btn-detail {
  flex: 1;
}

/* ---------- Skeleton Loading State ---------- */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  pointer-events: none;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.03) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.03) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 75%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  max-width: 440px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Modals & Dialogs ---------- */
.app-dialog {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: hidden;
  outline: none;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.app-dialog[open] {
  animation: modalFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-lg {
  max-width: min(860px, 90vw);
  max-height: 90vh;
  width: 90vw;
}

.modal-md {
  max-width: 540px;
  width: 92%;
}

.modal-sm {
  max-width: 400px;
  width: 90%;
}

.dialog-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.dialog-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dialog-body {
  padding: 22px;
  max-height: calc(90vh - 130px);
  overflow-y: auto;
}

.dialog-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
}

/* ---------- Inspect / Detail View Layout ---------- */
.inspect-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* Image stage - Centers image, respects natural aspect ratio, NO fixed aspect-ratio, NO cropping */
.inspect-img-stage {
  position: relative;
  width: 100%;
  min-height: 220px;
  max-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 14px;
}

/* Inspect Image: Scales down to fit naturally, object-fit contain, NEVER cropped */
.inspect-full-img {
  max-width: 100%;
  max-height: calc(58vh - 28px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
}

/* Loading state inside inspect stage */
.inspect-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  gap: 8px;
}

.inspect-loading .spinner {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

/* Error state inside inspect stage */
.inspect-img-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  gap: 8px;
}

/* Inspect Metadata Section underneath the image */
.inspect-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inspect-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inspect-quote {
  font-size: 14.5px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.inspect-backstory-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.inspect-section-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.inspect-backstory {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.inspect-date-row {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
}

/* Responsive adjustments for mobile */
@media (max-width: 640px) {
  #details-dialog.modal-lg {
    max-width: 95vw;
    width: 95vw;
  }

  #details-dialog .dialog-body {
    padding: 14px;
    max-height: calc(88vh - 120px);
  }

  .inspect-img-stage {
    min-height: 180px;
    max-height: 46vh;
    padding: 8px;
  }

  .inspect-full-img {
    max-height: calc(46vh - 16px);
  }
}

/* ---------- Form Controls ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.err-msg {
  font-size: 13px;
  color: #f87171;
  background: var(--danger-subtle);
  border: 1px solid var(--danger-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.input, .textarea {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
  line-height: 1.45;
}

.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.16);
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  outline: none;
  margin: 10px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.score-display-pill {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Upload Dropzone */
.upload-dropzone {
  display: block;
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.file-input-hidden {
  display: none;
}

.dropzone-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 6px;
  opacity: 0.8;
}

.dropzone-content p {
  margin: 0 0 4px;
  font-size: 13.5px;
  color: var(--text);
}

.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.preview-container img {
  max-height: 180px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

.image-url-toggle summary {
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.15s ease;
}

.image-url-toggle summary:hover {
  color: var(--accent-text);
}

/* ---------- Bulk Upload Thumbnails & Progress ---------- */
.bulk-thumbnails-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.bulk-thumb-chip {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 0 0 auto;
  background: #000;
}

.bulk-thumb-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bulk-thumb-chip.more-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-hover);
}

.bulk-progress-card {
  margin-top: 16px;
  background: var(--bg);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 6px;
}

.progress-percent {
  font-weight: 600;
  color: var(--accent-text);
}

.bulk-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.bulk-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* ---------- Toast Notifications ---------- */
#toastdock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 360px;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.toast-content strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.toast-content p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

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

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.app-footer p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-subtle);
}
