/* ══════════════════════════════════════════════════════════════════════
   DATE-POP — native takvim seçicinin yerine tema uyumlu portal panel
   ----------------------------------------------------------------------
   select-pop ile aynı sınıf sorun: Chromium takvimi sayfanın DIŞINDA ayrı
   bir pencerede çizer; sayfa CSS'i oraya ulaşamaz, açık/koyu tema tanınmaz.
   Ayrıca native takvim ikonu (::-webkit-calendar-picker-indicator) koyu
   temada siyah bir glif olarak kalıyordu.

   Alan öğesinin KENDİSİ tetikleyicidir (gizlenmez, sarmalanmaz); mevcut
   .dash-input / .uk-input / .form-control stilleri aynen geçerlidir.
   Segmentlere klavyeyle yazma da korunur — panel yalnızca tıklamada açılır.
   ══════════════════════════════════════════════════════════════════════ */

/* Native takvim ikonunu kaldır; yerine tema renkli kendi ikonumuz gelir. */
input.datepop-on::-webkit-calendar-picker-indicator { display: none !important; }
input.datepop-on::-webkit-inner-spin-button { display: none !important; }
input.datepop-on {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16' rx='2.5'/><path d='M3 9.5h18M8 2.5v4M16 2.5v4'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px !important;
  padding-right: 34px !important;
  cursor: pointer;
}
body.light-theme input.datepop-on {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d4dc4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16' rx='2.5'/><path d='M3 9.5h18M8 2.5v4M16 2.5v4'/></svg>") !important;
}

.datepop {
  position: fixed;
  left: 0; top: 0;
  z-index: 2147482900;
  box-sizing: border-box;
  width: 280px;
  padding: 12px;
  border-radius: 14px;
  /* OPAK — yarı saydam olsa aynı "altı boş yüzey" sorunu bizde tekrarlardı */
  background: #1c1a30;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.35);
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
}
.datepop.visible { opacity: 1; transform: none; }

.datepop-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.datepop-title {
  flex: 1; text-align: center; font-size: 13px; font-weight: 800;
  color: #fff; letter-spacing: .2px; cursor: pointer; padding: 5px 8px;
  border-radius: 8px; user-select: none;
}
.datepop-title:hover { background: rgba(255,255,255,0.08); }
.datepop-nav {
  width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.14) !important;
  background: rgba(255,255,255,0.06) !important; color: rgba(255,255,255,0.85) !important;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0 !important;
  box-shadow: none !important; backdrop-filter: none !important; transform: none !important;
}
.datepop-nav:hover:not(.idx-slider-btn) {
  background: rgba(147,104,233,0.24) !important;
  border-color: rgba(147,104,233,0.5) !important;
  transform: none !important; box-shadow: none !important;
}
.datepop-nav::after { display: none !important; }

