/* Calendar */
.calendar-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.calendar-month {
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 2rem);
  line-height: 1.5rem;
  text-align: center;
}

/* Ensure all day cells use the same spacing */
.calendar-grid > span,
.calendar-grid > a {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.15rem 0;
  border-radius: 4px;
  text-align: center;
}

.calendar-event {
  color: #ca644e;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}

.calendar-event:hover {
  color: #e07856;
}

/* Links: default very light grey, hover white */
.calendar-link {
  color: #d9d9d9; /* very light grey */
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.15rem 0;
  border-radius: 4px;
}

/* Ensure visited links (followed) stay the same light grey */
.calendar-link:visited {
  color: #d9d9d9;
}

/* Hover: white text */
.calendar-link:hover,
.calendar-link:visited:hover {
  color: #ffffff;
  text-decoration: none;
}

/* Category backgrounds (ColorBrewer Dark qualitative colors): Lab, Homework, Lecture, Exam */
.calendar-link.category-lab { background-color: #1b9e77; }
.calendar-link.category-homework { background-color: #d95f02; }
.calendar-link.category-lecture { background-color: #7570b3; }
.calendar-link.category-exam { background-color: #e7298a; }

/* Dialog for events */
dialog {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

dialog button {
  padding: 0.5rem 1rem;
  background-color: #2a7ae2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

dialog button:hover {
  background-color: #1e5ab0;
}
