/*
  Schedule Page Styles
  Desktop: Enhanced table with visual markers
  Mobile: Card layout for better readability
*/

/* ===========================================
   Page Container
   =========================================== */
.schedule-page {
  max-width: 75rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--container-padding) var(--space-3xl);
}

/* ===========================================
   Header
   =========================================== */
.schedule-header {
  margin-bottom: var(--space-xl);
}

.schedule-header h1 {
  margin-bottom: var(--space-sm);
}

.schedule-intro {
  font-size: var(--text-base);
  color: var(--text-2);
  max-width: 50rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* ===========================================
   Table Styles (Desktop)
   =========================================== */
.schedule-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--sand-1);
  border: 1px solid var(--sand-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.schedule-content th,
.schedule-content td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--sand-3);
}

.schedule-content th {
  background: var(--sand-3);
  font-weight: 600;
  color: var(--text-1);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.schedule-content tr:last-child td {
  border-bottom: none;
}

.schedule-content tr:hover {
  background: var(--sand-2);
}

/* Column widths */
.schedule-content th:nth-child(1),
.schedule-content td:nth-child(1) {
  width: 50px;
  text-align: center;
}

.schedule-content th:nth-child(2),
.schedule-content td:nth-child(2) {
  width: 120px;
  white-space: nowrap;
}

/* Class number cell */
.schedule-content td:nth-child(1) {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-3);
}

/* Date cell */
.schedule-content td:nth-child(2) {
  font-weight: 500;
}

/* Due column - visual markers */
.schedule-content td:nth-child(4) {
  position: relative;
}

/* Build due indicator */
.schedule-content td:nth-child(4):not(:empty) {
  font-weight: 500;
}

/* Notes column styling */
.schedule-content td:nth-child(5) {
  font-style: italic;
  color: var(--text-3);
}

/* ===========================================
   Mobile Card Layout
   =========================================== */
@media (max-width: 768px) {
  .schedule-page {
    padding: var(--space-lg) var(--container-padding) var(--space-2xl);
  }

  .schedule-header {
    margin-bottom: var(--space-lg);
  }

  .schedule-legend {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm) var(--space-md);
  }

  .legend-item {
    font-size: var(--text-xs);
  }

  /* Hide table header */
  .schedule-content thead {
    display: none;
  }

  /* Convert table to card layout */
  .schedule-content table {
    display: block;
    border: none;
    background: transparent;
  }

  .schedule-content tbody {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .schedule-content tr {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-md);
    background: var(--sand-1);
    border: 1px solid var(--sand-4);
    border-radius: var(--radius-md);
  }

  .schedule-content tr:hover {
    background: var(--sand-1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .schedule-content td {
    padding: 0;
    border: none;
  }

  /* Class number - badge style */
  .schedule-content td:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--sand-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-2);
  }

  /* Date */
  .schedule-content td:nth-child(2) {
    grid-row: 1;
    grid-column: 2;
    align-self: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-1);
  }

  /* Focus/Activity */
  .schedule-content td:nth-child(3) {
    grid-row: 2;
    grid-column: 1 / -1;
    font-size: var(--text-base);
    color: var(--text-1);
    line-height: 1.4;
  }

  /* Due */
  .schedule-content td:nth-child(4) {
    grid-row: 3;
    grid-column: 1 / -1;
  }

  .schedule-content td:nth-child(4):empty {
    display: none;
  }

  .schedule-content td:nth-child(4):not(:empty) {
    margin-top: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-2);
  }

  /* Notes */
  .schedule-content td:nth-child(5) {
    display: none;
  }

  .schedule-content td:nth-child(5):not(:empty) {
    display: block;
    grid-row: 4;
    grid-column: 1 / -1;
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    font-style: italic;
    color: var(--text-3);
  }
}

/* ===========================================
   Print Styles
   =========================================== */
@media print {
  .schedule-page {
    max-width: none;
    padding: 0;
  }

  .schedule-content table {
    font-size: 9pt;
    border: 1px solid #ccc;
  }

  .schedule-content th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ===========================================
   Reduced Motion
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  .schedule-content tr {
    transition: none;
  }
}
