/* Jalali datepicker — light neutral theme skin */
.tbe-jalali-datetime,
.cip-jalali-date {
  cursor: pointer;
  background-color: #f8faf9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23668078' stroke-width='1.7' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='17' rx='3'/%3E%3Cpath d='M8 2v4M16 2v4M3 9h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 40px !important;
  font-family: var(--cip-font, "Vazirmatn", Tahoma, sans-serif);
}

.tbe-jdp-popup {
  position: absolute;
  z-index: 100001;
  width: 336px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(52, 68, 60, 0.1);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(34, 49, 42, 0.18);
  font-family: var(--cip-font, "Vazirmatn", Tahoma, sans-serif);
  direction: rtl;
  animation: cipJdpEnter 0.2s ease-out both;
}

.tbe-jdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(52, 68, 60, 0.08);
  background:
    radial-gradient(circle at 90% 0, rgba(179, 154, 97, 0.1), transparent 10rem),
    linear-gradient(135deg, #f6f8f6, #fffaf1);
}

.tbe-jdp-header button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #526b63;
  border: 1px solid rgba(52, 68, 60, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 12px rgba(34, 49, 42, 0.05);
  cursor: pointer;
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tbe-jdp-header button:hover {
  color: #fff;
  background: #668078;
  transform: translateY(-1px);
}

.tbe-jdp-title {
  position: relative;
  padding-top: 0.9rem;
  color: #34443c;
  font-size: 1rem;
  font-weight: 800;
}

.tbe-jdp-title::before {
  content: "ماه انتخابی";
  position: absolute;
  top: -0.35rem;
  inset-inline: 0;
  color: #7a8981;
  font-size: 0.6rem;
  font-weight: 500;
  text-align: center;
}

.tbe-jdp-weekdays,
.tbe-jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.tbe-jdp-weekdays {
  margin: 0;
  padding: 0.85rem 0.9rem 0.45rem;
  color: #7a8981;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.tbe-jdp-weekdays span:last-child {
  color: #b86f6b;
}

.tbe-jdp-grid {
  padding: 0 0.9rem 0.9rem;
}

.tbe-jdp-day {
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  color: #34443c;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f7f9f8;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.tbe-jdp-day:hover {
  color: #34443c;
  border-color: rgba(102, 128, 120, 0.24);
  background: #eef3f0;
  transform: translateY(-1px);
}

.tbe-jdp-day.is-today:not(.is-selected) {
  color: #526b63;
  border-color: rgba(102, 128, 120, 0.35);
  background: #fff;
}

.tbe-jdp-day.is-today:not(.is-selected)::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-inline: auto;
  border-radius: 50%;
  background: #668078;
}

.tbe-jdp-day.is-selected {
  color: #fff;
  border-color: #668078;
  background: #668078;
  box-shadow: 0 7px 16px rgba(82, 107, 99, 0.2);
}

.tbe-jdp-day--empty {
  border: 0;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.tbe-jdp-time {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-top: 1px solid rgba(52, 68, 60, 0.08);
  background: #fafcfb;
  color: #6c7b73;
  font-size: 0.7rem;
  font-weight: 700;
}

.tbe-jdp-time input {
  width: 100%;
  min-height: 38px;
  padding: 0.35rem 0.5rem;
  color: #34443c;
  border: 1px solid rgba(52, 68, 60, 0.12);
  border-radius: 10px;
  background: #fff;
  outline: none;
  font-family: inherit;
}

.tbe-jdp-time input:focus {
  border-color: #668078;
  box-shadow: 0 0 0 3px rgba(102, 128, 120, 0.1);
}

.tbe-jdp-actions {
  display: flex;
  gap: 7px;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0.9rem 0.9rem;
  border-top: 1px solid rgba(52, 68, 60, 0.08);
  background: #fafcfb;
}

.tbe-jdp-actions button {
  min-height: 38px;
  padding: 0.4rem 0.8rem;
  color: #526b63;
  border: 1px solid rgba(52, 68, 60, 0.12);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.tbe-jdp-actions button:hover {
  background: #eef3f0;
}

.tbe-jdp-actions .button-link-delete {
  color: #a26460;
  border-color: transparent;
  background: transparent;
}

.tbe-jdp-actions .button-primary,
.tbe-jdp-actions button.button-primary {
  margin-right: auto;
  padding-inline: 1rem;
  color: #fff;
  border-color: #668078;
  background: #668078;
  box-shadow: 0 7px 16px rgba(82, 107, 99, 0.16);
}

.tbe-jdp-actions .button-primary:hover,
.tbe-jdp-actions button.button-primary:hover {
  background: #526b63;
}

@keyframes cipJdpEnter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .tbe-jdp-popup {
    position: fixed !important;
    inset: auto 0 0 !important;
    width: 100%;
    border-inline: 0;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 55px rgba(34, 49, 42, 0.18);
  }

  .tbe-jdp-grid {
    gap: 4px;
  }

  .tbe-jdp-day {
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tbe-jdp-popup {
    animation: none;
  }
}
