.calendar-container {
  /*max-width: 600px;*/
  max-width: 100%;
  margin: auto;
  font-family: Arial, sans-serif;
  margin-top: 30px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-header h2 {
  margin: 0;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.calendar-weekdays div {
  font-weight: bold;
  padding: 10px 0;
  background: #f5f5f5;
  border: 1px solid #ddd;
}

.calendar-grid .day {
  border: 1px solid #ccc;
  min-height: 80px;
  padding: 5px;
  text-align: left;
  position: relative;
  cursor: pointer;
}

.calendar-grid .day .date {
  font-weight: bold;
}

.event {
  font-size: 0.8em;
  background-color: #e3f2fd;
  margin-top: 5px;
  padding: 2px 4px;
  border-left: 4px solid #2196F3;
  cursor: pointer;
}

button {
  padding: 5px 10px;
  font-size: 1em;
  cursor: pointer;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background-color: white;
  padding: 2em;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-box h2 {
  margin-bottom: 1em;
  text-align: center;
}

.modal-box form input {
  width: 100%;
  padding: 0.5em;
  margin: 0.3em 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.modal-buttons button {
  flex: 1;
  padding: 0.6em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.modal-buttons button[type="submit"] {
  background-color: #4CAF50;
  color: white;
}

.modal-buttons button[type="button"] {
  background-color: #ccc;
  color: #000;
}

.modal-box form select {
  width: 100%;
  padding: 0.5em;
  margin: 0.3em 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#calendar {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px; /* Use gap instead of grid-gap for consistency */
  background: #f9f9f9; /* From calendar.css */
  padding: 10px;
  border: 1px solid #ccc; /* or #ddd if you prefer the lighter look */
  border-radius: 6px;
  box-sizing: border-box;
  user-select: none;
}


.day {
  background: white;
  border: 1px solid #ccc;
  min-height: 80px;
  padding: 4px;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.day:hover {
  background-color: #eef6ff;
}

.day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.date {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 14px;
  color: #333;
  user-select: text;
}

.event {
  background-color: #3a87ad;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  margin: 2px 0;
  border-radius: 3px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.event:hover {
  background-color: #2c6b8e;
}

/* Optional: limit number of events shown to 3 per day with "more" indicator */
.day .event:nth-child(n+4) {
  display: none;
}

.day .event.more {
  display: block !important;
  background: #888;
  cursor: default;
  user-select: none;
  text-align: center;
  font-weight: bold;
}

.event-tooltip {
  position: absolute;
  z-index: 1000;
  background: #f9f9f9;
  border: 1px solid #888;
  padding: 8px;
  border-radius: 5px;
  font-size: 0.85rem;
  max-width: 250px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  pointer-events: none;
}
