.schedule-dashboard {
  padding: 20px;
}

.calendar-container {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

#planovo-calendar {
  max-width: 100%;
  min-width: 300px;
}

.loading-state,
.error-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.error-state {
  color: #e74c3c;
}

.loading-state i,
.error-state i {
  margin-right: 8px;
}

/* FullCalendar customization to match Planovo theme */
.fc .fc-button-primary {
  background-color: #2b38e9 !important;
  border-color: #2b38e9 !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
}

.fc .fc-button-primary:hover {
  background-color: #1e2bb8 !important;
  border-color: #1e2bb8 !important;
}

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background-color: #1e2bb8 !important;
  border-color: #1e2bb8 !important;
}

.fc-event {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  font-weight: 500;
  border: none !important;
}

.fc-event:hover {
  opacity: 0.85;
}

.fc-event-title {
  font-weight: 500;
  font-size: 13px;
}

.fc-event-time {
  font-size: 11px;
  opacity: 0.9;
}

/* List-item display for multi-day jobs */
.fc-daygrid-event.fc-event-start.fc-event-end {
  background-color: transparent !important;
}

.fc-daygrid-event.fc-event-start.fc-event-end .fc-event-main {
  color: #333 !important;
}

/* Time display for list items */
.fc-daygrid-event .fc-event-time {
  font-weight: 600;
  color: #333 !important;
}

/* Weekend styling - light grey background */
.fc .fc-day-sat,
.fc .fc-day-sun {
  background-color: #f5f5f5 !important;
}

.fc .fc-col-header-cell.fc-day-sat,
.fc .fc-col-header-cell.fc-day-sun {
  background-color: #e8e8e8 !important;
}

/* Calendar header styling */
.fc .fc-toolbar-title {
  font-size: 24px;
  font-weight: 600;
  color: #2b38e9;
}

.fc .fc-col-header-cell-cushion {
  padding: 10px 4px;
  font-weight: 600;
  color: #555;
}

/* Day cell styling */
.fc .fc-daygrid-day-number {
  padding: 8px;
  font-weight: 500;
}

.fc .fc-daygrid-day.fc-day-today {
  background-color: rgba(43, 56, 233, 0.05) !important;
}

/* Event styling for multi-day events */
.fc .fc-daygrid-event {
  margin: 1px 2px;
}

.fc .fc-timegrid-event {
  border-radius: 4px;
}

/* Dot-style events for calendar views */
.fc .fc-daygrid-event-harness {
  position: relative;
}

.fc .fc-daygrid-event.fc-event-dot {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 8px !important;
  width: 8px !important;
  border-radius: 50% !important;
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
}

.fc .fc-daygrid-event.fc-event-dot .fc-event-main {
  display: none !important;
}

/* Multiple dots for multiple jobs */
.fc .fc-daygrid-event.fc-event-dot:nth-child(2) {
  top: 12px !important;
}

.fc .fc-daygrid-event.fc-event-dot:nth-child(3) {
  top: 22px !important;
}

/* Job status colors for dots */
/* .fc .fc-daygrid-event.fc-event-dot.status-quotation {
  background-color: #fbbf24 !important;
} */

.fc .fc-daygrid-event.fc-event-dot.status-approved {
  background-color: #ea580c !important;
}

.fc .fc-daygrid-event.fc-event-dot.status-scheduled {
  background-color: #3b82f6 !important;
}

.fc .fc-daygrid-event.fc-event-dot.status-completed {
  background-color: #8b5cf6 !important;
}

.fc .fc-daygrid-event.fc-event-dot.status-paid {
  background-color: #10b981 !important;
}

/* Hover effect for day cells */
.fc .fc-daygrid-day:hover {
  background-color: rgba(43, 56, 233, 0.05) !important;
  cursor: pointer;
}

/* More link styling */
.fc .fc-more-link {
  font-size: 11px;
  padding: 2px 4px;
  background: #2b38e9;
  color: white;
  border-radius: 3px;
  text-decoration: none;
}

.fc .fc-more-link:hover {
  background: #1e2bb8;
}

