/* Calendar tab view wrapper */
.calendar-header-form {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f0f13;
  padding: 1rem 0;
  border-bottom: 1px solid #1e1e2d;
  margin-bottom: 1.5rem;
}

.calendar-inline-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-inline-form input[type="text"] {
  flex: 1;
  min-width: 220px;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #2d2d3a;
  background: #1a1a24;
  color: #e2e8f0;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.calendar-inline-form input[type="text"]:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.calendar-inline-form input[type="date"] {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #2d2d3a;
  background: #1a1a24;
  color: #e2e8f0;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.calendar-inline-form input[type="date"]:focus {
  border-color: #6366f1;
}

.calendar-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #94a3b8;
  user-select: none;
}

.calendar-inline-form button {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}

.calendar-inline-form button:hover {
  background: #4f52d4;
}

.calendar-inline-form button:active {
  transform: scale(0.98);
}

/* Calendar month grids container */
.calendar-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.month-card {
  background: #1a1a24;
  border: 1px solid #2d2d3a;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.month-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  text-transform: capitalize;
  border-bottom: 1px solid #2d2d3a;
  padding-bottom: 0.5rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
  text-transform: uppercase;
}

/* Individual day cell styling */
.day-cell {
  position: relative;
  aspect-ratio: 1;
  background: #101017;
  border: 1px solid #1e1e2d;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: #e2e8f0;
  padding-bottom: 8px; /* reserve space for indicators */
  transition: background 0.15s, border-color 0.15s;
}

.day-cell:hover {
  background: #272738;
}

.day-cell.empty {
  background: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
}

.day-cell.today {
  border: 2px solid #6366f1;
  font-weight: bold;
}

.day-cell.selected {
  background: #2e2e48;
}

.day-cell.weekend-day {
  color: #f97316;
}

.day-cell.holiday-day {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.day-cell.holiday-day.weekend-day {
  color: #ffaa66;
}

/* Indicators container for the lines */
.day-indicators {
  display: flex;
  gap: 2px;
  width: 100%;
  padding: 0 4px 4px 4px;
  position: absolute;
  bottom: 0;
  left: 0;
}

.indicator-line {
  height: 3px;
  flex: 1;
  border-radius: 1.5px;
}

.indicator-line.weekend {
  background: #f97316; /* Orange */
}

.indicator-line.holiday {
  background: #3b82f6; /* Blue */
}

.indicator-line.user-event {
  background: #22c55e; /* Green */
}

/* Event tags */
.event-tag {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-holiday {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.tag-user {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.tag-weekend {
  background: rgba(249, 115, 22, 0.2);
  color: #ffedd5;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.cal-modal-tag {
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.cal-modal-recurring-text {
  color: #64748b;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* Event List Modal Overlay */
.calendar-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.calendar-modal-content {
  background: #1a1a24;
  border: 1px solid #2d2d3a;
  border-radius: 12px;
  width: 420px;
  max-width: 90%;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calendar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2d2d3a;
  padding-bottom: 0.75rem;
}

.calendar-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5f9;
}

.calendar-modal-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.calendar-modal-close-btn:hover {
  color: #e2e8f0;
}

.calendar-modal-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.calendar-modal-events-list::-webkit-scrollbar {
  width: 4px;
}
.calendar-modal-events-list::-webkit-scrollbar-track {
  background: transparent;
}
.calendar-modal-events-list::-webkit-scrollbar-thumb {
  background: #2d2d3a;
  border-radius: 2px;
}

.calendar-modal-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: #101017;
  border: 1px solid #2d2d3a;
  border-radius: 6px;
  gap: 0.5rem;
}

.calendar-modal-event-text {
  font-size: 0.875rem;
  color: #e2e8f0;
  flex: 1;
  word-break: break-word;
}

.calendar-modal-event-delete-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.calendar-modal-event-delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.calendar-modal-no-events {
  color: #64748b;
  font-size: 0.875rem;
  text-align: center;
  padding: 1.5rem 0;
}
