/* ═══════════════════════════════════════════════
   OtelBilet — Calendar Widget (v2)
   ═══════════════════════════════════════════════ */

.ob-cal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,0.04);
}
.ob-cal-overlay.open { display: block; }

.ob-cal-popup {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15,23,42,0.18), 0 1px 3px rgba(15,23,42,0.08);
  border: 1px solid #e8eaf0;
  padding: 14px 16px 12px;
  z-index: 501;
  min-width: 320px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}
.ob-cal-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ── Header (month + year selectors + nav arrows) ── */
.ob-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 12px;
  border-bottom: 1px solid #f1f3f9;
  margin-bottom: 12px;
}
.ob-cal-pickers { display: flex; gap: 6px; align-items: center; }
.ob-cal-month-select,
.ob-cal-year-select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 8px;
  padding: 6px 24px 6px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1d2e;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}
.ob-cal-month-select:hover,
.ob-cal-year-select:hover { border-color: #0B3AD6; }
.ob-cal-month-select:focus,
.ob-cal-year-select:focus { outline: none; border-color: #0B3AD6; }
.ob-cal-month-select { min-width: 110px; }
.ob-cal-year-select  { min-width: 80px; }

.ob-cal-nav-btn {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}
.ob-cal-nav-btn svg { width: 16px; height: 16px; }
.ob-cal-nav-btn:hover { border-color: #0B3AD6; color: #0B3AD6; }
.ob-cal-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Two-month layout ── */
.ob-cal-months {
  display: flex;
  gap: 24px;
}
.ob-cal-month { flex: 1; min-width: 240px; }
.ob-cal-popup.single-month .ob-cal-months { gap: 0; }
.ob-cal-popup.single-month .ob-cal-month { flex: none; width: 100%; }

.ob-cal-month-title {
  font-size: 13px; font-weight: 700; color: #1a1d2e;
  text-align: center; margin-bottom: 8px;
}

/* ── Weekday row ── */
.ob-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.ob-cal-wd {
  text-align: center; font-size: 11px; font-weight: 600;
  color: #9ca3af; padding: 4px 0;
}

/* ── Day grid ── */
.ob-cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  position: relative;
}
.ob-cal-day {
  position: relative;
  height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-radius: 50%;
  color: #1a1d2e;
  transition: background 0.12s, color 0.12s, transform 0.12s;
  user-select: none;
}
.ob-cal-day:hover:not(.disabled):not(.range-start):not(.range-end):not(.in-range) {
  background: #eef3ff;
  color: #0B3AD6;
}
.ob-cal-day.other-month { color: #d1d5db; pointer-events: none; }
.ob-cal-day.disabled    { color: #d1d5db; cursor: not-allowed; pointer-events: none; }
.ob-cal-day.today       { font-weight: 800; }
.ob-cal-day.today::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #0B3AD6;
}

/* Selected (single) and range edges */
.ob-cal-day.range-start,
.ob-cal-day.range-end {
  background: #0B3AD6 !important;
  color: #fff !important;
  font-weight: 800;
  z-index: 2;
}
.ob-cal-day.range-start.selected-single { border-radius: 50%; }

/* Range mode: pill-shaped highlight */
.ob-cal-day.in-range,
.ob-cal-day.hover-range {
  background: #eef3ff;
  border-radius: 0;
  color: #0B3AD6;
}
.ob-cal-day.range-start:not(.range-end) {
  border-radius: 50% 0 0 50%;
}
.ob-cal-day.range-end:not(.range-start) {
  border-radius: 0 50% 50% 0;
}
.ob-cal-day.hover-end {
  background: #d6e1ff;
  border-radius: 0 50% 50% 0;
  color: #0B3AD6;
}

/* ── Footer ── */
.ob-cal-footer {
  display: flex; align-items: center;
  gap: 10px; margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f3f9;
}
.ob-cal-hint { flex: 1; font-size: 12px; color: #9ca3af; }
.ob-cal-clear {
  background: #fff; border: 1.5px solid #e8eaf0;
  border-radius: 8px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: #6b7280;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.ob-cal-clear:hover { border-color: #ef4444; color: #ef4444; }
.ob-cal-apply {
  background: #0B3AD6; color: #fff; border: none;
  border-radius: 8px; padding: 7px 22px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.ob-cal-apply:hover { background: #06248a; }

/* ── Active field state ── */
.field-input-wrap.cal-active,
.sb-field.cal-active,
.dob-trigger.cal-active {
  border-color: #0B3AD6 !important;
  background: #fff !important;
}

/* ── DOB / generic single-date trigger styling ── */
.dob-trigger {
  padding: 11px 14px;
  border: 1.5px solid #e8eaf0;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  background: #fff;
  font-family: 'Inter', sans-serif;
  color: #1a1d2e;
  display: flex; align-items: center;
  min-height: 44px;
  transition: border-color 0.15s;
}
.dob-trigger:hover { border-color: #c7d7fb; }
.dob-trigger.placeholder,
.dob-trigger .placeholder { color: #9ca3af; font-weight: 400; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .ob-cal-months { flex-direction: column; gap: 16px; }
  .ob-cal-popup  { min-width: 290px; padding: 12px; left: 8px !important; right: 8px; width: auto !important; }
  .ob-cal-popup:not(.single-month) .ob-cal-month:last-child { display: none; }
}
