/* =========================================================
   Persian (Jalali) date picker
   Uses the site's existing tokens (--card, --orange, --line, ...)
   so it matches both the light and dark themes automatically.
   ========================================================= */

.jdp-wrap {
  position: relative;
}
.jdp-wrap input {
  cursor: pointer;
  padding-left: 2.5rem;
}
.jdp-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.jdp-wrap.jdp-open .jdp-icon,
.jdp-wrap input:focus + .jdp-icon {
  color: var(--orange);
}

.jdp-panel {
  width: 290px;
  max-width: 92vw;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem;
  font-family: var(--font);
  animation: jdpPop 0.14s var(--ease);
}
@keyframes jdpPop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.jdp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.jdp-head-mid {
  display: flex;
  gap: 0.4rem;
  flex: 1;
}
.jdp-nav {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius-xs);
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.jdp-nav:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.jdp-select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font);
}
.jdp-select-year {
  flex: 0 0 5.2rem;
}

.jdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}

.jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.jdp-day {
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-xs);
  aspect-ratio: 1 / 1;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.jdp-day:hover {
  background: var(--bg-soft);
}
.jdp-day-today {
  box-shadow: inset 0 0 0 1px var(--orange);
}
.jdp-day-selected {
  background: var(--orange) !important;
  color: #fff !important;
}

.jdp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.jdp-link {
  border: none;
  background: none;
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}
.jdp-link-muted {
  color: var(--muted);
  font-weight: 500;
}
.jdp-link:hover {
  text-decoration: underline;
}
