/*
 * Purpose: Page-specific styles for reinigung (cleaning checklist + photo evidence).
 * Reuses layout primitives from aufgaben.css; only overrides + adds what's unique here.
 */

.reinigung-content {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  align-items: start;
}

/* Panel header: icon badge + title + progress chip */

.reinigung-panel-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reinigung-panel-title h2 { margin-bottom: 4px; }

.reinigung-panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--success-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reinigung-panel-icon svg { width: 20px; height: 20px; stroke: var(--success); }

.reinigung-progress-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-glass);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.reinigung-progress-chip.is-muted {
  color: var(--text-secondary);
  background: var(--glass-8);
}

.reinigung-progress-chip.is-partial {
  color: var(--warning);
  background: var(--warning-glass);
}

/* The employee checklist's "X von Y erledigt" chip never gets an is-partial/
   is-muted class from JS (unlike the management list, which does) — without
   this it renders success-green even at 0 of 5 done, which reads as done
   when it isn't. Derive the same states purely from checkbox state so the
   two views agree on what "done" looks like. */
.reinigung-checklist-panel:has(#reinigung-task-list:empty) .reinigung-progress-chip {
  color: var(--text-secondary);
  background: var(--glass-8);
}

.reinigung-checklist-panel:has(#reinigung-task-list input:not(:checked)) .reinigung-progress-chip {
  color: var(--warning);
  background: var(--warning-glass);
}

/* Empty state: template has zero tasks (all removed via "Aufgaben bearbeiten"). */
#reinigung-task-list:empty::after {
  content: "Keine Aufgaben hinterlegt. Über «Aufgaben bearbeiten» hinzufügen.";
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  background: var(--glass-4);
  border: 1px dashed var(--border-glass-mid);
  border-radius: var(--r-sm);
}

/* Completed items: the row itself only carries the native checkbox tick as
   a status signal today — add a readable-beyond-color complete treatment
   (strikethrough + dimmed text + tinted row) driven purely by check state. */
#reinigung-task-list .check-item {
  padding: 14px;
}

#reinigung-task-list .check-item:has(input:checked) {
  background: var(--success-glass);
  border-color: rgba(48, 209, 88, 0.28);
}

#reinigung-task-list .check-item:has(input:checked) span {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* Photo evidence panel + dropzone */

.reinigung-photo-panel { display: flex; flex-direction: column; }

.image-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  padding: 36px 20px;
  border-radius: var(--r-lg);
  background: var(--glass-4);
  border: 1.5px dashed var(--border-glass-mid);
  color: inherit;
  cursor: pointer;
  /* Reset leakage from the generic `button` rule in app.css (gradient bg,
     glow shadow, shimmer sweep, hover lift) now that this is a real <button>
     for native keyboard (Enter/Space) activation. */
  box-shadow: none;
  overflow: visible;
  transition:
    background var(--t-base) var(--ease-snappy),
    border-color var(--t-base) var(--ease-snappy);
}

.image-dropzone::after { display: none; }

.image-dropzone:hover,
.image-dropzone.is-dragover {
  background: var(--success-glass);
  border-color: var(--success);
  transform: none;
  filter: none;
  box-shadow: none;
}

.image-dropzone:active {
  transform: none;
  filter: none;
  box-shadow: none;
}

.image-dropzone:focus-visible {
  outline: none;
  border-color: var(--border-primary);
  box-shadow: 0 0 0 3px rgba(255, 51, 71, 0.12);
}

.image-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-8);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.image-dropzone-icon svg { width: 20px; height: 20px; stroke: var(--text-secondary); }

.image-dropzone:hover .image-dropzone-icon,
.image-dropzone.is-dragover .image-dropzone-icon { background: var(--success); }
.image-dropzone:hover .image-dropzone-icon svg,
.image-dropzone.is-dragover .image-dropzone-icon svg { stroke: #fff; }

.image-dropzone strong { font-size: 14px; color: var(--text); }
.image-dropzone span { font-size: 12px; color: var(--text-secondary); }

.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.image-preview-item {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-glass-mid);
  box-shadow: var(--shadow-card);
}

.image-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  border: none;
  padding: 0;
  box-shadow: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-snappy);
}

.image-preview-item:hover .image-preview-remove,
.image-preview-item:focus-within .image-preview-remove { opacity: 1; }

/* Touch devices have no :hover — keep the remove control reachable without it. */
@media (hover: none) {
  .image-preview-remove { opacity: 1; }
}

/* Responsive overrides for this breakpoint. */
@media (max-width: 820px) {
  .reinigung-content { grid-template-columns: 1fr; }
}
