/* Weekly Calendar Plugin Styles */
.weekly-calendar-wrapper {
  /* max-width: 1200px; */
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.weekly-calendar-container {
  /* max-width: 100% !important; */
}

/* Filters Section */
.calendar-filters-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filters-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-counter {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.filter-button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.filter-button.select-all:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.filter-button.clear-all:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.filters-grid {
  display: flex;
  flex-flow: wrap;
  margin-top: 24px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.filter-item {
  display: flex;
  flex: 1 1 160px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f9fafb;
  font-size: 0.8rem;
}

.filter-item:hover {
  background: #f3f4f6;
}

.filter-item.selected {
  background: #eff6ff;
  border-color: #3b82f6;
}

.filter-checkbox {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
}

/* Calendar Section */
.weekly-calendar {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.calendar-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px;
  text-align: center;
  color: white;
}

.calendar-title {
  margin: 0 0 8px 0;
  font-size: 2rem;
  font-weight: 700;
}

.calendar-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.calendar-grid {
  background: #ffffff;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.time-header,
.day-header {
  padding: 16px 8px;
  text-align: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.time-header {
  background: rgba(0, 0, 0, 0.1);
}

.calendar-body {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  min-height: 600px;
}

.time-column {
  background: #f8fafc;
  border-right: 2px solid #e2e8f0;
}

.time-slot-label {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.day-column {
  position: relative;
  border-right: 1px solid #e2e8f0;
}

.time-slot {
  height: 60px;
  border-bottom: 1px solid #f1f5f9;
}

.time-slot.even {
  background: #ffffff;
}

.time-slot.odd {
  background: #f8fafc;
}

.events-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.calendar-event {
  position: absolute;
  margin: 2px;
  border-radius: 6px;
  padding: 4px 6px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  right: auto;
}

.calendar-event:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.event-name {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.event-time {
  color: white;
  font-size: 0.625rem;
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Loading state */
.weekly-calendar-loading {
  padding: 60px;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .weekly-calendar-wrapper {
    margin: 0 10px;
  }

  .filters-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .filter-controls {
    justify-content: center;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .calendar-days-header,
  .calendar-body {
    font-size: 0.75rem;
  }

  .day-header {
    padding: 12px 4px;
  }

  .calendar-event {
    left: 1px;
    right: 1px;
  }

  .event-name {
    font-size: 0.625rem;
  }

  .event-time {
    font-size: 0.5rem;
  }
}

@media (max-width: 640px) {
  .calendar-title {
    font-size: 1.5rem;
  }

  /* .time-column {
    display: none;
  } */

  .calendar-days-header,
  .calendar-body {
    grid-template-columns: repeat(7, 1fr);
  }

  /* .time-header {
    display: none;
  } */

  /* Event Modal Styles */
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes scaleIn {
    from {
      transform: scale(0.8);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }

  .event-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
  }

  .event-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
  }

  .event-modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }

  .event-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
  }

  .event-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
  }

  .event-modal-title {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
  }

  .event-modal-date,
  .event-modal-time {
    margin: 8px 0;
    color: #6b7280;
    font-size: 1rem;
  }

  .event-modal-description {
    margin: 16px 0;
    line-height: 1.6;
    color: #374151;
    font-size: 1rem;
  }

  .event-modal-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-top: 16px;
    flex-shrink: 0;
  }
}

/* modal */
/* --- Modal Styles --- */

/* The main container that holds the calendar and the modal */
.event-modal-overlay {
  position: relative;
}

/* The dark, semi-transparent background behind the modal */
.event-modal-backdrop {
  position: fixed; /* Covers the entire viewport */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
  z-index: 999; /* Ensures it's on top of other content */
}

/* The actual modal window */
.event-modal {
  position: fixed; /* Stays in the same place even if the page is scrolled */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centers the modal perfectly */
  background-color: #ffffff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px; /* Prevents it from being too wide on large screens */
  z-index: 1000; /* Ensures it's on top of the backdrop */
  color: #333;
}

/* The close button (the '×') */
.event-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.event-modal-close:hover {
  color: #333;
}

/* Modal Content Styling */
.event-modal-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.5em;
}

.event-modal-date,
.event-modal-time {
  font-size: 1.1em;
  margin: 5px 0;
  color: #555;
}

.event-modal-description {
  margin-top: 15px;
  font-size: 1em;
  line-height: 1.5;
}

/* The little color swatch at the bottom */
.event-modal-color {
  margin-top: 20px;
  height: 15px;
  width: 100%;
  border-radius: 4px;
}
