/* Basic reset and variables */
:root {
  --tubitak-red: #d93a3a;
  --accent: #ff8a65;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #222;
  --muted: #666;
  --radius: 12px;
  --container-width: 1100px;
  --focus: 3px rgba(217,58,58,0.18);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow-x: hidden; /* 🌟 mobilde sağa kaymayı kapat */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.45;
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 48px;
  width: auto;
}

.project-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--tubitak-red);
}

/* Navigation */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 60px 0;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.hero-media {
  flex: 0.9;
}

.hero-media img {
  width: 100%;
  max-width: 550px;
  border-radius: 20px;
}

.hero-content {
  flex: 0.9;
  max-width: 520px;
  text-align: left;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero-ctas {
  display: flex;
  gap: 14px;
}

.btn.primary {
  background: var(--tubitak-red);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}

.btn.primary:hover {
  background: #b12424;
}

/* Videos */
.videos {
  padding: 48px 20px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 sütun */
  gap: 24px; /* aralar biraz daha ferah */
}

.video-card {
  border-radius: 16px; /* biraz daha estetik */
}

.thumb {
  height: 220px; /* videoyu büyütme */
}

.video-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.thumb {
  position: relative;
  height: 180px;
  background: #000;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--tubitak-red);
  color: white;
  cursor: pointer;
}

.video-body {
  padding: 12px 14px;
}

.video-body h3 {
  margin: 0 0 8px;
}

/* Modal Video Player */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 14px;
  max-width: 900px;
  width: 100%;
  position: relative;
  padding: 20px;
}

/* ---- CRITICAL FIX ---- */
.modal-body {
  position: relative;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 32px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10; /* BUTONU ÜSTE ALIR */
}

.modal video {
  width: 100%;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

/* Footer */
.site-footer {
  padding: 28px 20px;
  background: #fff;
  border-top: 1px solid #eee;
  margin-top: 28px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Focus styles */
a:focus, button:focus {
  outline: 4px solid transparent;
  box-shadow: var(--focus);
  border-radius: 8px;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: #000;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 26px;
  cursor: pointer;
}

/* Mobilde video grid düzeltme */
@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* 🌟 TÜM SAYFALARDA MOBİL MENÜ DÜZELTMESİ */
@media (max-width: 900px) {

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    flex: 1 1 100%;
  }

  .main-nav {
    width: 100%;
  }

  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .main-nav a {
    font-size: 15px;
    padding: 4px 8px;
  }
}


  /* Taşmayı tamamen engelle */
  .main-nav {
    width: 100%;
    overflow: hidden;
  }


@media(max-width: 900px){
  .logo {
      height: 40px !important;
  }
  .project-name {
      font-size: 0.95rem !important;
  }
}



/* --- MOBİL HEADER SABİTLEME VE BOŞLUK DÜZELTME --- */
@media (max-width: 900px) {

  /* Header sabitleniyor */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 10px 0;
  }

  /* Header yüksekliği kadar boşluk ekle */
  body {
    padding-top: 140px !important;
    overflow-x: hidden;
  }

  /* Menü elemanlarını alt alta diz */
  .header-inner {
    flex-direction: column;
    gap: 4px !important;
  }

  /* Mobil menü düzgün hizalansın */
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
}

/* ============================================================
   GLOBAL HEADER FIX — TÜM SAYFALARDA DÜZGÜN SABİT MENÜ
   ============================================================ */
@media(max-width: 900px) {

  /* Header her zaman en üstte */
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999 !important;
    background: #ffffff !important;
    padding: 12px 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }

  /* TÜM SAYFALARDA içerik header altında başlasın */
  body {
    padding-top: 140px !important;
    overflow-x: hidden !important;
  }

  /* Navigation düzeni */
  .header-inner {
    flex-direction: column;
    gap: 8px;
  }

  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
}

/* --- GECE / GÜNDÜZ MODU BUTONU --- */

.darkmode-btn {
    position: fixed;
    top: 18px;
    right: 22px;
    background: #fff;
    border: 2px solid #ddd;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: 0.25s;
    z-index: 99999;
}

.darkmode-btn:hover {
    background: #f0f0f0;
}

/* Mobilde görünmesin */
@media(max-width: 900px) {
    .darkmode-btn {
        display: none !important;
    }
}


/* -----------------------------------------------------
   🌙 MOR (SOFT VIOLET) DARK MODE
------------------------------------------------------ */

body.darkmode {
    background: #1a1423 !important;    /* Ana arkaplan */
    color: #f3e8ff !important;          /* Tüm yazılar */
}

/* Kartlar, kutular, header, footer */
body.darkmode .site-header,
body.darkmode .site-footer,
body.darkmode .game-area,
body.darkmode .video-section,
body.darkmode .event-card,
body.darkmode .modal,
body.darkmode .container,
body.darkmode .word-bank,
body.darkmode .sentence-container {
    background: #281e36 !important;
    color: #f3e8ff !important;
    border-color: #3b2a50 !important;
}

/* Başlıklar + metinler */
body.darkmode h1,
body.darkmode h2,
body.darkmode h3,
body.darkmode p,
body.darkmode span,
body.darkmode .project-name,
body.darkmode a {
    color: #f8eefe !important;
}

/* Menü linkleri */
body.darkmode .main-nav a {
    color: #f4dfff !important;
}

/* Video çerçevesi */
body.darkmode video {
    background: #000 !important;
}

/* Kart gölgeleri */
body.darkmode .event-card {
    box-shadow: 0 0 18px rgba(255, 220, 255, 0.10);
}

/* Darkmode button */
.darkmode-btn {
    background: #fff;
    border: 2px solid #ddd;
}

body.darkmode .darkmode-btn {
    background: #281e36;
    color: #f8eefe;
    border-color: #3b2a50;
}

/* -----------------------------------------------
   🌙 DARK MODE YAZI RENK DÜZELTMELERİ
----------------------------------------------- */

/* Video başlıkları */
body.darkmode .video-body h3 {
    color: #f8eefe !important;
}

/* Video kartlarının genel metinleri */
body.darkmode .video-body,
body.darkmode .video-title,
body.darkmode .video-actions button {
    color: #f8eefe !important;
}

/* "İzle" butonunun arka planı beyaz kalmasın */
body.darkmode .btn.primary {
    background: #d93a3a !important; /* kırmızı aynı kalsın */
    color: white !important;
    border-color: #b12424 !important;
}

/* Buton hover */
body.darkmode .btn.primary:hover {
    background: #b12424 !important;
}

/* Kart alt kısmı */
body.darkmode .video-card {
    background: #281e36 !important;
    border-color: #3b2a50 !important;
}

/* Footer metinleri */
body.darkmode .site-footer a,
body.darkmode .site-footer p {
    color: #f8eefe !important;
}
