.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 350px; /* 🔥 prevents jumping when month names change */
}

.calendar-title {
  font-size: 2em;
  font-weight: bold;
  text-align: center;
  min-width: 300px; /* 🔥 Title area has fixed minimum width */
  color: #f4f4f4;
}


.calendar-nav-button {
  background-color: #555;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 1.5em;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-nav-button:hover {
  background-color: #777;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px; /* Keep your nice small gap */
}


.calendar-day-header {
  background-color: #444;
  color: #fff;
  font-weight: bold;
  text-align: center;
  padding: 10px 0;
  border-radius: 4px;
  font-size: 1em;
  height: 40px; /* 🔥 Shorter header */
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day {
  height: 100px; /* ✅ Only days are tall */
  background-color: #555;
  color: #eee;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 5px;
  border-radius: 6px;
  font-size: 1.1em;
  position: relative;
  font-weight: bold;
  overflow: visible; /* ✅ allow box-shadow to be seen */
}

.calendar-day:hover {
  background-color: #666;
}

.calendar-day.today {
  background-color: #FF5C5C;
  color: white;
  font-weight: bold;
}

.calendar-day.empty {
  background: transparent;
}

/* 🔥 Light Mode adjustments */
body:not(.dark-mode) .calendar-grid {
  background: #f5f5f5;
}

body:not(.dark-mode) .calendar-day,
body:not(.dark-mode) .calendar-day-header {
  background: #ffffff;
  color: #333;
  border: 1px solid #ccc;
}

body:not(.dark-mode) .calendar-day.today {
  background: #ffcccc;
}

body:not(.dark-mode) .calendar-nav-button {
  background: #e0e0e0;
  color: #333;
}

body:not(.dark-mode) .calendar-title {
  color: #222;
}

/* 🔥 Event lines inside days */
.calendar-events-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  margin-top: auto;
  gap: 2px;
  padding-bottom: 4px;
}

/* 🔧 IMPROVED event line styling for long titles */
.calendar-event-line {
  height: 20px;
  width: 98%;
  margin: 0 auto;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.7em;
  color: #000;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.3);

}

.calendar-event-text {
  padding-left: 5px;
  display: inline-block;
  will-change: transform;
  transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* 🔧 Optional: enable wrapping instead of ellipsis */
.calendar-event-line.wrap {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  text-overflow: unset;
}


/* 🔥 Optional: Dot icons if you ever want to show */
.calendar-event-wrapper {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
}

.calendar-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.calendar-event-icon {
  font-size: 10px;
}
.calendar-day.empty {
  background-color: #444; /* 🔥 Match the day header color */
  opacity: 0.5;            /* 🔥 Dim it a little to look "grayed out" */
  pointer-events: none;    /* 🔥 Prevent hover/click on empty days */
}
body:not(.dark-mode) .calendar-day.empty {
  background: #f0f0f0; /* soft gray in light mode */
  opacity: 0.7;
}
.calendar-add-button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 15px;
}

.calendar-add-button:hover {
  background: #45a049;
}

.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.calendar-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 300px;
}

.calendar-modal-content h2 {
  margin-top: 0;
}
.calendar-add-event-button {
  background-color: #4CAF50; /* or any color you like */
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-add-event-button:hover {
  background-color: #45a049;
}
#addEventModal textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  box-sizing: border-box;
  padding: 6px;
  font-size: 1em;
}
