/* Phase 48 item 6 (see plan.md) -- styling for Client/Shared/JalaliDatePicker.razor,
   ported from 118TellAdmin's Client/Shared/JalaliDatePicker.razor.css (own,
   independently-maintained copy, per CLAUDE.md's "shared-looking projects
   are NOT shared" rule). Loaded globally via index.html, following this
   project's existing convention for shared-component stylesheets (see
   location-picker.css, plans.css) rather than scoped .razor.css files, which
   this project's Shared/ components don't use. */

.jalali-picker {
  position: relative;
  display: inline-block;
}

.jalali-picker-input-wrap {
  position: relative;
}

.jalali-picker-input-wrap input {
  padding-left: 34px;
  cursor: pointer;
  background: #fff;
}

.jalali-picker-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 13px;
  pointer-events: none;
}

.jalali-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
}

.jalali-picker-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1001;
  width: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 12px;
}

.jalali-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

.jalali-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.jalali-nav-btn:hover {
  border-color: #1db954;
  color: #1db954;
  background: #e6f9ee;
}

.jalali-picker-title {
  display: flex;
  gap: 6px;
  flex: 1;
}

.jalali-select {
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: #111827;
}

.jalali-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.jalali-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.jalali-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #111827;
}

.jalali-day:hover {
  background: #f3f4f6;
}

.jalali-day-empty {
  cursor: default;
}

.jalali-day-empty:hover {
  background: transparent;
}

.jalali-day.today {
  border: 1px solid #1db954;
  color: #1db954;
  font-weight: 700;
}

.jalali-day.selected {
  background: #1db954;
  color: #fff;
  font-weight: 700;
}

.jalali-picker-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.jalali-footer-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #17a34a;
  font-size: 12px;
  cursor: pointer;
}

.jalali-footer-btn:hover {
  border-color: #1db954;
  background: #e6f9ee;
}

.jalali-footer-clear {
  color: #6b7280;
}

/* RTL/LTR: the popup anchors to the input's trailing edge in both
   directions -- right for fa/ar (RTL), left for en (LTR). The site's
   existing culture-switcher sets dir="rtl"/"ltr" on <html>, so key off
   that rather than duplicating per-culture logic here. */
html[dir="ltr"] .jalali-picker-popup {
  right: auto;
  left: 0;
}

html[dir="ltr"] .jalali-picker-input-wrap input {
  padding-left: 12px;
  padding-right: 34px;
}

html[dir="ltr"] .jalali-picker-icon {
  left: auto;
  right: 12px;
}
