/**
 * KeenThemes v7 / Bootstrap 5 Skin for jQuery UI Datepicker
 * Created for smart_ocs_m
 */

/* ==========================================================================
   1. Datepicker Floating Card Container
   ========================================================================== */
#ui-datepicker-div,
.ui-datepicker {
  width: 256px !important;
  max-width: calc(100vw - 20px) !important;
  margin: 0 !important;
  padding: 0.45rem 0.55rem !important;
  background-color: #ffffff !important;
  color: #3F4254 !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  border: 1px solid #E4E6EF !important;
  border-radius: 0.55rem !important;
  box-shadow: 0 8px 24px 0 rgba(82, 63, 105, 0.12), 0 2px 6px 0 rgba(0, 0, 0, 0.04) !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
  animation: keenDatepickerFadeIn 0.12s ease-out !important;
}

@keyframes keenDatepickerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   2. Datepicker Header & Navigation (Prev / Next)
   ========================================================================== */
.ui-datepicker .ui-datepicker-header {
  position: relative !important;
  padding: 0 !important;
  padding-bottom: 0.35rem !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #F3F4F6 !important;
  margin-bottom: 0.35rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-radius: 0 !important;
}

/* Prev / Next Navigation Buttons */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  margin: 0 !important;
  border-radius: 0.4rem !important;
  background-color: #F5F8FA !important;
  border: 1px solid #E4E6EF !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.ui-datepicker .ui-datepicker-prev {
  order: 1 !important;
}

.ui-datepicker .ui-datepicker-next {
  order: 3 !important;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
  background-color: #EEF3F7 !important;
  border-color: #D8D8E0 !important;
}

/* Hide raw jQuery UI sprite icons & replace with crisp modern SVG chevrons */
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  position: static !important;
  background-image: none !important;
  text-indent: -99999px !important;
  overflow: hidden !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 12px 12px !important;
}

.ui-datepicker .ui-datepicker-prev span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6278' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.ui-datepicker .ui-datepicker-next span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6278' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.ui-datepicker .ui-datepicker-prev:hover span,
.ui-datepicker .ui-datepicker-next:hover span {
  filter: brightness(0.7) !important;
}

/* ==========================================================================
   3. Month & Year Select Dropdowns
   ========================================================================== */
.ui-datepicker .ui-datepicker-title {
  order: 2 !important;
  margin: 0 !important;
  padding: 0 0.2rem !important;
  line-height: normal !important;
  text-align: center !important;
  display: flex !important;
  gap: 0.3rem !important;
  justify-content: center !important;
  align-items: center !important;
  flex-grow: 1 !important;
  width: auto !important;
}

.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
  height: 27px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: 1px solid #E4E6EF !important;
  border-radius: 0.4rem !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A5B7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.35rem center !important;
  background-size: 9px 9px !important;
  padding: 0 1.15rem 0 0.4rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #3F4254 !important;
  line-height: 25px !important;
  cursor: pointer !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease !important;
}

.ui-datepicker select.ui-datepicker-month {
  width: 58% !important;
}

.ui-datepicker select.ui-datepicker-year {
  width: 42% !important;
}

.ui-datepicker select.ui-datepicker-month:focus,
.ui-datepicker select.ui-datepicker-year:focus {
  border-color: #B5DBFF !important;
}

.ui-datepicker .ui-datepicker-title span.ui-datepicker-month,
.ui-datepicker .ui-datepicker-title span.ui-datepicker-year {
  font-weight: 600 !important;
  color: #3F4254 !important;
  font-size: 0.85rem !important;
  margin: 0 0.15rem !important;
}

/* ==========================================================================
   4. Calendar Table & Grid
   ========================================================================== */
.ui-datepicker table.ui-datepicker-calendar {
  width: 100% !important;
  font-size: 0.85rem !important;
  border-collapse: separate !important;
  border-spacing: 1px !important;
  margin: 0 !important;
}

/* Weekday header row */
.ui-datepicker table.ui-datepicker-calendar thead th {
  padding: 0.25rem 0.05rem !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  color: #181C32 !important;
  text-transform: uppercase !important;
  border: none !important;
  background: transparent !important;
}

/* Day cells */
.ui-datepicker table.ui-datepicker-calendar tbody td {
  border: none !important;
  padding: 1px 0 !important;
  text-align: center !important;
}

/* Day number links/spans */
.ui-datepicker table.ui-datepicker-calendar tbody td a,
.ui-datepicker table.ui-datepicker-calendar tbody td span {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 26px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
  text-decoration: none !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #3F4254 !important;
  background-color: #ffffff !important;
  border: 1px solid #E4E6EF !important;
  border-radius: 0.4rem !important;
  transition: all 0.15s ease-in-out !important;
  box-sizing: border-box !important;
}

/* Hover on normal day */
.ui-datepicker table.ui-datepicker-calendar tbody td:not(.ui-state-disabled) a:hover {
  background-color: #F1FAFF !important;
  color: #1B84FF !important;
  border-color: #B5DBFF !important;
  font-weight: 600 !important;
}

/* Today highlight */
.ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-today a {
  background-color: #F1FAFF !important;
  color: #009EF7 !important;
  font-weight: 700 !important;
  border: 1px dashed #009EF7 !important;
}

/* Active / Selected Date */
.ui-datepicker table.ui-datepicker-calendar tbody td a.ui-state-active,
.ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-current-day a {
  background-color: #1B84FF !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-color: #1B84FF !important;
  box-shadow: 0 4px 10px rgba(27, 132, 255, 0.3) !important;
}

