/* =====================================================================
   Calendar page (Taskbuilder > Calendar, [wppm_tasks_calendar] shortcode, BuddyPress group
   calendar): modern SaaS shell, same look as the Kanban board. Markup: wppm_calendar_header.php.
   ===================================================================== */
#wppm_calendar_container {
    margin: 0;
    padding: 22px 24px 26px;
    border: 0;
    border-radius: 14px;
    background: #f8fafc;
}
/* wp-admin page: same gutter as the other Taskbuilder screens (frontend keeps the theme's layout) */
body.wp-admin #wppm_calendar_container {
    margin: 20px 20px 0 0;
}
#wppm_calendar_container > * {
    width: 100%;
}
.wppm-cal-shell {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
}
.wppm-cal-shell .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

/* Header: title + count + subtitle, search on the right */
.wppm-cal-shell .wppm-cal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.wppm-cal-shell .wppm-cal-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.wppm-cal-shell .wppm-cal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wppm-cal-shell .wppm-cal-header .wppm-heading-inline {
    margin: 0 !important;
    padding: 0;
    color: #111827;
    font: 700 24px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
}
.wppm-cal-shell .wppm-cal-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
}
.wppm-cal-shell .wppm-cal-subtitle {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    color: #6b7280;
    font-size: 13px;
}
.wppm-cal-shell .wppm-cal-clear {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 7px;
    color: #4f46e5;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.wppm-cal-shell .wppm-cal-clear:hover,
.wppm-cal-shell .wppm-cal-clear:focus {
    background: #eef2ff;
    color: #4338ca;
    box-shadow: none;
}
.wppm-cal-shell .wppm-cal-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 280px;
    max-width: 100%;
}
.wppm-cal-shell .wppm-cal-search .dashicons {
    position: absolute;
    left: 11px;
    color: #9ca3af;
    pointer-events: none;
}
.wppm-cal-shell #wppm_calendar_search_filter {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 12px 0 34px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.wppm-cal-shell #wppm_calendar_search_filter:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px #eef2ff;
}

/* Status legend: soft chips */
.wppm_cal_task_status_color {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    vertical-align: middle;
}
.wppm_cal_task_statuses {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.wppm-cal-shell .wppm-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Calendar card */
.wppm-cal-shell .wppm-cal-board {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(16,24,40,.10);
}

@media (max-width: 782px) {
    #wppm_calendar_container {
        padding: 16px 14px 20px;
    }
    body.wp-admin #wppm_calendar_container {
        margin: 10px 10px 0 0;
    }
    .wppm-cal-shell .wppm-cal-search {
        width: 100%;
    }
    .wppm-cal-shell .wppm-cal-board {
        padding: 10px;
    }
}

