/* ==========================================================================
   Cyber Gate — Etkinlik kartları ve takvim (ortak)
   Ana sayfa ve Etkinlikler sayfası kullanır. Haber kartı style.css içindedir.
   ========================================================================== */
/* ---------- Ajanda ---------- */
.agenda { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }

/* ---------- Etkinlik geri sayım kartı (event-countdown-card bileşeninin saf CSS hâli) ----------
   Orijinal framer-motion yay (spring) animasyonları CSS geçişleriyle taklit edilir:
   - Kart girişi  : opacity 0, y 40, scale .95, blur 8px → normal (görünür olunca)
   - İçerik girişi: sırayla (0.08 sn arayla) y 20, scale .95, blur 4px → normal
   - Üzerine gelme: kart scale 1.03 + 6px yukarı, görsel scale 1.1
   - Saniye kutusu: sürekli nabız (scale 1 → 1.15 → 1, opacity 1 → .7 → 1) */
.ec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; align-content: start; }
.ec-grid > .empty-state { grid-column: 1 / -1; }

.ec-card {
  --ec-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative; display: flex; flex-direction: column;
  border-radius: 16px; border: 1px solid rgba(150, 190, 225, .14);
  background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .05), 0 4px 6px -4px rgba(0, 0, 0, .05);
  opacity: 0; transform: translateY(40px) scale(.95); filter: blur(8px);
  transition: opacity .55s var(--ec-ease), transform .55s var(--ec-ease), filter .55s var(--ec-ease);
  transition-delay: calc(var(--ec-i, 0) * .08s);
}
.ec-card.is-in { opacity: 1; transform: none; filter: none; }
.ec-card.is-in:hover { transform: translateY(-6px) scale(1.03); transition-delay: 0s; }

/* Görsel */
.ec-card__media { position: relative; overflow: hidden; border-radius: 15px 15px 0 0; }
.ec-card__media img { display: block; width: 100%; height: 192px; object-fit: cover; transition: transform .6s var(--ec-ease); }
.ec-card:hover .ec-card__media img { transform: scale(1.1); }
.ec-card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .4), transparent 60%); pointer-events: none; }
/* Etiket görselin üstünde: tek parça hap; renkli yazı/çerçeve korunur, zemin okunurluk için koyulaştırılır */
.tag.ec-card__type {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  background-color: rgba(7, 17, 29, .72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ec-card__badge {
  position: absolute; top: 16px; right: 16px; z-index: 1; padding: 4px 12px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 12px; font-weight: 700;
  animation: ecBadge .4s var(--ec-ease) both;
}
@keyframes ecBadge { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

/* İçerik (p-6 space-y-4) */
.ec-card__body { display: flex; flex-direction: column; gap: 16px; padding: 24px; flex: 1; }
.ec-card__head { display: flex; flex-direction: column; gap: 8px; }
.ec-card__title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; opacity: .9; transition: opacity .3s; }
.ec-card:hover .ec-card__title { opacity: 1; }
.ec-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--text-muted); }
.ec-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.ec-card__meta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Geri sayım */
.ec-card__countdown { display: flex; flex-direction: column; gap: 12px; }
.ec-card__label { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.ec-card__label svg { width: 16px; height: 16px; }
.ec-units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ec-unit {
  padding: 12px 4px; text-align: center; border-radius: 12px;
  background: rgba(150, 190, 225, .06); border: 1px solid rgba(150, 190, 225, .09);
}
.ec-unit b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5; }
.ec-unit small { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.ec-unit--pulse { animation: ecPulse 1s ease-in-out infinite; }
@keyframes ecPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: .7; } }

.ec-card__started { text-align: center; padding: 16px 0; }
.ec-card__started b { display: block; font-size: 18px; color: var(--success); }
.ec-card__started span { font-size: 14px; color: var(--text-muted); }

/* Buton (w-full h-11, primary degrade, gölge primary/25) */
.ec-card__btn {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #fff; white-space: nowrap;
  background: linear-gradient(to right, var(--primary), rgba(4, 142, 211, .9));
  box-shadow: 0 10px 15px -3px rgba(4, 142, 211, .25), 0 4px 6px -4px rgba(4, 142, 211, .25);
  transition: transform .35s cubic-bezier(.34, 1.45, .64, 1), background .2s;
}
.ec-card__btn:hover { transform: translateY(-2px) scale(1.05); background: linear-gradient(to right, rgba(4, 142, 211, .9), var(--primary)); }
.ec-card__btn:active { transform: scale(.95); }
.ec-card__btn:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 2px; }

