/* Weekly Cleaning Schedule Specific Styles */

.container-wrapper {
  max-width: 900px;
  margin: 0 auto 80px auto;
}

.container {
  width: 900px;
  background-color: #ffffff;
  padding: 50px 60px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  aspect-ratio: 1 / 1.414;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-shrink: 0;
}

.title {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 6px;
  margin: 0;
  color: #1a1a1a;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #1a1a1a;
}

.date-input {
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 2px 0;
  font-size: 14px;
  outline: none;
  background: transparent;
  width: 160px;
  color: #1a1a1a;
}

.date-input:focus {
  border-bottom-color: #666;
}

/* Schedule Grid - 3 columns */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 40px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.day-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.day-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 0 0 10px 0;
  flex-shrink: 0;
}

.task-lines {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.task-line {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid #999;
  background-color: white;
  position: relative;
  border-radius: 3px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.task-checkbox:checked {
  background-color: #082845;
  border-color: #082845;
}

.task-checkbox:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 11px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.task-checkbox.circular {
  border-radius: 50%;
}

.task-input {
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 2px 0;
  font-size: 14px;
  outline: none;
  background: transparent;
  flex: 1;
  color: #1a1a1a;
}

.task-input:focus {
  border-bottom-color: #666;
}

/* Everyday Section - spans 2 columns */
.everyday-section {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  min-height: 0;
  overflow: hidden;
}

.everyday-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.everyday-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.everyday-header {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-bottom: 10px;
  flex-shrink: 0;
  height: 17px;
}

.day-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.day-label {
  width: 18px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  color: #1a1a1a;
}

.everyday-lines {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.everyday-line {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

.everyday-input {
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 2px 0;
  font-size: 14px;
  outline: none;
  background: transparent;
  width: 100%;
  color: #1a1a1a;
}

.everyday-input:focus {
  border-bottom-color: #666;
}

.checkbox-lines {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.checkbox-line {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

.day-checkboxes {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.day-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid #999;
  background-color: white;
  position: relative;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.day-checkbox:checked {
  background-color: #082845;
  border-color: #082845;
}

.day-checkbox:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 11px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.day-checkbox.circular {
  border-radius: 50%;
}

/* Controls */
.controls {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
}

.toggle-group {
  display: flex;
  gap: 24px;
  align-items: center;
}

.week-toggle,
.checkbox-style-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
}

.toggle-button {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  padding: 0;
  cursor: pointer;
}

.toggle-option {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  color: #6b7280;
  user-select: none;
}

.toggle-option.active {
  background-color: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.print-btn,
.save-pdf-btn {
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  background-color: #082845;
}

.print-btn:hover,
.save-pdf-btn:hover {
  background-color: #0a3a5c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 40, 69, 0.3);
}

/* Tablet & Mobile Scaling */
@media (max-width: 940px) {
  .container-wrapper {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    padding: 0;
    overflow: visible;
  }

  .container {
    transform-origin: top center;
    flex-shrink: 0;
    aspect-ratio: auto;
    height: 1272.6px; /* 900 * 1.414 to maintain A4 ratio */
    overflow: hidden;
  }
}

/* Tablet Controls Layout (769px - 940px) */
@media (max-width: 940px) and (min-width: 769px) {
  .controls {
    flex-direction: column;
    gap: 16px;
    padding: 24px 40px;
    align-items: stretch;
  }

  .toggle-group {
    flex-direction: row;
    justify-content: flex-start;
    gap: 32px;
  }

  .week-toggle,
  .checkbox-style-toggle {
    justify-content: flex-start;
  }

  .action-buttons {
    flex-direction: row;
    gap: 12px;
  }

  .print-btn,
  .save-pdf-btn {
    flex: 1;
    padding: 14px 24px;
  }
}

/* Mobile Controls Layout (768px and below) */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px;
    align-items: stretch;
  }

  .toggle-group {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .week-toggle,
  .checkbox-style-toggle {
    justify-content: space-between;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .print-btn,
  .save-pdf-btn {
    width: 100%;
    padding: 14px 24px;
  }

  /* Prevent iOS zoom on input focus */
  .task-input,
  .everyday-input,
  .date-input {
    font-size: 16px;
  }
}

/* Related Planners Section */
.related-planners {
  padding: 60px 20px;
  background-color: #f9fafb;
}

.related-container {
  max-width: 900px;
  margin: 0 auto;
}

.related-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  color: #1a1a1a;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-card:hover {
  border-color: #082845;
  box-shadow: 0 4px 12px rgba(8, 40, 69, 0.1);
  transform: translateY(-2px);
}

.related-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #082845;
  margin: 0 0 8px 0;
}

.related-card p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

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

  .related-planners {
    padding: 40px 16px;
  }
}

/* Print Styles */
@media print {
  body {
    padding: 0;
    margin: 0;
    background-color: white;
    height: 100vh;
  }

  .container-wrapper {
    width: auto;
    height: auto;
    display: block;
    overflow: visible;
    margin: 0;
  }

  .container {
    /* Reset mobile scaling for print */
    transform: none !important;
    width: 100% !important;

    /* Critical: constrain to single page */
    height: calc(100vh - 30px);
    aspect-ratio: auto;

    /* Print-specific styles */
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 15px 20px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    page-break-inside: avoid;
  }

  .header {
    flex-shrink: 0;
    margin-bottom: 40px;
  }

  .schedule-grid {
    gap: 15px 30px;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .everyday-section {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    min-height: 0;
  }

  .everyday-left,
  .everyday-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .task-lines,
  .everyday-lines,
  .checkbox-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .task-line,
  .everyday-line,
  .checkbox-line {
    flex: 1;
    min-height: 0;
  }

  .task-input,
  .everyday-input,
  .date-input {
    border-bottom: 1px solid #999;
  }

  .task-checkbox,
  .day-checkbox {
    border-color: #999;
  }

  .controls,
  .no-print {
    display: none !important;
  }

  /* Ensure single page print */
  .container {
    page-break-inside: avoid;
  }

  .day-section,
  .everyday-section {
    page-break-inside: avoid;
  }
}
