/* datepicker.css — styles for the Jalali date picker popup (jalali-datepicker.js). */

.dp-wrap { position: relative; }

.dp-icon {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  line-height: 0;
}

.dp-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dp-popup {
  position: absolute;
  z-index: var(--z-dropdown);
  top: calc(100% + 6px);
  inset-inline-start: 0;
  width: 320px;
  max-width: 96vw;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  direction: rtl;
  font-family: var(--font-sans);
  user-select: none;
  color: var(--text-primary);
}

/* When the input sits near a viewport edge, let the popup overflow the
 * field instead of being clipped by card/table .table-wrap overflow. */
.dp-wrap .field__input { padding-inline-end: 40px; }

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Month/ year arrow groups. Year-jump (« ») is visually set apart. */
.dp-nav { display: inline-flex; align-items: center; gap: 2px; }

.dp-header button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  line-height: 1;
  font-size: 18px;
}

.dp-header button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dp-weekday {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: var(--weight-medium);
}

.dp-day {
  min-height: 34px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  background: transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dp-day:hover { background: var(--bg-hover); }

.dp-day.is-today {
  color: hsl(var(--color-primary-600));
  font-weight: 600;
}

.dp-day.is-selected {
  background: hsl(var(--color-primary-500));
  color: #fff;
}

.dp-day.is-empty {
  cursor: default;
  color: transparent;
}

.dp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.dp-footer button {
  background: transparent;
  border: 0;
  color: hsl(var(--color-primary-600));
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.dp-footer button:hover { text-decoration: underline; }
