/* ============================================================
   לוח אירועים אינטראקטיבי (calx) — מכונת זמן לגלילה בין תאריכים
   נשען על טוקנים מ-public.css: --bg-*, --ink*, --grad-brand, --pink,
   --purple, --cyan, --line, --glass-bg, --radius*.
   RTL: הימים המוקדמים מימין, גלילה אופקית עם snap.
   ============================================================ */

.calx {
  position: relative;
  margin-top: 6px;
}

/* ── סרגל חודשים ─────────────────────────────────────────── */
.calx__monthbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}
.calx__monthnav {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2, rgba(255, 255, 255, .18));
  background: var(--glass-bg, rgba(255, 255, 255, .07));
  color: var(--ink, #fff);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, opacity .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.calx__monthnav svg { width: 20px; height: 20px; }
.calx__monthnav:hover { background: rgba(255, 255, 255, .16); transform: scale(1.06); }
.calx__monthnav:active { transform: scale(.94); }
.calx__monthnav[disabled] { opacity: .28; cursor: default; pointer-events: none; }

.calx__monthlabel {
  min-width: 168px;
  text-align: center;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .2px;
  background: var(--grad-brand, linear-gradient(135deg, #ff3cac, #7a4bff 50%, #2b86c5));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity .25s ease;
}

/* ── מסילת ימים נגללת ───────────────────────────────────── */
.calx__railwrap { position: relative; }
.calx__rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 6px 2px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  cursor: grab;
}
.calx__rail::-webkit-scrollbar { display: none; }
.calx__rail.is-drag { cursor: grabbing; scroll-behavior: auto; }
.calx__rail.is-drag .calx__day { pointer-events: none; }

/* עמעום קצוות עדין כדי לרמוז שאפשר להחליק */
.calx__railwrap::before,
.calx__railwrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 14px;
  width: 44px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .25s ease;
}
.calx__railwrap::before { right: 0; background: linear-gradient(to left, var(--bg-0, #05000f), transparent); }
.calx__railwrap::after  { left: 0;  background: linear-gradient(to right, var(--bg-0, #05000f), transparent); }
.calx__railwrap.has-overflow-start::before { opacity: 1; }
.calx__railwrap.has-overflow-end::after   { opacity: 1; }

/* ── כרטיס יום ──────────────────────────────────────────── */
.calx__day {
  scroll-snap-align: center;
  flex: 0 0 auto;
  width: 74px;
  min-height: 96px;
  border-radius: var(--radius, 18px);
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  background: var(--glass-bg, rgba(255, 255, 255, .06));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s ease, background .2s ease, width .28s cubic-bezier(.2, .8, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.calx__day-dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute, rgba(255, 255, 255, .55));
  letter-spacing: .3px;
}
.calx__day-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink, #fff);
  font-variant-numeric: tabular-nums;
}
.calx__day-mon {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-mute, rgba(255, 255, 255, .5));
}
/* אינדיקטור אירועים */
.calx__day-dot {
  margin-top: 3px;
  height: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.calx__day-dot i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan, #5ee7ff);
  box-shadow: 0 0 8px rgba(94, 231, 255, .8);
  display: inline-block;
}

/* יום ללא אירועים — מעומעם ולא לחיץ */
.calx__day.is-empty {
  cursor: default;
  opacity: .4;
  pointer-events: none;
}
.calx__day.is-empty .calx__day-num { color: var(--ink-mute, rgba(255, 255, 255, .45)); font-weight: 700; }

/* יום עם אירועים — "מבצבץ" */
.calx__day.has-events {
  border-color: rgba(94, 231, 255, .38);
  background: linear-gradient(180deg, rgba(94, 231, 255, .1), rgba(122, 75, 255, .08));
}
.calx__day.has-events:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 231, 255, .6);
}
.calx__day.has-events .calx__day-dot i { animation: calxPulse 1.8s ease-in-out infinite; }

/* היום */
.calx__day.is-today { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.calx__day.is-today .calx__day-dow { color: var(--ink, #fff); }

/* היום שנבחר — בלוק גרדיאנט מורחב (כמו בהשראה) */
.calx__day.is-selected {
  width: 92px;
  border-color: transparent;
  background: var(--grad-brand, linear-gradient(160deg, #ff3cac, #7a4bff 55%, #2b86c5));
  box-shadow: 0 12px 34px -12px rgba(122, 75, 255, .8);
  transform: translateY(-2px);
}
.calx__day.is-selected .calx__day-dow,
.calx__day.is-selected .calx__day-num,
.calx__day.is-selected .calx__day-mon { color: #fff; }
.calx__day.is-selected .calx__day-dot i { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .9); }

@keyframes calxPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.55); opacity: .55; }
}

/* ── שלד טעינה למסילה ───────────────────────────────────── */
.calx__day--skel {
  cursor: default;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .05) 70%);
  background-size: 200% 100%;
  animation: calxShimmer 1.2s linear infinite;
}
@keyframes calxShimmer { to { background-position: -200% 0; } }

/* ── אזור תוצאות היום ───────────────────────────────────── */
.calx__results { margin-top: 26px; min-height: 60px; }
.calx__resultshead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.calx__resultstitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #fff);
  margin: 0;
}
.calx__resultscount {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan, #5ee7ff);
}
.calx__resultstrack { transition: opacity .25s ease; }
.calx__results.is-loading .calx__resultstrack { opacity: .45; pointer-events: none; }

.calx__empty {
  text-align: center;
  padding: 34px 20px;
  color: var(--ink-mute, rgba(255, 255, 255, .55));
  font-size: 14.5px;
  font-weight: 600;
  grid-column: 1 / -1;
}
.calx__empty span { display: block; font-size: 30px; margin-bottom: 8px; opacity: .85; }

/* CTA לעמוד המלא */
.calx__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-dim, rgba(255, 255, 255, .72));
  text-decoration: none;
  transition: color .18s ease;
}
.calx__cta:hover { color: var(--ink, #fff); }

@media (max-width: 560px) {
  .calx__day { width: 64px; min-height: 88px; }
  .calx__day.is-selected { width: 80px; }
  .calx__day-num { font-size: 23px; }
  .calx__monthlabel { font-size: 17px; min-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .calx__day, .calx__monthnav, .calx__rail { transition: none; }
  .calx__day.has-events .calx__day-dot i,
  .calx__day--skel { animation: none; }
}
