/*
  Shared UI theme: Angular UI Bootstrap datepicker popup
  Goal: subtle, site-consistent styling that doesn’t depend on Bootstrap version.
*/

/* Popup container */
.uib-datepicker-popup.dropdown-menu,
ul.uib-datepicker-popup.dropdown-menu {
  min-width: 292px;
  padding: 10px 12px !important;
  margin-top: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16) !important;
  font-family: Assistant, Roboto, Arial, sans-serif;
  color: #1f2937;
}

.uib-datepicker-popup.dropdown-menu * {
  box-sizing: border-box;
}

/* Remove “menu look” defaults that can get weird across Bootstrap versions */
.uib-datepicker-popup.dropdown-menu {
  list-style: none;
}

/* Calendar root */
.uib-datepicker-popup .uib-datepicker {
  outline: none;
}

/*
  Prev/Next arrows
  UI Bootstrap renders <i class="glyphicon glyphicon-chevron-left/right"></i>.
  On Bootstrap 4/5 sites the glyphicon font is often missing, so the buttons look empty.
  Force visible chevrons via pseudo-content.
*/
.uib-datepicker-popup .glyphicon-chevron-left,
.uib-datepicker-popup .glyphicon-chevron-right {
  display: inline-block;
  width: 16px;
  text-align: center;
  line-height: 1;
}

.uib-datepicker-popup .glyphicon-chevron-left:before {
  content: "\2039"; /* ‹ */
  font-size: 18px;
  font-weight: 700;
}

.uib-datepicker-popup .glyphicon-chevron-right:before {
  content: "\203A"; /* › */
  font-size: 18px;
  font-weight: 700;
}

/* Header row buttons (prev / title / next) */
.uib-datepicker-popup .uib-datepicker .uib-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.uib-datepicker-popup .uib-datepicker .btn {
  font-family: inherit;
  box-shadow: none !important;
  text-shadow: none;
}

/* Normalize header buttons (prev/next/title) */
.uib-datepicker-popup .uib-datepicker thead tr:first-child th .btn {
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
  background: #ffffff !important;
  color: #1f2937;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  height: 34px !important;
  line-height: 20px !important;
}

/* Keep header row vertically aligned */
.uib-datepicker-popup .uib-datepicker thead tr:first-child th {
  vertical-align: middle;
}

/* Make prev/next controls square and proportional to the title */
.uib-datepicker-popup .uib-datepicker thead tr:first-child th:first-child .btn,
.uib-datepicker-popup .uib-datepicker thead tr:first-child th:last-child .btn {
  width: 34px !important;
  padding: 0 !important;
  text-align: center;
}

/* Title button stays pill-like but same height */
.uib-datepicker-popup .uib-datepicker thead tr:first-child th:nth-child(2) .btn {
  height: 34px !important;
  line-height: 20px !important;
  padding: 6px 12px !important;
  border-radius: 12px !important;
}

.uib-datepicker-popup .uib-datepicker thead tr:first-child th .btn:hover {
  background: #f5f7fa;
}

/* Weekday labels */
.uib-datepicker-popup .uib-datepicker thead tr:nth-child(2) th {
  padding: 6px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(31, 41, 55, 0.68);
}

/* Table spacing for a softer grid */
.uib-datepicker-popup .uib-datepicker table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px 6px;
  margin: 0;
}

.uib-datepicker-popup .uib-datepicker td,
.uib-datepicker-popup .uib-datepicker th {
  padding: 0;
}

/* Day buttons */
.uib-datepicker-popup .uib-day .btn,
.uib-datepicker-popup .uib-month .btn,
.uib-datepicker-popup .uib-year .btn {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
  color: #1f2937;
  font-size: 13px;
  line-height: 34px !important;
}

.uib-datepicker-popup .uib-day .btn:hover,
.uib-datepicker-popup .uib-month .btn:hover,
.uib-datepicker-popup .uib-year .btn:hover {
  background: #f3f7fb;
  border-color: rgba(0, 113, 187, 0.28);
  color: #0b3b63;
}

/* Selected day (active) */
.uib-datepicker-popup .uib-day .btn.active,
.uib-datepicker-popup .uib-month .btn.active,
.uib-datepicker-popup .uib-year .btn.active {
  background: #0071bb !important;
  border-color: #0071bb !important;
  color: #ffffff !important;
}

.uib-datepicker-popup .uib-day .btn.active:hover,
.uib-datepicker-popup .uib-month .btn.active:hover,
.uib-datepicker-popup .uib-year .btn.active:hover {
  background: #0064a6;
  border-color: #0064a6;
}

/* Disabled days */
.uib-datepicker-popup .uib-day .btn[disabled],
.uib-datepicker-popup .uib-month .btn[disabled],
.uib-datepicker-popup .uib-year .btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  background: #ffffff;
}

/* “Today” hint (UI Bootstrap uses text-info on the day) */
.uib-datepicker-popup .uib-day .text-info {
  color: #0071bb;
  font-weight: 700;
}

/* Footer button bar (Today / Clear / Close) */
.uib-datepicker-popup .uib-button-bar {
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 8px;
}

.uib-datepicker-popup .uib-button-bar .btn {
  flex: 1 1 auto;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
  background: #f6f7f9 !important;
  color: #1f2937;
  padding: 6px 10px !important;
  font-size: 12px;
  font-weight: 700;
}

.uib-datepicker-popup .uib-button-bar .btn:hover {
  background: #eef2f7;
}

/* De-emphasize Bootstrap’s contextual colors inside the popup */
.uib-datepicker-popup .uib-button-bar .btn.btn-success,
.uib-datepicker-popup .uib-button-bar .btn.btn-danger,
.uib-datepicker-popup .uib-button-bar .btn.btn-info,
.uib-datepicker-popup .uib-button-bar .btn.btn-primary,
.uib-datepicker-popup .uib-button-bar .btn.btn-warning {
  background: #f6f7f9 !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  color: #1f2937 !important;
}

/* Make the popup feel consistent on small screens */
@media (max-width: 420px) {
  .uib-datepicker-popup.dropdown-menu,
  ul.uib-datepicker-popup.dropdown-menu {
    min-width: 270px;
    padding: 10px;
  }

  .uib-datepicker-popup .uib-datepicker table {
    border-spacing: 5px 5px;
  }

  .uib-datepicker-popup .uib-day .btn,
  .uib-datepicker-popup .uib-month .btn,
  .uib-datepicker-popup .uib-year .btn {
    width: 32px;
    height: 32px;
    line-height: 32px;
  }
}