/* İçeriğin sıralı girişi (staggerChildren .08, delayChildren .1) */
.ec-card [data-ec-child] {
  opacity: 0; transform: translateY(20px) scale(.95); filter: blur(4px);
  transition: opacity .45s var(--ec-ease), transform .45s var(--ec-ease), filter .45s var(--ec-ease);
  transition-delay: calc(var(--ec-i, 0) * .08s + .1s + var(--ec-c, 0) * .08s);
}
.ec-card.is-in [data-ec-child] { opacity: 1; transform: none; filter: none; }
.ec-card [data-ec-child].ec-card__btn { transform: translateY(15px) scale(.9); transition-timing-function: cubic-bezier(.34, 1.45, .64, 1); }
.ec-card.is-in [data-ec-child].ec-card__btn { transform: none; }
.ec-card.is-in .ec-card__btn:hover { transform: translateY(-2px) scale(1.05); transition-delay: 0s; }
.ec-card.is-in .ec-card__btn:active { transform: scale(.95); }


/* ---------- Başvurusu açılmamış etkinlik kartı (card-14 / EventCard bileşeninin saf CSS hâli) ----------
   w-full max-w-sm rounded-2xl border bg-card p-6 shadow-sm
   Giriş: opacity 0, y 20 → 0.5 sn easeOut (görünür olunca) */
.ev-card {
  position: relative; width: 100%; max-width: 384px; padding: 24px; border-radius: 16px;
  border: 1px solid rgba(150, 190, 225, .14); background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s ease-out, transform .5s ease-out;
  transition-delay: calc(var(--ec-i, 0) * .08s);
}
.ec-grid .ev-card { max-width: none; }
.ev-card.is-in { opacity: 1; transform: none; }
.ev-card.glow { --glow-bg: linear-gradient(var(--surface), var(--surface)); }

.ev-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ev-card__header > div:first-child { flex: 1; min-width: 0; }
.ev-card__heading { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.ev-card__desc { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.ev-card__date { text-align: right; flex-shrink: 0; }
.ev-card__dow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--text-muted); }
.ev-card__day { margin: 0; font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--text); white-space: nowrap; }
.ev-card__day span { margin-left: 8px; }

.ev-card__media { margin: 24px 0; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; border-radius: 8px; }
.ev-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ev-card__media img:hover { transform: scale(1.05); }

.ev-card__name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ev-card__name { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--text); }
.ev-card__details { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-muted); }
.ev-card__details div { display: flex; align-items: center; gap: 8px; }
.ev-card__details svg { width: 16px; height: 16px; flex-shrink: 0; }

.ev-card__action { margin-top: 24px; display: flex; justify-content: center; }
.ev-card__action a, .ev-card__action button {
  font-size: 14px; font-weight: 500; color: var(--primary); border-radius: 6px; padding: 2px 4px;
  transition: color .2s;
}
.ev-card__action a:hover, .ev-card__action button:hover { color: rgba(4, 142, 211, .8); }
.ev-card__action a:focus-visible, .ev-card__action button:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { .ev-card { opacity: 1; transform: none; transition: none; } }

/* Kenar ışığı (glow) için taşmaya izin ver */
.ec-card.glow { overflow: visible; --glow-bg: linear-gradient(var(--surface), var(--surface)); }

@media (prefers-reduced-motion: reduce) {
  .ec-card, .ec-card [data-ec-child] { opacity: 1; transform: none; filter: none; transition: none; }
  .ec-unit--pulse { animation: none; }
}

/* ---------- Etkinlik takvimi (Calendar31: shadcn Card + Calendar + etkinlik listesi) ----------
   Card: py-4, rounded-xl, border, bg-card  |  Takvim: h-9 w-9 gün hücreleri, ghost butonlar
   Altbilgi (border-t): seçili tarih + o günün etkinlikleri (bg-muted, solda primary/70 çizgi) */
