/* Planner-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: 64px;
}

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

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

.date-field label {
  font-size: 14px;
  letter-spacing: 1px;
}

.date-field input {
  border: none;
  border-bottom: 1px solid #333;
  padding: 5px;
  font-size: 14px;
  width: 200px;
  outline: none;
  background: transparent;
}

.planner-header {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 30px;
  margin-bottom: 20px;
}

.tasks-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  text-align: center;
}

.day-header {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.planner-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.planner-row {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 30px;
  align-items: center;
  flex: 1;
  min-height: 0;
}

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

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

.checkbox-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: center;
}

.checkbox-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  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;
}

input[type="checkbox"]:checked {
  background-color: #082845;
  border-color: #082845;
}

input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

input[type="checkbox"].circular {
  border-radius: 50%;
}

.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 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.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;
}

.print-btn,
.save-pdf-btn {
  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 */
  }
}

/* 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,
  .date-field 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 !important;
    height: auto !important;
    display: block;
    overflow: visible;
    margin: 0;
  }

  .container {
    /* Reset mobile/tablet scaling for print */
    transform: none !important;
    width: 100% !important;
    height: calc(100vh - 30px) !important;
    aspect-ratio: auto !important;

    /* 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;
  }

  .planner-header {
    flex-shrink: 0;
  }

  .planner-rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .planner-row {
    flex: 1;
    min-height: 0;
    page-break-inside: avoid;
  }

  .controls,
  .no-print,
  .page-header,
  .navbar,
  .footer {
    display: none !important;
  }

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