/* Disabled & Other Month days */
.ui-datepicker table.ui-datepicker-calendar tbody td.ui-state-disabled span,
.ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-other-month span,
.ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-other-month a {
  color: #D8D8E0 !important;
  opacity: 0.45 !important;
  pointer-events: none !important;
  background: transparent !important;
  border-color: #F3F4F6 !important;
}

/* ==========================================================================
   5. Button Pane (if showButtonPanel is used)
   ========================================================================== */
.ui-datepicker .ui-datepicker-buttonpane {
  margin-top: 0.75rem !important;
  padding-top: 0.65rem !important;
  border-top: 1px solid #F3F4F6 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.ui-datepicker .ui-datepicker-buttonpane button {
  float: none !important;
  margin: 0 !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border-radius: 0.475rem !important;
  border: 1px solid #E4E6EF !important;
  background-color: #F5F8FA !important;
  color: #5E6278 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ui-datepicker .ui-datepicker-buttonpane button:hover {
  background-color: #1B84FF !important;
  color: #ffffff !important;
  border-color: #1B84FF !important;
}

/* ==========================================================================
   6. Dark Mode Theme (KeenThemes Dark / Bootstrap Dark)
   ========================================================================== */
html.bootstrap-dark #ui-datepicker-div,
html.boostrap-dark #ui-datepicker-div,
html[data-bs-theme="dark"] #ui-datepicker-div,
.bootstrap-dark .ui-datepicker {
  background-color: #1E1E2D !important;
  border-color: #2B2B40 !important;
  color: #CDCDDE !important;
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.45), 0 0 1px 1px rgba(255, 255, 255, 0.05) !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-header,
html.boostrap-dark .ui-datepicker .ui-datepicker-header,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-header {
  border-bottom-color: #2B2B40 !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-prev,
html.bootstrap-dark .ui-datepicker .ui-datepicker-next,
html.boostrap-dark .ui-datepicker .ui-datepicker-prev,
html.boostrap-dark .ui-datepicker .ui-datepicker-next,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-prev,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-next {
  background-color: #151521 !important;
  border-color: #2B2B40 !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-prev:hover,
html.bootstrap-dark .ui-datepicker .ui-datepicker-next:hover,
html.boostrap-dark .ui-datepicker .ui-datepicker-prev:hover,
html.boostrap-dark .ui-datepicker .ui-datepicker-next:hover,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-prev:hover,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-next:hover {
  background-color: #2B2B40 !important;
  border-color: #363654 !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-prev span,
html.boostrap-dark .ui-datepicker .ui-datepicker-prev span,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-prev span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A5B7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-next span,
html.boostrap-dark .ui-datepicker .ui-datepicker-next span,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-next span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A5B7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

html.bootstrap-dark .ui-datepicker select.ui-datepicker-month,
html.bootstrap-dark .ui-datepicker select.ui-datepicker-year,
html.boostrap-dark .ui-datepicker select.ui-datepicker-month,
html.boostrap-dark .ui-datepicker select.ui-datepicker-year,
html[data-bs-theme="dark"] .ui-datepicker select.ui-datepicker-month,
html[data-bs-theme="dark"] .ui-datepicker select.ui-datepicker-year {
  background-color: #151521 !important;
  border-color: #2B2B40 !important;
  color: #E1E3EA !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236C7293' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-title span.ui-datepicker-month,
html.bootstrap-dark .ui-datepicker .ui-datepicker-title span.ui-datepicker-year,
html.boostrap-dark .ui-datepicker .ui-datepicker-title span.ui-datepicker-month,
html.boostrap-dark .ui-datepicker .ui-datepicker-title span.ui-datepicker-year,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-title span.ui-datepicker-month,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-title span.ui-datepicker-year {
  color: #E1E3EA !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar thead th,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar thead th,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar thead th {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td a,
html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td span,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td a,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td span,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td a,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td span {
  color: #CDCDDE !important;
  background-color: #1E1E2D !important;
  border: 1px solid #2B2B40 !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td:not(.ui-state-disabled) a:hover,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td:not(.ui-state-disabled) a:hover,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td:not(.ui-state-disabled) a:hover {
  background-color: #2B2B40 !important;
  color: #1B84FF !important;
  border-color: #1B84FF !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-today a,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-today a,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td.ui-datepicker-today a {
  background-color: rgba(27, 132, 255, 0.15) !important;
  color: #3EA2FF !important;
  border-color: #1B84FF !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td a.ui-state-active,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td a.ui-state-active,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td a.ui-state-active {
  background-color: #1B84FF !important;
  color: #ffffff !important;
  border-color: #1B84FF !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

html.bootstrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td.ui-state-disabled span,
html.boostrap-dark .ui-datepicker table.ui-datepicker-calendar tbody td.ui-state-disabled span,
html[data-bs-theme="dark"] .ui-datepicker table.ui-datepicker-calendar tbody td.ui-state-disabled span {
  color: #4B4B66 !important;
  background: transparent !important;
  border-color: #252538 !important;
  opacity: 0.3 !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-buttonpane,
html.boostrap-dark .ui-datepicker .ui-datepicker-buttonpane,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-buttonpane {
  border-top-color: #2B2B40 !important;
}

html.bootstrap-dark .ui-datepicker .ui-datepicker-buttonpane button,
html.boostrap-dark .ui-datepicker .ui-datepicker-buttonpane button,
html[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-buttonpane button {
  background-color: #151521 !important;
  border-color: #2B2B40 !important;
  color: #CDCDDE !important;
}
