/* ============================================================
   Deniz Erdem Emlak — tek dosyalık self-host CSS (Aşama 1)
   Değişkenler, açık tema, AA kontrast, sistem font yığını.
   ============================================================ */

:root {
  --c-bg: #f4f7f9;
  --c-surface: #ffffff;
  --c-text: #172630;
  --c-muted: #4a5b66;
  --c-brand: #0b5c7a;
  --c-brand-dark: #083d52;
  --c-accent: #e0a428;
  --c-accent-text: #3d2c00;
  --c-line: #d8e2e8;
  --c-danger: #b3372f;
  --c-danger-bg: #fbeeec;
  --c-ok-bg: #e8f5ee;
  --c-radius: 10px;
  --c-shadow: 0 1px 2px rgba(23, 38, 48, 0.06), 0 10px 30px rgba(23, 38, 48, 0.08);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-stack);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: #e9eff3;
  border-radius: 6px;
  padding: 0.1em 0.4em;
  word-break: break-all;
}

.container { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.container.narrow { width: min(640px, 100% - 2.5rem); }

.muted { color: var(--c-muted); }
.error-list { color: var(--c-danger); }

/* ---------- Üst menü ---------- */

.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}

.brand { display: flex; align-items: center; gap: 0.65rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; object-fit: cover; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--c-brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--c-muted); font-size: 0.8rem; }

.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav a { color: var(--c-text); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--c-brand); text-decoration: none; }

.nav-toggle {
  display: none;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero { margin-bottom: 1rem; }

.hero-block {
  background-color: var(--c-brand-dark);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M0 55.5h56' stroke='%23ffffff' stroke-opacity='0.06'/%3E%3Cpath d='M55.5 0v56' stroke='%23ffffff' stroke-opacity='0.06'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--c-brand-dark) 0%, var(--c-brand) 100%);
  color: #ffffff;
  padding: 4.5rem 0 5rem;
}

.hero-block h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.4rem; }
.hero-sub { color: #cfe3ec; margin: 0 0 1rem; font-weight: 500; }
.hero-line { color: #e7f1f6; max-width: 46ch; margin: 0 0 1.6rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.hero-img { display: block; width: 100%; height: auto; border-radius: 0 0 var(--c-radius) var(--c-radius); }

/* ---------- Butonlar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--c-brand); color: #ffffff; }
.btn-primary:hover { background: var(--c-brand-dark); }

.btn-accent { background: var(--c-accent); color: var(--c-accent-text); }
.btn-accent:hover { background: #c9921f; }

.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #ffffff; border-color: rgba(255, 255, 255, 0.4); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }

.btn-outline { background: var(--c-surface); color: var(--c-text); border-color: var(--c-line); }
.btn-outline:hover { border-color: var(--c-brand); color: var(--c-brand); }

.btn-danger { background: var(--c-danger-bg); color: var(--c-danger); border-color: #e5c2be; }
.btn-danger:hover { background: #f3dcda; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

/* ---------- Bölümler / iletişim ---------- */

.section { padding: 2.2rem 0; }
.section h2 { margin-bottom: 0.9rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
}

.contact-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--c-shadow);
}
.contact-card p, .contact-card a { margin: 0; font-weight: 600; }
.contact-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  margin-bottom: 0.2rem;
}

.ttbs-link { margin-top: 1rem; font-size: 0.9rem; }

/* ---------- Alt bilgi ---------- */

.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: 2rem 0 1rem;
  margin-top: 1.5rem;
}

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; }
.footer-grid p { margin: 0.2rem 0; }

.footer-base { margin-top: 1.4rem; padding-top: 0.8rem; border-top: 1px solid var(--c-line); color: var(--c-muted); }

/* ---------- Mobil sabit alt bar: Ara / WhatsApp ---------- */

