/* === GENEL / TV === */
:root {
  --bg:           #0f172a;
  --panel:        #111827;
  --ink:          #e5e7eb;
  --muted:        #9ca3af;
  --brand:        #22c55e;
  --accent:       #f59e0b;
  --table-border: #1f2937;
  --ticker-h:     104px;
  --header-h:     88px;
  --slide-body-h: calc(100vh - var(--header-h) - var(--ticker-h));
}

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden; text-rendering: optimizeLegibility;
}

/* === ÜST BAR === */
.header {
  position: fixed; inset: 0 0 auto 0;
  min-height: var(--header-h); height: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 28px; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(2,6,23,.95), rgba(2,6,23,.75));
  backdrop-filter: blur(6px);
  font-weight: 700; z-index: 1001; gap: 12px;
}
.header-left  { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; flex: 1 1 auto; }
.header-right { display: flex; align-items: center; gap: clamp(6px,1.5vw,18px); flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }

#tarih   { font-size: clamp(14px, 2.2vw, 46px); font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
#hijri   { font-size: clamp(11px, 1.6vw, 28px); opacity: .85; color: var(--muted); white-space: nowrap; }
#nv-tarih{ font-size: clamp(18px, 3vw, 54px); font-weight: 800; margin-bottom: 10px; color: var(--ink); }
#saat    { font-size: clamp(18px, 3vw, 56px); font-variant-numeric: tabular-nums; white-space: nowrap; }
#weather {
  font-size: clamp(11px, 1.6vw, 24px);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* === SAHNE / SLAYTLAR === */
.slideshow-container {
  position: relative; width: 100%;
  top: var(--header-h);
  height: var(--slide-body-h);
  box-sizing: border-box;
}
.mySlides {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; padding: 24px;
  opacity: 0; transition: opacity .6s ease;
  height: 100%; overflow: hidden;
}
.mySlides > * { flex: 0 0 auto; }
.mySlides.show { opacity: 1; }

/* === NAMAZ SLAYTI === */
.slide-namaz {
  background:
    radial-gradient(1200px 500px at 50% -20%, rgba(34,197,94,.12), transparent 60%),
    radial-gradient(1200px 500px at 50% 120%, rgba(245,158,11,.10), transparent 60%);
}
.slide-namaz h2 { font-size: clamp(20px, 3.8vw, 68px); margin: 8px 0 6px; font-weight: 800; }