.wppm_cal_event_group{
    font-size: 0.85em;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* =====================================================================
   One look for every Taskbuilder FullCalendar: the Taskbuilder > Calendar page
   (#wppm_calendar_container) and the Calendar view on the Tasks page / project tab
   (.wppm-tv-fc, Taskbuilder core). Modern SaaS style matching the Kanban board.
   Status colors stay inline per event.
   ===================================================================== */
#wppm_calendar_container .fc,
.wppm-tv-fc.fc {
  --fc-border-color: #eef0f4;
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: #f8fafc;
  --fc-today-bg-color: #eef2ff;
  --fc-event-border-color: transparent;
  --fc-button-bg-color: #ffffff;
  --fc-button-border-color: #e5e7eb;
  --fc-button-text-color: #111827;
  --fc-button-hover-bg-color: #f8fafc;
  --fc-button-hover-border-color: #cbd5e1;
  --fc-button-active-bg-color: #eef2ff;
  --fc-button-active-border-color: #c7d2fe;
  --fc-list-event-hover-bg-color: #f8faff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: #111827;
}
.wppm-tv-fc.fc {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
#wppm_calendar_container .fc .fc-toolbar.fc-header-toolbar,
.wppm-tv-fc.fc .fc-toolbar.fc-header-toolbar {
  margin-bottom: 14px;
}
#wppm_calendar_container .fc .fc-toolbar-title,
.wppm-tv-fc.fc .fc-toolbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
#wppm_calendar_container .fc .fc-button,
.wppm-tv-fc.fc .fc-button {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
#wppm_calendar_container .fc .fc-button-primary:not(:disabled).fc-button-active,
#wppm_calendar_container .fc .fc-button-primary:not(:disabled):active,
.wppm-tv-fc.fc .fc-button-primary:not(:disabled).fc-button-active,
.wppm-tv-fc.fc .fc-button-primary:not(:disabled):active {
  color: #3730a3;
}
#wppm_calendar_container .fc .fc-button:focus,
.wppm-tv-fc.fc .fc-button:focus {
  box-shadow: 0 0 0 3px #eef2ff;
}
#wppm_calendar_container .fc .fc-col-header-cell-cushion,
.wppm-tv-fc.fc .fc-col-header-cell-cushion {
  padding: 8px 4px;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
}
#wppm_calendar_container .fc .fc-col-header-cell,
.wppm-tv-fc.fc .fc-col-header-cell {
  background: #f8fafc;
}
#wppm_calendar_container .fc .fc-daygrid-day-number,
.wppm-tv-fc.fc .fc-daygrid-day-number {
  margin: 4px;
  padding: 0;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  text-decoration: none;
}
#wppm_calendar_container .fc .fc-day-today .fc-daygrid-day-number,
.wppm-tv-fc.fc .fc-day-today .fc-daygrid-day-number {
  background: #4f46e5;
  color: #ffffff;
}
#wppm_calendar_container .fc .fc-daygrid-day.fc-day-today,
.wppm-tv-fc.fc .fc-daygrid-day.fc-day-today {
  background: transparent;
}
#wppm_calendar_container .fc .fc-day-other .fc-daygrid-day-top,
.wppm-tv-fc.fc .fc-day-other .fc-daygrid-day-top {
  opacity: .45;
}
/* Events: white chip with the status color as a left stripe (set as --wppm-cal-status by
   wppm_cal_show_event_group); overrides FullCalendar's inline full-color background. */
#wppm_calendar_container .fc .fc-daygrid-event,
.wppm-tv-fc.fc .fc-daygrid-event {
  margin: 1px 4px 3px;
  padding: 3px 7px;
  border: 1px solid #e8ecf2 !important;
  border-radius: 7px;
  background: #ffffff !important;
  box-shadow: inset 3px 0 0 var(--wppm-cal-status, #cbd5e1), 0 1px 2px rgba(16,24,40,.05);
  color: #111827 !important;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
#wppm_calendar_container .fc .fc-daygrid-event .fc-event-main,
#wppm_calendar_container .fc .fc-daygrid-event .fc-event-title,
.wppm-tv-fc.fc .fc-daygrid-event .fc-event-main,
.wppm-tv-fc.fc .fc-daygrid-event .fc-event-title {
  color: #111827 !important;
}
#wppm_calendar_container .fc .fc-daygrid-event:hover,
.wppm-tv-fc.fc .fc-daygrid-event:hover {
  border-color: #c7d2fe !important;
  box-shadow: inset 3px 0 0 var(--wppm-cal-status, #cbd5e1), 0 4px 12px -6px rgba(15,23,42,.25);
}
#wppm_calendar_container .fc .fc-daygrid-event.fc-event-dragging,
.wppm-tv-fc.fc .fc-daygrid-event.fc-event-dragging {
  box-shadow: inset 3px 0 0 var(--wppm-cal-status, #cbd5e1), 0 8px 20px -6px rgba(15,23,42,.35);
}
#wppm_calendar_container .fc .wppm_cal_event_group,
.wppm-tv-fc.fc .wppm_cal_event_group {
  color: #6b7280;
}
#wppm_calendar_container .fc .fc-daygrid-more-link,
.wppm-tv-fc.fc .fc-daygrid-more-link {
  margin-left: 6px;
  color: #4f46e5;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}
#wppm_calendar_container .fc .fc-list,
.wppm-tv-fc.fc .fc-list {
  border-radius: 8px;
  overflow: hidden;
}
#wppm_calendar_container .fc .fc-list-day-cushion,
.wppm-tv-fc.fc .fc-list-day-cushion {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}
#wppm_calendar_container .fc .fc-list-event-title a,
.wppm-tv-fc.fc .fc-list-event-title a {
  color: #111827;
  text-decoration: none;
}
#wppm_calendar_container .fc .fc-popover,
.wppm-tv-fc.fc .fc-popover {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(15,23,42,.35);
  overflow: hidden;
}
/* Completed tasks: faded, like the Kanban and Gantt views */
.wppm-tv-fc.fc .wppm-tv-fc-done {
  opacity: .55;
}
@media (max-width: 782px) {
  #wppm_calendar_container .fc .fc-toolbar.fc-header-toolbar,
  .wppm-tv-fc.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  #wppm_calendar_container .fc .fc-toolbar-title,
  .wppm-tv-fc.fc .fc-toolbar-title {
    font-size: 15px;
  }
}

/* Save feedback after dragging / resizing a task (wppm_cal_toast) */
.wppm-cal-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100000;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 10px 30px -10px rgba(15,23,42,.5);
}
.wppm-cal-toast.is-error {
  background: #b91c1c;
}

/* "+N more" popover: on busy days it held 100+ tasks and ran far off-screen, so the tasks in it could
   not be reached or dragged. Keep it within the viewport and let it scroll. */
#wppm_calendar_container .fc .fc-more-popover .fc-popover-body,
.wppm-tv-fc.fc .fc-more-popover .fc-popover-body {
  max-height: min(360px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
#wppm_calendar_container .fc .fc-more-popover,
.wppm-tv-fc.fc .fc-more-popover {
  min-width: 220px;
  max-width: 320px;
}

/* Task details popup on hover (appended to <body>; same look as the Gantt bars' popup) */
.wppm-cal-pop {
  position: fixed;
  z-index: 100000;
  box-sizing: border-box;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px -8px rgba(15,23,42,.35);
  color: #374151;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  pointer-events: none;
}
.wppm-cal-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.wppm-cal-pop-name {
  min-width: 0;
  color: #111827;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.wppm-cal-pop-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}
.wppm-cal-pop-label {
  flex: 0 0 104px;
  color: #6b7280;
}
.wppm-cal-pop-line b {
  min-width: 0;
  color: #111827;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.wppm-cal-pop-pill {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