.mobile-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  box-shadow: 0 -4px 18px rgba(23, 38, 48, 0.12);
}
.mobile-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.4rem;
  color: var(--c-text);
  font-size: 0.82rem;
}
.mobile-bar a strong { color: var(--c-brand); font-size: 0.95rem; }
.mobile-bar a + a { border-left: 1px solid var(--c-line); }
.mobile-bar a:hover { text-decoration: none; background: #eef4f7; }

@media (min-width: 768px) {
  .mobile-bar { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 767px) {
  body { padding-bottom: 3.6rem; }
}

/* ---------- Flash ---------- */

.flash {
  position: fixed;
  right: 1rem;
  bottom: 4.2rem;
  z-index: 60;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--c-shadow);
  opacity: 1;
  transition: opacity 0.4s ease;
}
@media (min-width: 768px) {
  .flash { bottom: 1rem; }
}
.flash-success { background: var(--c-ok-bg); color: #14532d; border: 1px solid #b5ddc4; }
.flash-error { background: var(--c-danger-bg); color: #7f221c; border: 1px solid #e5c2be; }
.flash-warning { background: #fdf6e3; color: #6b4e00; border: 1px solid #ecd9a0; }
.flash-hide { opacity: 0; pointer-events: none; }

/* ---------- Aşama 2B: mevzuat uyumu ---------- */

.legal-box {
  border: 1px solid var(--c-brand);
  border-left-width: 4px;
  border-radius: var(--c-radius);
  background: #f2f8fb;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
}
.legal-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.legal-box .spec-table th { width: 42%; }
.legal-box p.muted { margin: 0.4rem 0 0; font-size: 0.85rem; }

.dyn-group { border-top: 1px dashed var(--c-line); margin-top: 1rem; padding-top: 0.6rem; }
.dyn-group[hidden] { display: none; }

/* ---------- Formlar ---------- */

.field { display: block; margin-bottom: 0.9rem; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }

.input {
  width: 100%;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--c-text);
  font: inherit;
  padding: 0.5rem 0.7rem;
}
.input:focus {
  outline: 2px solid var(--c-brand);
  outline-offset: 1px;
  border-color: var(--c-brand);
}

.form-card { margin-bottom: 1.2rem; }
.form-grid { max-width: 520px; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.upload-form { margin-top: 0.9rem; max-width: 460px; }
.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0.3rem 0.6rem 0.3rem 0; }
.checkbox-field { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-field input { width: 1.1rem; height: 1.1rem; }
.filter-form { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.filter-form .field { margin: 0; min-width: 150px; }

/* ---------- Kart / tablo / rozet ---------- */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--c-shadow);
  margin-bottom: 1.2rem;
}
.card-muted { opacity: 0.75; border-style: dashed; box-shadow: none; }
.card-warning { background: #fdf6e3; border-color: #ecd9a0; }
.card-warning strong { color: #6b4e00; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: start; }

.kv { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--c-line); }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--c-muted); }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  background: #e9eff3;
  color: var(--c-text);
}
.badge-ok { background: var(--c-ok-bg); color: #14532d; }
.badge-err { background: var(--c-danger-bg); color: #7f221c; }

.big-number { font-size: 2rem; font-weight: 700; margin: 0.2rem 0; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.55rem; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table th { color: var(--c-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.meta-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.4rem 0 1rem; flex-wrap: wrap; }

/* ---------- Sekmeler / sayfalama ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.2rem; }
.tab {
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  color: var(--c-text);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--c-surface);
}
.tab:hover { text-decoration: none; border-color: var(--c-brand); color: var(--c-brand); }
.tab.is-current { background: var(--c-brand); border-color: var(--c-brand); color: #ffffff; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 1rem; }
.pagination-link {
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  color: var(--c-text);
  font-size: 0.88rem;
}
.pagination-link.is-current { background: var(--c-brand); border-color: var(--c-brand); color: #ffffff; }
.pagination-ellipsis { align-self: center; color: var(--c-muted); }

.steps-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- Aşama 2: ilanlar ---------- */

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; }
.form-row .field { margin-bottom: 0.4rem; }
.checkbox-row { align-items: center; }
.input-sm { padding: 0.25rem 0.4rem; font-size: 0.85rem; width: auto; }

.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--c-line); display: block; }
.thumb-empty { display: block; width: 64px; height: 48px; border-radius: 6px; background: #e9eff3; border: 1px dashed var(--c-line); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.9rem; }
.photo-item { margin: 0; border: 1px solid var(--c-line); border-radius: var(--c-radius); overflow: hidden; background: var(--c-surface); }
.photo-item.is-cover { border-color: var(--c-brand); box-shadow: 0 0 0 2px rgba(11, 92, 122, 0.18); }
.photo-item img { display: block; width: 100%; height: 130px; object-fit: cover; }
.photo-item figcaption { padding: 0.45rem 0.55rem; display: flex; flex-direction: column; gap: 0.35rem; }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; margin-top: 1.2rem; }
.listing-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  overflow: hidden;
  box-shadow: var(--c-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: 0 6px 26px rgba(23, 38, 48, 0.14); }
.listing-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #e9eff3; }
.listing-card-media img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--c-muted); font-size: 0.88rem; }
.listing-badge {
  position: absolute; top: 0.6rem; left: 0.6rem;
  background: var(--c-brand); color: #fff;
  border-radius: 999px; padding: 0.1rem 0.7rem; font-size: 0.78rem; font-weight: 600;
}
.listing-card-body { padding: 0.8rem 0.9rem 1rem; }
.listing-card-title { font-size: 1rem; margin-bottom: 0.3rem; }
.listing-card-title a { color: var(--c-text); }
.listing-price { font-weight: 700; color: var(--c-brand-dark); margin: 0 0 0.3rem; font-size: 1.05rem; }
.listing-meta { margin: 0; font-size: 0.86rem; }

