:root {
  --bg: #f7f3ec;
  --bg-alt: #ffffff;
  --border-soft: #e1d6c7;
  --accent: #6a7bb8;
  --accent-soft: #e2e7f7;
  --text-main: #252426;
  --text-muted: #786e62;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-soft: 0 16px 38px rgba(0, 0, 0, 0.06);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #f0e6d9, var(--bg));
  color: var(--text-main);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.4rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 243, 236, 0.96);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  gap: 1rem;
}

.brand-block {
  display: flex;
  flex-direction: column;
}

.brand-main {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-block {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.search-block input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  min-width: 220px;
  color: var(--text-main);
}

.search-block input::placeholder {
  color: var(--text-muted);
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 1.1rem;
  font-size: 0.86rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(106, 123, 184, 0.5);
}

.small-btn {
  padding-inline: 0.8rem;
}

/* Home */
.home {
  padding: 2.2rem 0 2.6rem;
}

.intro {
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.8rem 1.6rem 1.4rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.intro h1 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}

.intro p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.featured {
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.6rem 1.2rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.featured h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.featured-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.hg-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0.9rem 0.85rem 0.8rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.hg-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-soft);
}

.hg-card-title {
  font-size: 0.96rem;
  margin: 0 0 0.1rem;
  font-weight: 600;
}

.hg-card-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.results {
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.6rem 1.3rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.results-header h2 {
  margin: 0;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.results-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Detail */
.detail {
  padding: 2.2rem 0 2.8rem;
}

.hg-header {
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.8rem 1.9rem 1.6rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.hg-path {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hg-title {
  margin: 0 0 0.2rem;
}

.hg-header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.5rem;
}

.hg-subtitle {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hg-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.hg-meta-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.hg-meta-value {
  font-size: 0.88rem;
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  font-size: 0.8rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
}

/* Tabs */

.hg-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  overflow-x: auto;
}

.tab-btn {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.hg-body {
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.7rem 1.8rem 1.6rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.tab-panel p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bullet-list {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.6rem 0 1.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

/* Responsive */
@media (max-width: 760px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }
  .search-block {
    width: 100%;
  }
  .search-block input {
    min-width: 0;
    width: 100%;
  }
}

/* ---------------------------------------------------------
   MODERN UI UPGRADE (SENİN TEMA SİSTEMİNE %100 UYUMLU)
   Bu bölüm mevcut CSS'i BOZMADAN sadece GÖRSELİ İYİLEŞTİRİR  
---------------------------------------------------------*/

/* -------------------------------
   Search Bar Modernization
--------------------------------*/
.search-wrapper {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

#searchInput {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 15px;
  transition: 0.2s ease;
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

#searchBtn {
  padding: 14px 20px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

#searchBtn:hover {
  background: var(--accent-dark);
}

/* -------------------------------
   Featured + Search Results Cards
--------------------------------*/
.hg-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.hg-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-medium);
}

.hg-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-strong);
}

.hg-card-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* -------------------------------
   Results Layout Improvements
--------------------------------*/
#resultsSection {
  margin-top: 30px;
}

#resultsMeta {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

#resultsGrid {
  display: grid;
  gap: 18px;
}

/* -------------------------------
   Haplogroup Page UI Improvements
--------------------------------*/
#hgTitle {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-strong);
}

#hgSubtitle {
  font-size: 16px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

#hgPath {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.hg-label {
  margin-top: 12px;
  font-weight: 600;
  color: var(--text-strong);
}

/* SNP chips */
.chip {
  background: var(--bg-soft);
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  color: var(--text);
}

/* -------------------------------
   Tabs Smoother Look
--------------------------------*/
.tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 14px;
  color: var(--text);
}

