/* General body */
body { 
  font-family: "Inter", "Lucida Sans Unicode", Verdana, Arial, sans-serif;
  font-size: 13px;
  color: #333;
  background: #fafafa;
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

/* Prevent page breaks inside tables */
table { page-break-inside: avoid; }

/* Page heading */
div.title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 16px 0;
  color: #222;
}

/* List tables */
table.listtable {
  margin: 16px auto;
  border-collapse: collapse;
  width: 90%;
  max-width: 800px;
}

table.listtable thead {
  background: #f5f5f5;
  font-weight: bold;
  border-bottom: 1px solid #ccc; /* darker */
}

table.listtable td {
  vertical-align: top;
  padding: 6px 10px;
  border-bottom: 1px solid #ddd; /* darker */
}

span.list_description {
  font-style: italic;
  color: #666;
}

/* Month calendar */
table.monthtable {
  table-layout: fixed;
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border-radius: 6px;
  overflow: hidden;
}

table.monthtable td, table.monthtable th {
  vertical-align: top;
  border: 1px solid #ccc; /* darker */
  padding: 4px;
}

/* Month name header */
.month-header {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  background-color: #f9f9f9;
  padding: 8px;
  border-bottom: 1px solid #ccc; /* darker */
}

/* Day headers */
.day-header {
  background-color: #fafafa;
  text-align: center;
  font-weight: 500;
  font-size: 0.8rem;
  color: #666;
  padding: 4px;
}

/* Regular day cells */
td.eventtd {
  font-size: 0.75rem;
  background: #fff;
  transition: background 0.2s;
}
td.eventtd:hover {
  background: #f0f7ff;
}

/* Days outside of quarter */
td.notinquarter {
  background-color: #f5f5f5;
  color: #aaa;
}

/* Today highlight */
table.monthtable td.today {
  border: 2px solid #007acc;
  background: #eaf5ff;
  border-radius: 3px;
}

/* Date label */
span.datespan {
  font-size: 0.8rem;
  float: right;
  color: #777;
  font-weight: 500;
}

/* Event entry boxes */
div.lecture, div.section, div.lab, div.exam, 
div.hw, div.oh, div.holiday, div.other {
  padding: 4px 6px;
  margin: 3px 0;
  border-radius: 4px;
  font-size: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Event types with softer palette */
div.lecture  { background: #fff8dc; }    
div.section  { background: #fdf0e6; }    
div.lab      { background: #ffe5d0; }    
div.exam     { background: #ffe0e0; font-weight: 600; }
div.hw       { background: #fdfcf5; }
div.oh       { background: #ecf9f1; }
div.holiday  { background: #e7f6d5; font-weight: 600; }
div.other    { background: #f4e8fa; }

/* -----------------------------
   Calendar layout: color key on left
   ----------------------------- */
/* Keep table centered */
.calendar-body {
  width: 90%;
  max-width: 850px;
  margin: 16px auto; /* centers the calendar */
}

/* Color key on the left */
.colorkey-toggle {
  position: absolute;   /* keeps it on the left of the page */
  top: 150px;           /* adjust vertical position as needed */
  left: 20px;           /* left margin from page */
  width: 150px;
}

#colorkey-dropdown {
  margin-top: 8px;
  border-left: 2px solid #bbb; /* darker */
  padding-left: 8px;
}

#toggle-key {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ccc; /* darker */
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#toggle-key:hover {
  background-color: #e9e9e9;
  border-color: #999; /* darker hover */
}

#toggle-key:active {
  background-color: #ddd;
}

#colorkey-dropdown.hidden {
  display: none;
}

.key-item {
  margin: 4px 0;
  font-size: 0.85rem;
}

.key-item div {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

/* Match colors for key */
.key-item .lecture  { background: #fff8dc; }    
.key-item .section  { background: #fdf0e6; }    
.key-item .lab      { background: #ffe5d0; }    
.key-item .exam     { background: #ffe0e0; }    
.key-item .hw       { background: #fdfcf5; }    
.key-item .oh       { background: #ecf9f1; }    
.key-item .holiday  { background: #e7f6d5; }    
.key-item .other    { background: #f4e8fa; }

/* Print styling */
@media print {
  table, img { page-break-inside: avoid; }
  body { background: white; font-size: 12px; }
  .colorkey-toggle, #colorkey-dropdown { display: none !important; }
}
