/* ═══════════════════════════════════════════════════════════════════════════
   Gündüz (açık) tema düzeltmeleri — .light-theme sınıfı <html>/<body> üzerinde.
   header.ejs içindeki temel açık tema değişkenlerini tamamlar: kontrast, hero
   arka plan görseli, sabit yazılmış (inline) beyaz renkler ve yüzeyler.
   ═══════════════════════════════════════════════════════════════════════════ */

html { color-scheme: dark; }
html.light-theme { color-scheme: light; }

/* Tarayıcıya ait kontroller (scrollbar, tarih seçici vb.) temaya uysun */
.light-theme body { background: #f8fafc; color: #0f172a; }
.light-theme ::selection { background: rgba(3, 126, 243, 0.25); }

/* ── Gece modu: footer yazıları koyu zeminde çok soluktu (kontrast ~2:1) ── */
.footer-tagline, .footer-links a { color: var(--gray-400); }
.footer-heading { color: var(--gray-300); }
.footer-bottom { color: var(--gray-400); }
.footer-sub { color: var(--gray-500) !important; }
.footer-links a:hover { color: var(--blue-400); }

/* ── Hero: arka plan görseli üzerindeki koyu örtü temaya göre değişir ── */
.hero.has-bg-image { background-size: cover; background-position: center; background-attachment: fixed; }
.hero.has-bg-image::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to bottom, rgba(4, 13, 26, 0.8), rgba(4, 13, 26, 0.95));
}
.light-theme .hero.has-bg-image::before {
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.97));
}
.hero .hero-content, .hero .hero-scroll-indicator { position: relative; z-index: 1; }