.breadcrumb { margin: 0 0 0.6rem; font-size: 0.9rem; }
.listing-detail-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.4rem; }
.listing-price-big { font-size: 1.7rem; font-weight: 700; color: var(--c-brand-dark); margin: 0 0 1.2rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; margin-bottom: 1.6rem; }
.gallery-item { margin: 0; border-radius: var(--c-radius); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-surface); }
.gallery-item img { display: block; width: 100%; height: 190px; object-fit: cover; }
.gallery-main { grid-column: 1 / -1; }
.gallery-main img { height: clamp(240px, 42vw, 440px); }

.listing-detail-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); gap: 1.6rem; align-items: start; }
.spec-table th { width: 45%; text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--c-muted); }
.listing-contact { position: sticky; top: 5rem; }
.listing-contact p { margin: 0 0 0.6rem; }

@media (max-width: 800px) {
  .listing-detail-grid { grid-template-columns: 1fr; }
  .listing-contact { position: static; }
}

/* ---------- Giriş sayfası ---------- */

.login-section { display: flex; min-height: 60vh; align-items: center; }
.login-card { max-width: 420px; margin-inline: auto; width: 100%; }

/* ---------- Yönetim kabuğu ---------- */

.admin-body { background: var(--c-bg); }

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.admin-side {
  background: var(--c-brand-dark);
  color: #dbe9f0;
  padding: 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.admin-brand strong { color: #ffffff; display: block; font-size: 1rem; }
.admin-brand small { color: #9fc0cf; font-size: 0.78rem; }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a {
  color: #dbe9f0;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.09); text-decoration: none; }
.admin-nav a.is-current { background: rgba(255, 255, 255, 0.16); color: #ffffff; }

.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.admin-side-foot a { color: #9fc0cf; }

.admin-main { padding: 0 1.4rem 2.5rem; min-width: 0; }

.asset-preview { border: 1px solid var(--c-line); border-radius: 8px; object-fit: contain; background: #ffffff; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin: 0; flex-direction: row; align-items: center; }
}

/* ---------- Mobil menü ---------- */

@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 1.2rem 1rem;
    box-shadow: var(--c-shadow);
  }
  .site-nav.is-open { display: flex; }
  .header-inner { position: relative; flex-wrap: wrap; }
}
