/* ═══════════════════════════════════════════════════════════════
   BEST ACADEMY — BESPOKE BRANDED CALENDAR DATE PICKER
   Official Palette: Navy #061B3A | Deep Navy #031226 | Gold #F4BE32
   Supports Light Mode and Dark Mode natively
═══════════════════════════════════════════════════════════════ */

/* Hide browser default datepicker indicator */
input[type="date"].ba-datepicker-input::-webkit-calendar-picker-indicator,
input[type="date"].ba-datepicker-input::-webkit-inner-spin-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Wrapper around input */
.ba-datepicker-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.ba-datepicker-input {
  width: 100%;
  padding-right: 2.75rem !important;
  cursor: pointer;
  letter-spacing: 0.02em;
}

/* Branded Calendar Trigger Button inside input */
.ba-datepicker-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy, #061B3A);
  transition: all 0.2s ease;
  padding: 0;
  z-index: 2;
}

.ba-datepicker-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.ba-datepicker-toggle-btn:hover {
  background: rgba(244, 190, 50, 0.18);
  color: #C99518;
}

.ba-datepicker-toggle-btn:hover svg {
  transform: scale(1.1);
  stroke: #D97706;
}

[data-theme="dark"] .ba-datepicker-toggle-btn,
.sidebar-dark .ba-datepicker-toggle-btn {
  color: #F4BE32;
}

[data-theme="dark"] .ba-datepicker-toggle-btn:hover,
.sidebar-dark .ba-datepicker-toggle-btn:hover {
  background: rgba(244, 190, 50, 0.25);
  color: #FFFFFF;
}

/* ── Date Picker Floating Popup Dropdown ── */
.ba-datepicker-popup {
  position: absolute;
  z-index: 100002;
  width: 330px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(6, 27, 58, 0.35), 0 0 0 1px rgba(244, 190, 50, 0.3);
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  display: none;
  opacity: 0;
  transform: scale(0.95) translateY(6px);
  transition: opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ba-datepicker-popup.ba-picker-open {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Date Picker Header */
.ba-picker-header {
  background: #061B3A;
  background-image: linear-gradient(135deg, #061B3A 0%, #0B2A57 100%);
  color: #FFFFFF;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #F4BE32;
  position: relative;
}

.ba-picker-nav-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.18s ease;
  padding: 0;
}

.ba-picker-nav-btn:hover {
  background: #F4BE32;
  color: #061B3A;
  border-color: #F4BE32;
}

/* Month & Year Title Dropdown Trigger */
.ba-picker-title-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.ba-picker-title-btn:hover {
  background: rgba(244, 190, 50, 0.2);
  border-color: rgba(244, 190, 50, 0.4);
  color: #F4BE32;
}

.ba-picker-title-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: #F4BE32;
}

.ba-picker-title-btn.is-active .ba-picker-title-arrow {
  transform: rotate(180deg);
}

/* Weekday Headers */
.ba-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.5rem 0.75rem 0.4rem;
  text-align: center;
}

.ba-picker-weekday {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
}

.ba-picker-weekday--weekend {
  color: #C99518;
}

/* Days Grid Container */
.ba-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 0.75rem;
  background: #FFFFFF;
}

/* Individual Day Cell */
.ba-picker-day {
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1E293B;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  padding: 0;
}

.ba-picker-day:hover:not(.is-disabled):not(.is-empty) {
  background: #FFF3C9;
  color: #061B3A;
  border-color: rgba(244, 190, 50, 0.4);
  transform: scale(1.06);
}

/* Trailing / Overflow days */
.ba-picker-day.is-other-month {
  color: #CBD5E1;
  font-weight: 400;
}

/* Today's indicator */
.ba-picker-day.is-today {
  border-color: #F4BE32;
  font-weight: 800;
  color: #061B3A;
}

.ba-picker-day.is-today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D97706;
}

/* Selected Date */
.ba-picker-day.is-selected {
  background: #F4BE32 !important;
  color: #061B3A !important;
  font-weight: 800 !important;
  border-color: #E5A812 !important;
  box-shadow: 0 4px 10px rgba(244, 190, 50, 0.45);
  transform: scale(1.05);
}

.ba-picker-day.is-selected::after {
  background: #061B3A !important;
}

/* Disabled Date */
.ba-picker-day.is-disabled {
  color: #E2E8F0 !important;
  cursor: not-allowed !important;
  opacity: 0.4;
}

/* Quick Month & Year Selection View (Grid) */
.ba-picker-selector-view {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  z-index: 5;
  display: none;
  flex-direction: column;
  padding: 0.75rem;
  overflow-y: auto;
  animation: baPickerFadeIn 0.18s ease-out;
}

.ba-picker-selector-view.is-open {
  display: flex;
}

@keyframes baPickerFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ba-picker-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #061B3A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ba-picker-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  flex: 1;
}