/* ── Düşük kontrastlı metinler ── */
.light-theme .section-label,
.light-theme .hero-badge { color: #0b5fc4 !important; }
.light-theme .hero-badge { background: rgba(3, 126, 243, 0.08); border-color: rgba(3, 126, 243, 0.25); }
.light-theme .btn-outline { color: #0b5fc4; border-color: #0b5fc4; }
.light-theme .btn-outline:hover { background: var(--blue-500); border-color: var(--blue-500); color: #fff !important; }
.light-theme .btn-primary,
.light-theme .btn-primary:hover { color: #fff !important; }
.light-theme .table-link, .light-theme .detail-link-linkedin { color: #0b5fc4; }
.light-theme .nav-link-highlight { color: #0b5fc4 !important; }
.light-theme .nav-link-admin, .light-theme .nav-link-admin:hover { color: #b45309 !important; }

/* Footer imzası: yönetici beyaz seçmiş olsa bile açık zeminde okunur kalsın */
.light-theme .footer-credit-text { color: #334155 !important; text-shadow: none !important; }
.light-theme .footer-credit-text[style*="transparent"] { -webkit-text-fill-color: transparent; }
.light-theme .footer { background: #f1f5f9; border-top: 1px solid rgba(15, 23, 42, 0.08); }
.light-theme .footer-heading { color: #0f172a; }
.light-theme .footer-links a, .light-theme .footer-tagline { color: #475569; }
.light-theme .footer-links a:hover { color: #0b5fc4; }
.light-theme .footer-bottom { border-top-color: rgba(15, 23, 42, 0.08); color: #475569; }
.light-theme .footer-sub { color: #64748b !important; }

/* ── Ortak bileşen yüzeyleri ── */
.light-theme .member-card, .light-theme .year-card, .light-theme .detail-section,
.light-theme .admin-stat, .light-theme .admin-table-wrap, .light-theme .auth-container,
.light-theme .access-notice, .light-theme .achievement-item, .light-theme .pending-card,
.light-theme .empty-state, .light-theme .member-details {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  color: #1e293b;
}
.light-theme .admin-stat-pending  { background: #fffbeb; }
.light-theme .admin-stat-approved { background: #f0fdf4; }
.light-theme .admin-stat-rejected { background: #fef2f2; }
.light-theme .admin-stat-total    { background: #eff6ff; }
.light-theme .admin-table th { background: #f1f5f9; }
.light-theme .admin-row:hover td { background: rgba(15, 23, 42, 0.03); }
.light-theme .admin-tab { color: #475569; }
.light-theme .admin-tab.active { color: #0b5fc4; }
.light-theme .auth-panel-left { background: #eaf2fd; }
.light-theme .auth-panel-quote, .light-theme .auth-brand { color: #0f172a; }
.light-theme .member-name, .light-theme .year-card-title, .light-theme .team-card-title { color: #0f172a; }
.light-theme .member-role, .light-theme .member-dept, .light-theme .member-meta,
.light-theme .year-card-desc, .light-theme .team-card-desc { color: #475569; }
.light-theme .team-card-year, .light-theme .year-badge, .light-theme .eb-year-badge { color: #fff; }
.light-theme .detail-link { color: #1e293b; border-color: rgba(15, 23, 42, 0.15); background: rgba(15, 23, 42, 0.03); }
.light-theme .flash { color: #0f172a; }
.light-theme .form-label { color: #1e293b; }
.light-theme .form-input::placeholder, .light-theme textarea::placeholder { color: #94a3b8; }
.light-theme select, .light-theme textarea, .light-theme input[type="text"], .light-theme input[type="email"],
.light-theme input[type="password"], .light-theme input[type="url"], .light-theme input[type="tel"],
.light-theme input[type="date"], .light-theme input[type="datetime-local"], .light-theme input[type="number"] {
  background: #f8fafc; color: #0f172a; border-color: rgba(15, 23, 42, 0.15);
}

/* EB kapak / hero görselleri üzerindeki yazılar koyu örtü üstünde kaldığı için beyaz kalır */
.light-theme .eb-hero-content, .light-theme .eb-hero-title, .light-theme .eb-hero-desc,
.light-theme .team-card-overlay, .light-theme .year-card-overlay { color: #fff; }
.light-theme .eb-hero-content .breadcrumb, .light-theme .eb-hero-content .breadcrumb a { color: rgba(255,255,255,0.85); }

/* ── Sayfa içine sabit yazılmış (inline) renkler ── */
.light-theme [style*="color: #fff"]:not(.btn):not(.btn-primary):not([style*="background: var(--primary)"]),
.light-theme [style*="color:#fff"]:not(.btn):not(.btn-primary),
.light-theme [style*="color: white"]:not(.btn) { color: #0f172a !important; }

.light-theme [style*="background: rgba(255,255,255,0.0"],
.light-theme [style*="background: rgba(255, 255, 255, 0.0"],
.light-theme [style*="background:rgba(255,255,255,0.0"] { background: rgba(15, 23, 42, 0.04) !important; }
.light-theme [style*="border-color: rgba(255,255,255,0.1"],
.light-theme [style*="border: 1px solid rgba(255,255,255,0.1"],
.light-theme [style*="border: 1px solid rgba(255, 255, 255, 0.1"] { border-color: rgba(15, 23, 42, 0.12) !important; }

/* Geri bildirim penceresi ve kırpma penceresi */
.light-theme #feedback-widget-card { background: #fff !important; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18) !important; }
.light-theme #feedback-widget-trigger { color: #fff !important; }
.light-theme .dropdown-menu .dropdown-item svg { color: #0b5fc4 !important; }

/* Koyu kalan, görsel üzerindeki düğmeler (kapak değiştir vb.) okunur kalsın */
.light-theme .btn[style*="rgba(4,13,26"], .light-theme .btn[style*="rgba(4, 13, 26"] { color: #fff !important; border-color: rgba(255,255,255,0.5) !important; }

/* ── Düşük veri / mobil performans ── */
@media (prefers-reduced-data: reduce) {
  .hero.has-bg-image { background-image: none !important; }
}
@media (max-width: 768px) {
  /* fixed arka plan mobilde takılır ve görseli gereksiz büyük çizdirir */
  .hero.has-bg-image { background-attachment: scroll; }
  /* bulanık, hareketli dekor katmanları pil/işlemci yer; telefonda gizle */
  .hero-orb, .hero-grid, .cta-orb, .auth-panel-orb { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ═══ Mobil uyum: taşma, kayma ve dokunma hedefleri ═══ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
img, video, canvas, svg, iframe { max-width: 100%; }
img { height: auto; }
.hero { min-height: 100vh; min-height: 100svh; }

/* Uzun kelime/e-posta/bağlantılar kartı taşırmasın */
.member-card, .alumni-card, .team-card, .year-card, .detail-section, .admin-table td, .admin-table th,
.detail-link, .alumni-link, .flash, .form-hint, .page-hero-sub, .section-desc { overflow-wrap: anywhere; word-break: normal; }

/* Tablolar yan kaydırılabilir olsun, sayfayı genişletmesin */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.admin-table-wrap > table { min-width: 560px; }

@media (max-width: 768px) {
  .container { padding-inline: 1rem; }
  .section { padding-block: 3rem; }
  .form-row { grid-template-columns: 1fr !important; flex-direction: column; }
  .action-cell { flex-wrap: wrap; gap: 0.35rem; }
  .page-header { flex-direction: column; align-items: flex-start !important; }
  .page-header > div:last-child { width: 100%; }
  .btn-lg { padding: 0.8rem 1.25rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; width: 100%; }
  .hero-scroll-indicator { display: none; }
  .hero-stats { flex-wrap: wrap; gap: 1rem 1.5rem; }
  .stat-divider { display: none; }
  /* Pencere/modal içerikleri ekrana sığsın */
  [id$="-modal"] > div, .modal-content { max-width: calc(100vw - 1.5rem) !important; }
  #feedback-widget-card { width: calc(100vw - 1.5rem) !important; right: 0.75rem !important; left: 0.75rem !important; max-height: 80vh; overflow-y: auto; }
  #feedback-widget-trigger { right: 0.75rem !important; top: auto !important; bottom: 1rem !important; width: 46px !important; height: 46px !important; }
}

@media (max-width: 480px) {
  /* Satır içi çok sütunlu ızgaralar telefonda tek sütun (360 px'te minmax(320px) taşıyordu) */
  [style*="grid-template-columns"], .alumni-grid, .teams-grid, .years-grid, .members-grid, .admin-stats, .intro-grid, .intro-cards, .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  h1, .hero-title, .page-hero-title { font-size: clamp(1.7rem, 8vw, 2.4rem); line-height: 1.15; }
  .section-title { font-size: 1.6rem; }
}

/* iOS: 16px altı yazı alanlarına odaklanınca sayfa yakınlaşıp kayıyor; engelle. Dokunma hedefleri ≥44px */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea { font-size: 16px !important; }
  .btn, .nav-link, .admin-tab, .dropdown-item { min-height: 44px; }
  .btn-xs, .btn-sm { min-height: 40px; }
}

/* Admin sekmeleri taşarsa yana kayar */
.admin-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: thin; }
.admin-tab { flex-shrink: 0; white-space: nowrap; }
