/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

html {
  font-size: 16px;
}

/* Header */
.app-header {
  background: #2563eb;
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
}

.back-link:hover {
  opacity: 0.8;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  flex: 1;
}

/* Main Content */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Checklist Index (Home Page) */
.checklist-index {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checklist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.checklist-card-icon {
  font-size: 2rem;
  color: #2563eb;
  width: 50px;
  text-align: center;
}

.checklist-card-content {
  flex: 1;
}

.checklist-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.checklist-card-description {
  color: #6b7280;
  margin: 0;
  font-size: 0.95rem;
}

.checklist-card-arrow {
  font-size: 1.25rem;
  color: #9ca3af;
}

.checklist-separator {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 1rem 0;
}

/* Sections */
.section {
  margin-bottom: 1rem;
}

.section-header {
  background: #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
  transition: background 0.2s;
}

.section-header:hover {
  background: #d1d5db;
}

.section-caret {
  font-size: 0.875rem;
  width: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}

.section.open .section-caret {
  transform: rotate(90deg);
}

.section-title {
  font-weight: 600;
  flex: 1;
  font-size: 1rem;
}

.section-progress {
  font-size: 0.875rem;
  color: #6b7280;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.section-content {
  padding-top: 0.5rem;
}

.section:not(.open) .section-content {
  display: none;
}

/* Step Cards */
.step-card {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: opacity 0.2s, background 0.2s;
}

.step-checkbox {
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
  flex-shrink: 0;
  padding: 0;
  transition: color 0.2s;
}

.step-checkbox:hover {
  color: #6b7280;
}

.step-checkbox.checked {
  color: #22c55e;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  transition: color 0.2s, text-decoration 0.2s;
}

.step-description {
  color: #4b5563;
  font-size: 0.95rem;
  white-space: pre-line;
}

.step-image-container {
  flex-shrink: 0;
}

.step-image {
  max-width: 200px;
  max-height: 150px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.step-image:hover {
  transform: scale(1.05);
}

/* Checked State - collapsed to title only */
.step-card.checked {
  opacity: 0.6;
  background: #f9fafb;
  padding: 0.75rem 1rem;
}

.step-card.checked .step-title {
  text-decoration: line-through;
  color: #9ca3af;
  margin-bottom: 0;
}

.step-card.checked .step-description {
  display: none;
}

.step-card.checked .step-image-container {
  display: none;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

/* Error State */
.error {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

  .header-content {
    gap: 0.5rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .step-card {
    flex-wrap: wrap;
  }

  .step-content {
    flex: 1 1 0;
    min-width: calc(100% - 3rem);
  }

  .step-image-container {
    width: calc(100% - 2.5rem);
    margin-top: 0.5rem;
    margin-left: 2.5rem;
  }

  .step-image {
    max-width: 100%;
    max-height: none;
  }

  .step-card.checked .step-image-container {
    display: none;
  }

  .section-header {
    padding: 0.75rem;
  }

  .checklist-card {
    padding: 1rem;
  }

  .checklist-card-icon {
    font-size: 1.5rem;
    width: 40px;
  }
}