.tab-btn:hover {
  background: var(--bg);
  border-color: var(--border);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tab-panel {
  display: none;
  margin-top: 16px;
  line-height: 1.65;
}

.tab-panel.active {
  display: block;
}

/* -------------------------------
   Mobile Enhancements
--------------------------------*/
@media (max-width: 600px) {
  .hg-card-title {
    font-size: 18px;
  }

  #hgTitle {
    font-size: 28px;
  }

  #searchInput {
    font-size: 14px;
  }

  #searchBtn {
    font-size: 14px;
    padding: 12px 16px;
  }
}
/* SEARCH BLOCK MODERN FIX */
.search-block {
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  
  background: var(--bg) !important; /* Arka planla aynı renk → boşluk YOK */
  border-radius: var(--radius-lg) !important; /* Tam yuvarlak değil → daha modern */
  
  padding: 0.4rem 0.6rem !important; /* İç boşluk dengeli */
  border: 1px solid var(--border-soft) !important; /* Çok hafif çerçeve */
  
  box-shadow: none !important; /* Kahverengimsi gölgeyi tamamen öldürür */
}
/* REMOVE OUTER SEARCH CAPSULE COMPLETELY */
.search-block {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
/* ---------------------------------------
   PREMIUM JOINED SEARCH BAR DESIGN
   (Input + Button birleşik tek kapsül)
----------------------------------------*/

.search-block {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Input – sol kapsül */
#searchInput {
    border: 1px solid var(--border-soft) !important;
    border-right: none !important;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg) !important;
    padding: 14px 16px !important;
    background: var(--bg) !important;
    height: 48px;
}

/* Button – sağ kapsül */
#searchBtn {
    border: 1px solid var(--border-soft) !important;
    border-left: none !important;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important;
    padding: 0 22px !important;
    background: var(--accent) !important;
    color: white !important;
    font-weight: 600 !important;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#searchBtn:hover {
    background: var(--accent-dark) !important;
}
/* =========================================================
   MOBILE PERFECT LAYOUT (max-width: 600px)
   Masaüstüne dokunma, sadece mobil optimize
========================================================= */
@media (max-width: 600px) {
  /* Header / nav mobil stack */
  .nav-container {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 0.4rem;
    gap: 0.6rem;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-main {
    font-size: 0.8rem;
  }

  .brand-sub {
    font-size: 0.78rem;
  }

  /* Search bar tam genişlik ve biraz daha kompakt */
  .search-block {
    width: 100% !important;
  }

  #searchInput {
    font-size: 0.9rem !important;
    padding: 10px 12px !important;
    height: 42px !important;
  }

  #searchBtn {
    font-size: 0.85rem !important;
    padding: 0 16px !important;
    height: 42px !important;
  }

  /* Ana içerik boşlukları */
  .home,
  .detail {
    padding: 1.4rem 0 2rem;
  }

  .intro,
  .featured,
  .hg-header,
  .hg-body,
  .results {
    padding: 1.2rem 1.1rem 1.1rem;
    border-radius: 18px;
  }

  /* Kartlar tek sütun, daha kompakt */
  .featured-grid,
  .results-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .hg-card {
    padding: 0.85rem 0.8rem;
  }

  .hg-card-title {
    font-size: 0.9rem; /* 20px yerine mobilde daha makul */
  }

  .hg-card-sub {
    font-size: 0.8rem;
  }

  /* Detay başlıkları */
  .hg-header h1,
  #hgTitle {
    font-size: 1.35rem;
  }

  .hg-subtitle,
  #hgSubtitle {
    font-size: 0.86rem;
  }

  .hg-path,
  #hgPath {
    font-size: 0.78rem;
  }

  .hg-meta {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .hg-meta-label {
    font-size: 0.7rem;
  }

  .hg-meta-value {
    font-size: 0.84rem;
  }

  /* Tab butonları taşmasın, sarılsın */
  .hg-tabs {
    gap: 0.3rem;
    padding-bottom: 0.5rem;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
  }

  /* Metin blokları daha okunabilir */
  .tab-panel p,
  .bullet-list {
    font-size: 0.86rem;
    line-height: 1.6;
  }

  /* Footer hizalama */
  .site-footer {
    padding: 1.3rem 0 1.6rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
  }
}
/* -----------------------------------------
   FOOTER - MODERN + MOBILE RESPONSIVE
------------------------------------------*/

.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--bg-alt);
  padding: 1.8rem 0 2.0rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  line-height: 1.45;
}

.footer-inner a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* Mobile enhancement */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    gap: 0.4rem;
  }
}