.cal-card {
  position: sticky; top: calc(var(--header-h) + 20px);
  padding: 16px 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.cal-card.glow { --glow-bg: linear-gradient(var(--surface), var(--surface)); }
.cal { padding: 0 16px; }

/* Başlık: ay adı ortada, oklar iki yanda */
.cal__caption { position: relative; display: flex; align-items: center; justify-content: center; height: 28px; margin-bottom: 16px; }
.cal__label { font-size: 14px; font-weight: 500; }
.cal__nav {
  position: absolute; top: 0; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--border-strong); background: transparent;
  color: var(--text); opacity: .5; transition: opacity .2s, background .2s;
}
.cal__nav:hover { opacity: 1; background: rgba(150, 190, 225, .08); }
.cal__nav:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 2px; opacity: 1; }
.cal__nav svg { width: 16px; height: 16px; }
.cal__nav--prev { left: 4px; }
.cal__nav--next { right: 4px; }

.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 8px; }
.cal__head { font-size: 12.8px; font-weight: 400; color: var(--text-muted); text-align: center; height: 24px; line-height: 24px; }
.cal__cell { display: grid; place-items: center; }
.cal__day {
  position: relative; width: 36px; height: 36px; border-radius: 6px; padding: 0;
  font-size: 14px; font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s;
}
.cal__day:hover { background: rgba(150, 190, 225, .1); }
.cal__day:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 1px; }
.cal__day.is-outside { color: var(--text-dim); }
.cal__day.is-today { background: rgba(150, 190, 225, .12); }
.cal__day.is-selected,
.cal__day.is-selected:hover { background: var(--primary); color: #fff; }
/* Etkinlik olan günler: altta nokta(lar) */
.cal__dots { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; gap: 2px; }
.cal__dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--primary-300); }
.cal__day.has-events { font-weight: 600; }
.cal__day.is-selected .cal__dots i { background: #fff; }

/* Altbilgi */
.cal__footer { margin-top: 16px; padding: 16px 16px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.cal__date { padding: 0 4px; font-size: 14px; font-weight: 500; }
.cal__events { display: flex; flex-direction: column; gap: 8px; }
.cal__event {
  position: relative; display: block; padding: 8px 8px 8px 24px; border-radius: 6px; font-size: 14px;
  background: rgba(150, 190, 225, .07); color: var(--text); transition: background .2s;
}
.cal__event::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 8px; width: 4px; border-radius: 999px; background: rgba(4, 142, 211, .7); }
a.cal__event:hover { background: rgba(150, 190, 225, .12); }
.cal__event b { display: block; font-weight: 500; }
.cal__event span { display: block; font-size: 12px; color: var(--text-muted); }
.cal__empty { padding: 0 4px; font-size: 13px; color: var(--text-muted); }

@media (max-width: 1080px) {
  .agenda { grid-template-columns: 1fr; }
  .cal-card { position: relative; top: auto; }
  .cal__day { width: 40px; height: 40px; }
}

/* ---------- Etkinlikler sayfası ---------- */
.events-page { padding-top: 24px; }
.events-page__title {
  margin: 0 0 24px; font-family: var(--font-brand); font-size: clamp(22px, 2.6vw, 28px); font-weight: 700;
}

/* Geçmiş etkinlik kartı */
.past-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.past-card { display: flex; flex-direction: column; }
.past-card:not(.is-link):hover { transform: none; }
.past-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-radius: calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px) 0 0; }
.past-card__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75); transition: transform .6s var(--ease), filter .4s; }
.past-card:hover .past-card__media img { filter: none; }
.past-card.is-link:hover .past-card__media img { transform: scale(1.06); }
.past-card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.past-card__date { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.past-card__date svg { width: 15px; height: 15px; }
.past-card__title { margin: 0; font-size: 19px; line-height: 1.35; transition: color .2s; }
.past-card.is-link:hover .past-card__title { color: var(--primary-300); }
.past-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--text-muted); }
.past-card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.past-card__meta svg { width: 15px; height: 15px; color: var(--primary-300); }
.past-card .link-arrow { margin-top: auto; padding-top: 4px; }

@media (max-width: 1080px) { .past-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .past-grid { grid-template-columns: 1fr; } }