/* Desktop calendar events with job names */
.fc .fc-daygrid-event.desktop-calendar-event {
  background: transparent !important;
  border: none !important;
  padding: 2px 4px !important;
  margin: 1px 2px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.fc .fc-daygrid-event.desktop-calendar-event .fc-event-main {
  color: #333 !important;
  font-weight: 500 !important;
}

/* Desktop calendar events with status indicator dots */
.fc .fc-daygrid-event.desktop-calendar-event::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.fc .fc-daygrid-event.desktop-calendar-event.status-quotation::before {
  background-color: #fbbf24;
}

.fc .fc-daygrid-event.desktop-calendar-event.status-approved::before {
  background-color: #ea580c;
}

.fc .fc-daygrid-event.desktop-calendar-event.status-scheduled::before {
  background-color: #3b82f6;
}

.fc .fc-daygrid-event.desktop-calendar-event.status-completed::before {
  background-color: #8b5cf6;
}

.fc .fc-daygrid-event.desktop-calendar-event.status-paid::before {
  background-color: #10b981;
}

/* Mobile-specific styles */
@media (max-width: 991px) {
  .schedule-dashboard {
    padding: 10px;
  }

  .calendar-container {
    padding: 10px;
    border-radius: 8px;
  }

  /* Hide job names in calendar views on mobile - only show dots */
  .fc .fc-daygrid-event:not(.fc-event-dot) .fc-event-main,
  .fc-daygrid-dot-event .fc-event-title,
  .fc-daygrid-dot-event .fc-event-time {
    display: none !important;
  }

  /* Ensure dots are visible on mobile */
  .fc .fc-daygrid-event.fc-event-dot {
    display: block !important;
  }

  .fc .fc-daygrid-event.fc-event-dot {
    top: 18px !important;
    right: 19px !important;
  }

  /* Make calendar more mobile-friendly */
  .fc .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .fc .fc-toolbar-title {
    font-size: 18px;
    text-align: center;
    margin: 10px 0;
  }

  /* Simplify header buttons for mobile */
  .fc .fc-button {
    padding: 8px 12px;
    font-size: 12px;
    min-width: auto;
  }

  .fc .fc-button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }

  /* Make view buttons larger and more touch-friendly on mobile */
  .fc .fc-button-group .fc-button {
    padding: 12px 16px;
    font-size: 14px;
    min-width: 60px;
    font-weight: 500;
  }

  /* Make day headers more compact */
  .fc .fc-col-header-cell-cushion {
    padding: 8px 2px;
    font-size: 12px;
    font-weight: 600;
  }

  /* Make day numbers smaller */
  .fc .fc-daygrid-day-number {
    padding: 4px;
    font-size: 12px;
  }

  /* Make events more touch-friendly */
  .fc-event {
    min-height: 20px;
    padding: 3px 6px;
    margin: 1px;
    font-size: 11px;
    line-height: 1.2;
  }

  .fc-event-title {
    font-size: 11px;
    font-weight: 500;
  }

  .fc-event-time {
    font-size: 10px;
  }

  /* Improve touch targets */
  .fc .fc-daygrid-day {
    min-height: 40px;
  }

  /* Make weekend styling more subtle on mobile */
  .fc .fc-day-sat,
  .fc .fc-day-sun {
    background-color: #f8f9fa !important;
  }

  .fc .fc-col-header-cell.fc-day-sat,
  .fc .fc-col-header-cell.fc-day-sun {
    background-color: #e9ecef !important;
  }

  /* Hide some toolbar elements on very small screens */
  @media (max-width: 480px) {
    .fc
      .fc-toolbar-chunk:first-child
      .fc-button:not(.fc-prev-button):not(.fc-next-button) {
      display: none;
    }

    .fc .fc-toolbar-title {
      font-size: 16px;
    }

    .fc .fc-button {
      padding: 6px 8px;
      font-size: 10px;
    }

    /* Keep view buttons touch-friendly even on very small screens */
    .fc .fc-button-group .fc-button {
      padding: 10px 12px;
      font-size: 12px;
      min-width: 50px;
    }
  }
}