.ba-picker-selector-item {
  padding: 0.65rem 0.4rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E293B;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.ba-picker-selector-item:hover {
  background: #FFF3C9;
  border-color: #F4BE32;
  color: #061B3A;
  transform: translateY(-2px);
}

.ba-picker-selector-item.is-selected {
  background: #061B3A;
  color: #F4BE32;
  border-color: #061B3A;
  box-shadow: 0 4px 8px rgba(6, 27, 58, 0.25);
}

/* Quick Actions Footer */
.ba-picker-footer {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 0.6rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ba-picker-footer-btn {
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748B;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ba-picker-footer-btn:hover {
  background: #E2E8F0;
  color: #061B3A;
}

.ba-picker-footer-btn--today {
  color: #061B3A;
  font-weight: 800;
  background: rgba(244, 190, 50, 0.18);
  border: 1px solid rgba(244, 190, 50, 0.35);
}

.ba-picker-footer-btn--today:hover {
  background: #F4BE32;
  color: #061B3A;
  border-color: #F4BE32;
}

/* ════ DARK MODE STYLES ════ */
[data-theme="dark"] .ba-datepicker-popup,
.sidebar-dark .ba-datepicker-popup {
  background: #081B36;
  border: 1px solid #1E3A66;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(244, 190, 50, 0.3);
}

[data-theme="dark"] .ba-picker-header,
.sidebar-dark .ba-picker-header {
  background: #05152B;
  background-image: linear-gradient(135deg, #041224 0%, #092040 100%);
  border-bottom-color: #F4BE32;
}

[data-theme="dark"] .ba-picker-weekdays,
.sidebar-dark .ba-picker-weekdays {
  background: #06162D;
  border-bottom-color: #1E3A66;
}

[data-theme="dark"] .ba-picker-weekday,
.sidebar-dark .ba-picker-weekday {
  color: #94A3B8;
}

[data-theme="dark"] .ba-picker-weekday--weekend,
.sidebar-dark .ba-picker-weekday--weekend {
  color: #F4BE32;
}

[data-theme="dark"] .ba-picker-days,
.sidebar-dark .ba-picker-days {
  background: #081B36;
}

[data-theme="dark"] .ba-picker-day,
.sidebar-dark .ba-picker-day {
  color: #F8FAFC;
}

[data-theme="dark"] .ba-picker-day:hover:not(.is-disabled):not(.is-empty),
.sidebar-dark .ba-picker-day:hover:not(.is-disabled):not(.is-empty) {
  background: rgba(244, 190, 50, 0.22);
  color: #FFFFFF;
  border-color: #F4BE32;
}

[data-theme="dark"] .ba-picker-day.is-other-month,
.sidebar-dark .ba-picker-day.is-other-month {
  color: #334E68;
}

[data-theme="dark"] .ba-picker-day.is-today,
.sidebar-dark .ba-picker-day.is-today {
  border-color: #F4BE32;
  color: #F4BE32;
}

[data-theme="dark"] .ba-picker-day.is-today::after,
.sidebar-dark .ba-picker-day.is-today::after {
  background: #F4BE32;
}

[data-theme="dark"] .ba-picker-day.is-selected,
.sidebar-dark .ba-picker-day.is-selected {
  background: #F4BE32 !important;
  color: #031226 !important;
  border-color: #F4BE32 !important;
  box-shadow: 0 4px 14px rgba(244, 190, 50, 0.55);
}

[data-theme="dark"] .ba-picker-day.is-disabled,
.sidebar-dark .ba-picker-day.is-disabled {
  color: #1E3A66 !important;
}

[data-theme="dark"] .ba-picker-selector-view,
.sidebar-dark .ba-picker-selector-view {
  background: #081B36;
}

[data-theme="dark"] .ba-picker-selector-header,
.sidebar-dark .ba-picker-selector-header {
  border-bottom-color: #1E3A66;
  color: #F8FAFC;
}

[data-theme="dark"] .ba-picker-selector-item,
.sidebar-dark .ba-picker-selector-item {
  background: #0D2A52;
  border-color: #1E3A66;
  color: #F8FAFC;
}

[data-theme="dark"] .ba-picker-selector-item:hover,
.sidebar-dark .ba-picker-selector-item:hover {
  background: rgba(244, 190, 50, 0.25);
  color: #FFFFFF;
  border-color: #F4BE32;
}

[data-theme="dark"] .ba-picker-selector-item.is-selected,
.sidebar-dark .ba-picker-selector-item.is-selected {
  background: #F4BE32;
  color: #031226;
  border-color: #F4BE32;
}

[data-theme="dark"] .ba-picker-footer,
.sidebar-dark .ba-picker-footer {
  background: #06162D;
  border-top-color: #1E3A66;
}

[data-theme="dark"] .ba-picker-footer-btn,
.sidebar-dark .ba-picker-footer-btn {
  color: #94A3B8;
}

[data-theme="dark"] .ba-picker-footer-btn:hover,
.sidebar-dark .ba-picker-footer-btn:hover {
  background: #0E2A50;
  color: #FFFFFF;
}

[data-theme="dark"] .ba-picker-footer-btn--today,
.sidebar-dark .ba-picker-footer-btn--today {
  color: #F4BE32;
  background: rgba(244, 190, 50, 0.15);
  border-color: rgba(244, 190, 50, 0.35);
}

[data-theme="dark"] .ba-picker-footer-btn--today:hover,
.sidebar-dark .ba-picker-footer-btn--today:hover {
  background: #F4BE32;
  color: #031226;
}