.table-container {
  width: min(1400px, 96vw);
  background: var(--panel);
  border: 1px solid var(--table-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden; position: relative; z-index: 1;
}
.table-container table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table-container th,
.table-container td {
  padding: clamp(6px, 1.6vw, 22px);
  border-bottom: 1px solid var(--table-border);
  text-align: center; line-height: 1.22; font-weight: 700;
  font-size: clamp(11px, 2.1vw, 32px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.table-container th { background: #0b1220; color: #e2e8f0; font-size: clamp(10px, 2.0vw, 28px); }
.table-container tr:hover td { background: rgba(255,255,255,.02); }
td.is-current { color: var(--accent); text-shadow: 0 0 10px rgba(245,158,11,.35); }
td.is-next    { color: var(--brand);  text-shadow: 0 0 10px rgba(34,197,94,.32); }

.next-prayer {
  width: min(1400px, 96vw);
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 14px; padding: 14px 18px;
  border-radius: 14px;
  background: rgba(2,6,23,.65);
  border: 1px solid rgba(34,197,94,.35);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  margin-top: 16px; position: relative; z-index: 3;
}
.next-prayer .label   { justify-self: start; color: var(--muted); font-size: clamp(13px, 2.2vw, 60px); font-weight: 700; letter-spacing: .3px; }
.next-prayer .value   { justify-self: center; font-size: clamp(18px, 4.5vw, 72px); font-weight: 900; line-height: 1.2; color: var(--brand); text-shadow: 0 0 18px rgba(34,197,94,.45); }
.next-prayer .countdown { justify-self: end; font-variant-numeric: tabular-nums; font-size: clamp(16px, 4vw, 64px); font-weight: 800; color: var(--accent); text-shadow: 0 0 18px rgba(245,158,11,.45); }

/* === DUYURULAR === */
.slide-duyuru {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2vh 3vw; height: 100%; box-sizing: border-box; overflow: hidden;
}
.slide-duyuru h2 { font-size: clamp(16px, 3vw, 48px); margin-bottom: 2vh; text-align: center; letter-spacing: .03em; flex-shrink: 0; }

.duyuru-kart {
  display: flex; flex-direction: row;
  align-items: center; gap: 4vw;
  width: 100%; max-width: 1600px;
  flex: 1 1 auto; min-height: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px; padding: 3vh 4vw;
  box-sizing: border-box;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
  overflow: hidden;
}
.duyuru-kart:not(:has(.duyuru-gorsel)) { justify-content: center; text-align: center; }
.duyuru-gorsel {
  flex: 0 0 auto; max-width: 45%; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.duyuru-gorsel img,
.duyuru-gorsel video {
  max-width: 100%; max-height: 50vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: #0b1220;
}
.duyuru-icerik {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 1.5vh;
  overflow: hidden;
}
.duyuru-baslik {
  font-size: clamp(16px, 3.5vw, 64px);
  font-weight: 900; line-height: 1.15; color: #fff; word-break: break-word;
}
.duyuru-metin {
  font-size: clamp(12px, 2vw, 38px);
  line-height: 1.6; color: rgba(255,255,255,.88); word-break: break-word;
  overflow: hidden;
}
.duyuru-metin p      { margin: .4rem 0; }
.duyuru-metin strong { color: #fff; font-weight: 800; }
.duyuru-metin a      { color: var(--accent); text-decoration: underline; }

/* === SPONSORLAR — KAYAN LOGO BANDI === */
.slide-sponsor {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4vh 0; height: 100%; box-sizing: border-box; overflow: hidden;
}
.slide-sponsor h2 {
  margin-bottom: 4vh; flex-shrink: 0;
  font-size: clamp(24px, 3vw, 52px);
}

/* Kayan bant sarmalayıcı */
.sponsor-track-wrap {
  width: 100%; overflow: hidden; position: relative; padding: 30px 0;
}
.sponsor-track-wrap::before,
.sponsor-track-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  width: 160px; z-index: 2; pointer-events: none;
}
.sponsor-track-wrap::before { left: 0;  background: linear-gradient(90deg,  var(--bg), transparent); }
.sponsor-track-wrap::after  { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

/* Kayan şerit */
.sponsor-track {
  display: flex; gap: 32px; align-items: center;
  will-change: transform; width: max-content;
}

/* Her logo kartı — sabit boyut */
.sponsor-logo-card {
  flex: 0 0 auto;
  width: clamp(180px, 16vw, 280px);
  height: clamp(100px, 9vw, 160px);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 14px; box-sizing: border-box;
}
.sponsor-logo-card img,
.sponsor-logo-card video {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 8px;
}
.sponsor-logo-text {
  font-size: clamp(14px, 1.6vw, 22px); font-weight: 700;
  color: var(--ink); text-align: center; word-break: break-word;
}

/* === ALT BANT === */
.haber-altbant {
  position: fixed; inset: auto 0 0 0; height: var(--ticker-h);
  background: #020617; color: #fff; z-index: 1002;
  overflow: hidden; white-space: nowrap; border-top: 1px solid #111827;
}
.haber-altbant::before,
.haber-altbant::after { content: ""; position: absolute; top: 0; width: 120px; height: 100%; pointer-events: none; z-index: 2; }
.haber-altbant::before { left: 0;  background: linear-gradient(90deg,  #020617, transparent); }
.haber-altbant::after  { right: 0; background: linear-gradient(270deg, #020617, transparent); }
.haber-wrapper { display: flex; align-items: center; white-space: nowrap; position: absolute; will-change: transform; }
.haber-icerik  { display: flex; gap: 80px; align-items: center; padding: 0 24px; }
.haber-icerik span { font-size: clamp(13px, 2.6vw, 36px); font-weight: 900; letter-spacing: 1px; color: #ffffff; }

/* =====================================================
   RESPONSIVE — tablet (≤1280px)
   ===================================================== */
@media (max-width: 1280px) {
  :root { --header-h: 76px; --ticker-h: 80px; }
  .header { padding: 6px 18px; }
  .mySlides { gap: 16px; padding: 16px; }
  .next-prayer { padding: 10px 14px; gap: 10px; margin-top: 10px; }
  .sponsor-logo-card { width: 160px; height: 90px; }
  .haber-altbant::before, .haber-altbant::after { width: 80px; }
}

/* =====================================================
   RESPONSIVE — telefon (≤768px)
   ===================================================== */
@media (max-width: 768px) {
  :root { --header-h: 56px; --ticker-h: 52px; }
  .header { padding: 6px 10px; flex-wrap: nowrap; gap: 8px; }
  #hijri   { display: none; }
  #weather { padding: 3px 8px; }
  .mySlides { gap: 10px; padding: 10px; }
  .table-container th,
  .table-container td { padding: 6px 3px; }
  .next-prayer { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; padding: 8px 10px; gap: 6px; margin-top: 8px; }
  .next-prayer .label     { grid-column: 1; }
  .next-prayer .value     { grid-column: 2; justify-self: end; }
  .next-prayer .countdown { grid-column: 1 / -1; justify-self: center; }
  .duyuru-kart { flex-direction: column; padding: 14px; gap: 10px; border-radius: 14px; }
  .duyuru-gorsel { max-width: 100%; }
  .duyuru-gorsel img, .duyuru-gorsel video { max-height: 25vh; }
  .sponsor-logo-card { width: 120px; height: 68px; padding: 8px; }
  .sponsor-track { gap: 16px; }
  .haber-altbant::before, .haber-altbant::after { width: 40px; }
  .haber-icerik { gap: 40px; }
}

/* =====================================================
   RESPONSIVE — küçük telefon (≤480px)
   ===================================================== */
@media (max-width: 480px) {
  :root { --header-h: 50px; --ticker-h: 42px; }
  .header { padding: 4px 8px; }
  #weather { display: none; }
  .next-prayer { grid-template-columns: 1fr; text-align: center; }
  .next-prayer .label,
  .next-prayer .value,
  .next-prayer .countdown { justify-self: center; grid-column: 1; }
  .sponsor-logo-card { width: 90px; height: 52px; padding: 6px; }
}