/**
 * LakásŐr - Checklist Styles
 * View toggle, interactive checkboxes, progress bar, PDF button
 */

/* ─────────────────────────────────────────────────────────────────────────
   VIEW TOGGLE
   ───────────────────────────────────────────────────────────────────────── */

.checklist-view-toggle {
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.toggle-wrapper {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  max-width: 500px;
  margin: 0 auto;
  background: var(--color-bg);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
}

.toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.toggle-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.toggle-icon {
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .toggle-wrapper {
    max-width: 100%;
  }
  
  .toggle-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    flex-direction: column;
    gap: var(--space-1);
  }
  
  .toggle-text {
    display: block;
    font-size: 11px;
  }
  
  .toggle-icon {
    font-size: 1.2rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   PDF EXPORT CONTAINER
   ───────────────────────────────────────────────────────────────────────── */

.pdf-export-container {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.pdf-export-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.pdf-export-btn svg {
  flex-shrink: 0;
}

.reset-checklist-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.reset-checklist-btn .icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.btn-outline:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

/* ─────────────────────────────────────────────────────────────────────────
   INTERACTIVE CHECKLIST
   ───────────────────────────────────────────────────────────────────────── */

.checklist-interactive {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist-item {
  padding: 0;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background: var(--color-surface-hover);
}

.checklist-item.checked {
  background: rgba(16, 185, 129, 0.05);
}

.checklist-item.checked .checklist-text {
  color: var(--color-text-secondary);
}

.checklist-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  cursor: pointer;
  user-select: none;
}

.checklist-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checklist-checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-border-hover);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 1px;
}

.checklist-checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition-fast);
}

.checklist-checkbox:checked + .checklist-checkmark {
  background: var(--color-success);
  border-color: var(--color-success);
}

.checklist-checkbox:checked + .checklist-checkmark::after {
  transform: rotate(45deg) scale(1);
}

.checklist-checkbox:focus-visible + .checklist-checkmark {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.checklist-text {
  flex: 1;
  color: var(--color-text);
  line-height: 1.5;
  transition: color var(--transition-fast);
}

/* ─────────────────────────────────────────────────────────────────────────
   PROGRESS BAR
   ───────────────────────────────────────────────────────────────────────── */

.checklist-progress {
  padding: var(--space-2);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.progress-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
}

.progress-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.progress-bar-container {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────────────────
   EXISTING CHECKBOX OVERRIDE
   ───────────────────────────────────────────────────────────────────────── */

#tenant-checklist-content li[data-id] {
  list-style: none !important;
  padding: 0 !important;
  border-bottom: 1px solid var(--color-border);
}

#tenant-checklist-content li[data-id]:last-child {
  border-bottom: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .checklist-view-toggle {
    top: 56px;
    padding: var(--space-4) var(--space-3);
  }
  
  .pdf-export-container {
    flex-wrap: wrap;
  }
  
  .pdf-export-btn {
    width: 100%;
    justify-content: center;
  }
  
  .checklist-label {
    padding: var(--space-3) var(--space-1);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────────────────────────────────── */

@media print {
  .checklist-view-toggle,
  .pdf-export-container,
  .navbar,
  .footer,
  .checklist-summary,
  .checklist-share-panel {
    display: none !important;
  }
  
  .checklist-checkmark {
    border: 2px solid #333 !important;
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .checklist-checkbox:checked + .checklist-checkmark {
    background: #10b981 !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   SUMMARY PANEL (Progress Overview)
   ───────────────────────────────────────────────────────────────────────── */

.checklist-summary {
  padding: var(--space-4);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.summary-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  max-width: 600px;
  margin: 0 auto;
}

.summary-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 300px;
}

.summary-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.summary-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease, background-color 0.4s ease;
  background: var(--color-primary);
}

.summary-progress-fill.progress-low {
  background: var(--color-danger, #ef4444);
}

.summary-progress-fill.progress-medium {
  background: var(--color-warning, #f59e0b);
}

.summary-progress-fill.progress-high {
  background: var(--color-primary, #6366f1);
}

.summary-progress-fill.progress-complete {
  background: var(--color-success, #22c55e);
}

.summary-progress-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.summary-stats {
  display: flex;
  gap: var(--space-4);
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  min-width: 60px;
}

.summary-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.summary-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-stat-done .summary-stat-value {
  color: var(--color-success, #22c55e);
}

.summary-stat-remaining .summary-stat-value {
  color: var(--color-text-secondary);
}

@media (max-width: 480px) {
  .summary-content {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .summary-progress {
    width: 100%;
    max-width: none;
  }
  
  .summary-stats {
    width: 100%;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   SHARE PANEL (Export/Import)
   ───────────────────────────────────────────────────────────────────────── */

.checklist-share-panel {
  padding: var(--space-6) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.share-card {
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-5);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.share-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.share-description {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.share-code-section {
  text-align: left;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.share-code-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.share-code-wrapper {
  display: flex;
  gap: var(--space-2);
}

.share-code-input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-family: monospace;
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.share-code-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn-icon {
  padding: var(--space-2);
  min-width: auto;
}