.datepop-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.datepop-dow span {
  text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: rgba(255,255,255,0.42) !important; padding: 4px 0;
}
.datepop-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepop-day {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 12px; font-weight: 600; line-height: 1;
  color: rgba(255,255,255,0.85); cursor: pointer; user-select: none;
}
.datepop-day:hover { background: rgba(255,255,255,0.10); }
.datepop-day.out { color: rgba(255,255,255,0.26); }
.datepop-day.today { border-color: rgba(147,104,233,0.55); }
.datepop-day.sel { background: rgb(147,104,233); color: #fff; font-weight: 800; border-color: transparent; }
.datepop-day.disabled { opacity: .3; cursor: not-allowed; }
.datepop-day.disabled:hover { background: transparent; }

/* Ay / yıl seçim ızgaraları (başlığa tıklanınca) */
.datepop-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.datepop-picker div {
  padding: 9px 4px; text-align: center; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; user-select: none;
  color: rgba(255,255,255,0.85);
}
.datepop-picker div:hover { background: rgba(255,255,255,0.10); }
.datepop-picker div.sel { background: rgb(147,104,233); color: #fff; font-weight: 800; }

/* Saat satırı — yalnızca datetime-local / time alanlarında */
.datepop-time {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.datepop-time label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.55) !important; margin: 0 6px 0 0; }
.datepop-time input {
  width: 46px; box-sizing: border-box; padding: 6px 4px; text-align: center;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700; outline: none;
  -moz-appearance: textfield;
}
.datepop-time input::-webkit-outer-spin-button,
.datepop-time input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.datepop-time input:focus { border-color: rgba(147,104,233,0.6); }
.datepop-time .datepop-colon { font-weight: 800; color: rgba(255,255,255,0.5); }

.datepop-foot { display: flex; gap: 6px; margin-top: 10px; }
.datepop-btn {
  flex: 1; padding: 8px 10px; border-radius: 9px;
  font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.07) !important; color: rgba(255,255,255,0.85) !important;
  box-shadow: none !important; backdrop-filter: none !important; transform: none !important;
}
.datepop-btn::after { display: none !important; }
.datepop-btn:hover:not(.idx-slider-btn) { background: rgba(255,255,255,0.13) !important; transform: none !important; box-shadow: none !important; }
.datepop-btn.primary, .datepop-btn.primary:hover:not(.idx-slider-btn) {
  background: rgba(147,104,233,0.28) !important;
  border-color: rgba(147,104,233,0.55) !important;
  color: #e9e2ff !important;
}

/* ── AÇIK TEMA ─────────────────────────────────────────────────────── */
body.light-theme .datepop {
  background: #ffffff;
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 18px 44px rgba(30,27,51,0.16), 0 2px 8px rgba(30,27,51,0.10);
  color: #1e293b;
}
body.light-theme .datepop-title { color: #1e1b33; }
body.light-theme .datepop-title:hover { background: rgba(0,0,0,0.05); }
body.light-theme .datepop-nav {
  background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.12) !important; color: #3b3558 !important;
}
body.light-theme .datepop-nav:hover:not(.idx-slider-btn) {
  background: rgba(109,77,196,0.14) !important; border-color: rgba(109,77,196,0.4) !important;
}
body.light-theme .datepop-dow span { color: rgba(30,41,59,0.45) !important; }
body.light-theme .datepop-day { color: #1e293b; }
body.light-theme .datepop-day:hover { background: rgba(0,0,0,0.06); }
body.light-theme .datepop-day.out { color: rgba(30,41,59,0.3); }
body.light-theme .datepop-day.today { border-color: rgba(109,77,196,0.5); }
body.light-theme .datepop-day.sel { background: rgb(109,77,196); color: #fff; }
body.light-theme .datepop-picker div { color: #1e293b; }
body.light-theme .datepop-picker div:hover { background: rgba(0,0,0,0.06); }
body.light-theme .datepop-picker div.sel { background: rgb(109,77,196); color: #fff; }
body.light-theme .datepop-time { border-top-color: rgba(0,0,0,0.08); }
body.light-theme .datepop-time label { color: rgba(30,41,59,0.6) !important; }
body.light-theme .datepop-time input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #1e293b; }
body.light-theme .datepop-time input:focus { border-color: rgba(109,77,196,0.55); }
body.light-theme .datepop-time .datepop-colon { color: rgba(30,41,59,0.5); }
body.light-theme .datepop-btn {
  background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.12) !important; color: #1e293b !important;
}
body.light-theme .datepop-btn:hover:not(.idx-slider-btn) { background: rgba(0,0,0,0.08) !important; }
body.light-theme .datepop-btn.primary, body.light-theme .datepop-btn.primary:hover:not(.idx-slider-btn) {
  background: rgba(109,77,196,0.16) !important; border-color: rgba(109,77,196,0.45) !important; color: #3b2a80 !important;
}

@media (prefers-reduced-motion: reduce) { .datepop { transition: none; transform: none; } }
