/* Timetable custom styling & Print Optimization */

/* Navigation Tab Active state */
.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}
.nav-tab:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.nav-tab.active-tab {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

/* Session Switcher Pills */
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  cursor: pointer;
}
.session-pill:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}
.session-pill.active-pill {
  background-color: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pill-badge {
  font-size: 10px;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.08);
}
.session-pill.active-pill .pill-badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Timetable Table Styling */
.timetable-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
}

.timetable-table th,
.timetable-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.25rem;
}

.timetable-table th:last-child,
.timetable-table td:last-child {
  border-right: none;
}

.timetable-table tr:last-child td {
  border-bottom: none;
}

/* Timetable Cell Interactive Styles */
.timetable-slot {
  min-height: 56px;
  min-width: 68px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.timetable-slot:hover {
  filter: brightness(0.96);
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  z-index: 10;
}

/* Special Slot Backgrounds */
.slot-rehat {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  font-weight: 700;
  cursor: default;
}

.slot-perhimpunan {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 700;
}

/* Subject Tag Colors */
.subject-tag-blue { background-color: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.subject-tag-emerald { background-color: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.subject-tag-amber { background-color: #fffbeb; color: #b45309; border-color: #fde68a; }
.subject-tag-purple { background-color: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.subject-tag-rose { background-color: #fff1f2; color: #be123c; border-color: #fecdd3; }
.subject-tag-cyan { background-color: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.subject-tag-indigo { background-color: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.subject-tag-orange { background-color: #fff7ed; color: #c2410c; border-color: #fed7aa; }

/* Custom Scrollbar for Timetable Grids */
.overflow-x-auto::-webkit-scrollbar {
  height: 6px;
}
.overflow-x-auto::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* PRINT MEDIA STYLES - Optimized for A4 Landscape */
@media print {
  @page {
    size: A4 landscape;
    margin: 8mm 8mm 8mm 8mm;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt;
    padding: 0 !important;
    margin: 0 !important;
  }

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

  .print-clean {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-header {
    display: block !important;
  }

  .timetable-table {
    border: 1.5px solid #000000 !important;
    width: 100% !important;
  }

  .timetable-table th,
  .timetable-table td {
    border: 1px solid #000000 !important;
    padding: 3px 2px !important;
  }

  .timetable-slot {
    min-height: 40px !important;
    cursor: default !important;
  }

  .timetable-slot:hover {
    outline: none !important;
  }

  .slot-rehat {
    background-color: #f3f4f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
