:root {
  --bg: #0f1419;
  --bg-card: #1a1f2e;
  --bg-elev: #232938;
  --text: #e8eaed;
  --text-dim: #9aa0a6;
  --border: #2d3548;
  --accent: #4a9eff;
  --akp: #ff7a00;
  --chp: #d62027;
  --mhp: #c40000;
  --hdp: #6f2da8;
  --iyi: #00b4d8;
  --saadet: #6b7280;
  --diger: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.subtitle {
  margin: 0.3rem 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.search-section {
  margin-bottom: 2rem;
  position: relative;
}

.search-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  opacity: 0.6;
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 1rem 1rem 1rem 2.8rem;
  font-size: 1.05rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.search-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.search-hint .dot-sep {
  opacity: 0.4;
}

.search-hint a {
  font-weight: 500;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 10;
}

.suggestions.open { display: block; }

.suggestion {
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.suggestion:hover {
  background: var(--bg-elev);
}

.suggestion strong {
  color: var(--accent);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.meta-item strong {
  color: var(--text);
}

.election-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.election-card h3 {
  margin: 0 0 0.5rem;
}

.election-card .date-tag {
  display: inline-block;
  background: var(--bg-elev);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.source-banner {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.7rem 0 1.2rem;
}

.source-banner.resmi {
  background: rgba(46, 160, 67, 0.12);
  border-left: 3px solid #2ea043;
  color: #7ee2a8;
}

.source-banner.gonullu {
  background: rgba(255, 191, 0, 0.12);
  border-left: 3px solid #ffbf00;
  color: #ffd97a;
}

.source-banner .icon {
  flex-shrink: 0;
  font-weight: bold;
}

.source-banner .text {
  flex: 1;
}

.source-banner .text strong {
  display: block;
  margin-bottom: 0.2rem;
}

.source-banner a {
  color: inherit;
  text-decoration: underline;
}

.election-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background: var(--bg-elev);
  border-radius: 6px;
}

.stat {
  font-size: 0.85rem;
}

.stat-label {
  color: var(--text-dim);
  display: block;
}

.stat-value {
  font-weight: 600;
  font-size: 1.05rem;
}

.bar-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-row {
  margin-bottom: 0.6rem;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.bar-name {
  font-weight: 500;
}

.bar-value {
  color: var(--text-dim);
}

.bar-track {
  background: var(--bg-elev);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

.bar-fill.akp { background: var(--akp); }
.bar-fill.chp { background: var(--chp); }
.bar-fill.mhp { background: var(--mhp); }
.bar-fill.hdp { background: var(--hdp); }
.bar-fill.iyi { background: var(--iyi); }
.bar-fill.saadet { background: var(--saadet); }
.bar-fill.diger,
.bar-fill.bagimsiz { background: var(--diger); }
.bar-fill.erdogan { background: var(--akp); }
.bar-fill.ince { background: var(--chp); }
.bar-fill.aksener { background: var(--iyi); }
.bar-fill.demirtas { background: var(--hdp); }
.bar-fill.karamollaoglu { background: #999; }
.bar-fill.perincek { background: #c4344c; }

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.quick-stat {
  background: var(--bg-elev);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.quick-stat .name { color: var(--text-dim); font-size: 0.85rem; }
.quick-stat .val { font-size: 1.3rem; font-weight: 600; }

.note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

footer {
  margin-top: 4rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Ana sayfa yenilemeleri === */
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.region-badge {
  display: inline-block;
  background: rgba(74, 158, 255, 0.18);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 14px;
  margin-left: 0.7rem;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid rgba(74, 158, 255, 0.35);
}

.muted { color: var(--text-dim); }

.latest-result {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.result-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.result-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.result-pct {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
}

.result-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.secim-listesi {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.secim-row {
  display: grid;
  grid-template-columns: auto 110px 160px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.5rem 0.8rem;
  background: var(--bg-elev);
  border-radius: 6px;
  font-size: 0.9rem;
}

.secim-tarih {
  font-weight: 600;
}

.secim-tip {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.secim-kaynak {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  font-size: 0.8rem;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tag {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.method-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.method-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.method-list li:last-child {
  border-bottom: none;
}

.back-btn {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.back-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Breadcrumb + child list */
.breadcrumb {
  width: 100%;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  background: var(--bg-elev);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.breadcrumb a {
  color: var(--accent);
}
.breadcrumb strong {
  color: var(--text);
}

.child-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}
.child-section.accordion {
  padding: 0;
  overflow: hidden;
}
.child-section h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 600;
}
.child-header {
  width: 100%;
  background: var(--bg-card);
  color: var(--text);
  border: none;
  padding: 1rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}
.child-header:hover {
  background: var(--bg-elev);
}
.child-header .chev {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.child-header .chev.open {
  transform: rotate(90deg);
}
.child-section.accordion .child-chips {
  padding: 0 1.5rem 1.2rem;
}
.child-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.child-chips.hidden {
  display: none;
}
.child-chip {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 14px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.child-chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.quick-nav {
  margin-top: 0.6rem;
}
.tag-prominent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
}
.tag-prominent:hover {
  background: #2980d6;
  color: white;
}

@media (max-width: 700px) {
  .secim-row {
    grid-template-columns: auto 1fr;
    gap: 0.4rem;
  }
  .secim-row > * {
    grid-column: span 1;
  }
  .secim-tarih, .secim-tip { grid-column: 2; }
  .secim-kaynak { grid-column: 1 / -1; padding-left: 1.6rem; }
}

@media (max-width: 600px) {
  main { padding: 1rem; }
  header { padding: 1rem; }
  header h1 { font-size: 1.4rem; }
}
