/* Nexora date picker */
.tf-datepicker {
  position: relative;
  width: 100%;
}

.tf-datepicker-input {
  padding-inline-end: 2.25rem !important;
  cursor: pointer;
  background: var(--tf-surface) !important;
  width: 100%;
}

.tf-datepicker-input:focus {
  border-color: var(--tf-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tf-datepicker-icon {
  position: absolute;
  inset-inline-end: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-primary);
  pointer-events: auto;
  cursor: pointer;
  font-size: 0.95rem;
  z-index: 1;
}

.tf-datepicker-popup {
  position: fixed;
  z-index: 5300;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--tf-modal);
  color: var(--tf-ink);
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 0.875rem;
  animation: tfDatepickerIn 0.18s ease;
  box-sizing: border-box;
}

@keyframes tfDatepickerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tf-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tf-datepicker-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tf-text);
  text-align: center;
  flex: 1;
  min-width: 0;
}

.tf-datepicker-nav {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--tf-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tf-datepicker-nav:hover {
  background: rgba(99, 102, 241, 0.16);
}

html[dir="rtl"] .tf-datepicker-nav .bi-chevron-left::before {
  content: "\f285";
}

html[dir="rtl"] .tf-datepicker-nav .bi-chevron-right::before {
  content: "\f284";
}

.tf-datepicker-weekdays,
.tf-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
  width: 100%;
}

.tf-datepicker-weekdays {
  margin-bottom: 0.35rem;
}

.tf-datepicker-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tf-text-muted);
  padding: 0.2rem 0;
  min-width: 0;
}

.tf-datepicker-day {
  width: 100%;
  aspect-ratio: 1;
  min-height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tf-text);
  transition: all 0.12s;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tf-datepicker-day.empty {
  pointer-events: none;
  visibility: hidden;
}

.tf-datepicker-day:not(.empty):hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--tf-primary);
}

.tf-datepicker-day.today {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.tf-datepicker-day.selected {
  background: var(--tf-gradient);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.tf-datepicker-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--tf-border);
}

body.lang-fa .tf-datepicker-day,
body.lang-fa .tf-datepicker-title,
body.lang-fa .tf-datepicker-input {
  font-family: 'Vazirmatn', sans-serif;
}

@media (max-width: 420px) {
  .tf-datepicker-popup {
    width: calc(100vw - 16px) !important;
    padding: 0.75rem;
  }

  .tf-datepicker-day {
    min-height: 36px;
    font-size: 0.85rem;
  }
}
