/* ==========================================================================
   Motora ozgu ek stiller.
   Tasarimin styles.css'i oldugu gibi duruyor; burasi yalnizca tasarimda
   karsiligi olmayan yeni durumlari ekler:
     - about karti (konu ozeti)
     - "daha once arandi" / yakin sorgu onerisi ekrani
     - canli yoklama gostergesi (aday -> canli)
     - sonuc satirinda sayfa goruntusu ve ayni alan adi buton linkleri
   ========================================================================== */

/* ------------------------------------------------------------ durum seridi */
.engine-status {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--muted-2);
  margin: 0 0 14px;
}
.engine-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  animation: se-pulse 1.1s ease-in-out infinite;
}
.engine-status.done .dot { animation: none; background: var(--green); }
.engine-status.stored .dot { animation: none; background: #F2A93B; }
@keyframes se-pulse { 0%,100%{opacity:.25;transform:scale(.8)} 50%{opacity:1;transform:scale(1.15)} }

.engine-bar { flex: 1; max-width: 320px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.engine-bar span { display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .3s ease; }

/* ------------------------------------------------------------ about karti */
.about-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, var(--tint-soft), #fff 140%);
  padding: 18px 22px; margin: 0 0 22px;
}
.about-card .about-label {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 7px;
}
.about-card p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--ink); }

/* ------------------------------------------------------------ kayitli sayfa rozeti */
.stored-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid #F5DFB4; background: #FFFBF2; color: #7A5B12;
  border-radius: 12px; padding: 11px 15px; margin: 0 0 18px; font-size: 13.5px;
}
.stored-note b { color: #5E4409; }
.stored-note .btn-refresh {
  margin-left: auto; border: 1px solid #E5C98A; background: #fff; color: #7A5B12;
  border-radius: 8px; padding: 6px 13px; font: 600 13px/1 inherit; cursor: pointer;
}
.stored-note .btn-refresh:hover { background: #FFF6E6; }

/* ------------------------------------------------------------ yakin sorgu onerisi */
.suggest-block { max-width: 720px; }
.suggest-head { font-size: 15px; color: var(--text); margin: 0 0 4px; }
.suggest-head b { color: var(--ink); }
.suggest-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }
.suggest-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.suggest-item {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 13px 16px; cursor: pointer; transition: .15s; text-decoration: none;
}
.suggest-item:hover { border-color: var(--blue); background: var(--tint-soft); }
.suggest-item .q { font-size: 15.5px; font-weight: 600; color: var(--ink); flex: 1; }
.suggest-item .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.suggest-item .score {
  font-size: 11.5px; font-weight: 700; color: var(--blue);
  background: var(--tint); border-radius: 6px; padding: 3px 8px;
}
.suggest-actions { display: flex; align-items: center; gap: 12px; }
.btn-anyway {
  border: 0; background: var(--blue); color: #fff; border-radius: 10px;
  padding: 11px 20px; font: 700 14px/1 inherit; cursor: pointer;
}
.btn-anyway:hover { background: var(--blue-dark); }
.suggest-actions .hint { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ sonuc satiri */
.result-row { display: flex; gap: 16px; align-items: flex-start; }
.result-shot {
  flex: 0 0 auto; width: 132px; height: 99px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--tint-soft); position: relative;
  display: block;
}
.result-shot img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; opacity: 0; transition: opacity .3s ease; }
.result-shot img.ready { opacity: 1; }
.result-shot.loading {
  background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 37%, var(--line-soft) 63%);
  background-size: 400% 100%; animation: se-shimmer 1.3s linear infinite;
}
@keyframes se-shimmer { 0%{background-position:100% 0} 100%{background-position:0 0} }
.result-body { flex: 1 1 auto; min-width: 0; }

/* aday satiri yoklanirken */
.result-probe { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: var(--blue); animation: se-spin .7s linear infinite; }
@keyframes se-spin { to { transform: rotate(360deg) } }
article.checking { opacity: .5; }

/* sira numarasi */
.result-rank {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--tint); color: var(--muted-2);
  font-size: 11.5px; font-weight: 700; margin-right: 9px;
}

/* ayni kok alan adindaki diger sayfalar */
.sitelinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sitelink {
  display: inline-block; max-width: 100%;
  border: 1px solid var(--line); background: var(--tint-soft); color: var(--text);
  border-radius: 7px; padding: 4px 11px; font-size: 12.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: .15s;
}
.sitelink:hover { border-color: var(--blue); color: var(--blue); background: var(--tint); }

/* "kac kez gorulduyse o kadar saglam" isareti */
.seen-badge {
  font-size: 11px; font-weight: 700; color: var(--green);
  background: #E9F8F1; border: 1px solid #BFE9D6; border-radius: 6px; padding: 2px 7px;
  margin-left: 8px;
}

/* ------------------------------------------------------------ hata */
.engine-error {
  border: 1px solid #F3C9C9; background: #FEF5F5; color: #A33A3A;
  border-radius: 12px; padding: 13px 16px; margin: 14px 0; font-size: 14px;
}

/* ------------------------------------------------------------ alt bilgi */
.engine-meta {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.engine-meta b { color: var(--muted-2); font-weight: 700; }

.engine-disclaimer {
  margin: 26px auto 0; max-width: 760px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12.5px; line-height: 1.6; text-align: center;
}
.engine-disclaimer b { color: var(--muted-2); font-weight: 700; }



/* ------------------------------------------------------------ yerlesim duzeltmeleri */
/* Yan panel bosken hic yer kaplamasin (tasarimda rail her zaman doluydu) */
#rail:empty { display: none; }
.results-grid:has(#rail:empty) { grid-template-columns: minmax(0, 1fr); }

/* Yakin sorgu onerisi tam genislik kullansin */
.result-list:has(.suggest-block) { gap: 0; }

/* ------------------------------------------------------------ header duzeltmesi */
/* body flex-column oldugu icin uzun icerikte header siksiyordu (olculdu: 0.67px).
   Tasarimin statik mockup'inda icerik kisaydi, fark edilmemis. */
.site-header { flex: 0 0 auto; }
.site-footer { flex: 0 0 auto; }
main#app { flex: 1 0 auto; }

/* ------------------------------------------------------------ alternatif arama motorlari */
#external:empty { display: none; }
.ext-label { font-size: 12.5px; color: var(--muted); margin: 26px 0 10px; }
.ext-list { display: flex; flex-wrap: wrap; gap: 9px; }
.ext-link {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: #3E5B7B;
  text-decoration: none; transition: .15s;
}
.ext-link:hover { border-color: var(--blue); color: var(--blue); background: var(--tint-soft); }
.ext-arrow { color: #B6C4D6; font-size: 12px; }
.ext-link:hover .ext-arrow { color: var(--blue); }


/* ==========================================================================
   MOBIL
   Olculen tasmalar (375px ekran, 404px icerik):
     .auth (Login+Sign Up) 67px, .result-url 29px, footer span 131px
   Kok neden cozuluyor; overflow:hidden ile gizlenmiyor.
   ========================================================================== */
@media (max-width: 720px) {
  /* --- header: butonlar tasiyordu --- */
  .site-header { gap: 10px; padding: 0 14px; height: 58px; }
  .wordmark { font-size: 16.5px; }
  .site-header .logo svg { width: 26px; height: 26px; }
  .auth { gap: 6px; }
  .auth .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .auth .btn-ghost { display: none; }        /* dar ekranda tek eylem yeter */

  /* --- arama kutusu --- */
  .searchbox { height: 52px; padding: 0 6px 0 14px; gap: 8px; }
  .searchbox input { font-size: 16px; }      /* iOS 16px altinda otomatik yakinlastiriyor */
  .searchbox-compact { height: 46px; }
  .btn-search { padding: 0 15px; font-size: 14px; }
  .searchbox-compact .btn-search { height: 34px; padding: 0 13px; }

  /* --- sonuc satiri: gorsel kucul, metin nefes alsin --- */
  .result-row { gap: 11px; }
  .result-shot { width: 86px; height: 65px; border-radius: 8px; }
  .result-title { font-size: 17px; line-height: 1.3; }
  .result-snippet { font-size: 14px; }

  /* uzun adresler tasiyordu: kirilabilir olmali */
  .result-url { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .result-site { flex-wrap: wrap; row-gap: 3px; }

  /* --- kartlar --- */
  .about-card { padding: 14px 16px; border-radius: 12px; }
  .about-card p { font-size: 15px; }
  .stored-note { padding: 10px 13px; font-size: 13px; }

  /* --- yakin sorgu onerisi: yatay siralama dar ekrana sigmiyor --- */
  .suggest-item { flex-wrap: wrap; row-gap: 6px; padding: 12px 14px; }
  .suggest-item .q { flex: 1 1 100%; font-size: 15px; }
  .btn-anyway { width: 100%; }
  .suggest-actions { flex-wrap: wrap; }
  .suggest-actions .hint { flex: 1 1 100%; }

  /* --- alternatif motorlar --- */
  .ext-link { padding: 8px 13px; font-size: 13px; }

  /* --- alt bilgi: tek satira sigmiyordu --- */
  .site-footer { flex-wrap: wrap; gap: 8px 14px; padding: 16px 14px; font-size: 12.5px; }
  .site-footer .spacer { display: none; }
  .engine-meta { gap: 5px 12px; font-size: 11.5px; }
  .engine-disclaimer { font-size: 12px; padding-left: 4px; padding-right: 4px; }

  /* --- durum seridi --- */
  .engine-status { flex-wrap: wrap; row-gap: 6px; font-size: 12.5px; }
  .engine-bar { max-width: 100%; flex: 1 1 100%; }

  /* --- oneri paneli --- */
  .panel { max-height: 60vh; overflow-y: auto; }
}

/* cok dar ekranlar */
@media (max-width: 400px) {
  .result-row { gap: 9px; }
  .result-shot { width: 72px; height: 54px; }
  .result-title { font-size: 16px; }
  .wordmark { font-size: 15px; }
}

/* ==========================================================================
   YASAL MODAL
   ========================================================================== */
body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 42, 91, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: se-fade .15s ease;
}
.modal-backdrop[hidden] { display: none !important; }
@keyframes se-fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 720px; max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(11, 42, 91, .28);
  animation: se-rise .2s ease;
}
@keyframes se-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.modal-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 24px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--navy); flex: 1; }
.modal-close {
  border: 0; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px;
}
.modal-close:hover { background: var(--tint-soft); color: var(--ink); }

.modal-body { padding: 20px 24px; overflow-y: auto; color: var(--text); font-size: 14.5px; line-height: 1.7; }
.modal-body h3 { margin: 22px 0 8px; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 12px; }
.modal-body ul, .modal-body ol { margin: 0 0 12px; padding-left: 22px; }
.modal-body li { margin-bottom: 6px; }
.modal-body code {
  background: var(--tint-soft); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 13px;
}
.modal-body a { color: var(--blue-link); }
.legal-date { color: var(--muted); font-size: 13px; }

.legal-table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13.5px; }
.legal-table th, .legal-table td {
  border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.legal-table th { background: var(--tint-soft); font-weight: 700; color: var(--ink); }

.modal-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; border-top: 1px solid var(--line);
}
.modal-note { flex: 1; font-size: 12.5px; color: var(--muted); }

/* ==========================================================================
   /status SAYFASI
   ========================================================================== */
.status-page { max-width: 980px; }
.status-title { margin: 6px 0 4px; font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.status-sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.status-h2 { margin: 34px 0 12px; font-size: 17px; font-weight: 800; color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-tile {
  border: 1px solid var(--line); border-radius: 14px; background: var(--tint-soft);
  padding: 16px 18px;
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; line-height: 1.15; }
.stat-label { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.stat-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }

.status-queue {
  margin-top: 18px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-size: 13.5px; color: var(--text);
}
.status-queue b { color: var(--ink); }

.status-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.status-table th, .status-table td { border-bottom: 1px solid var(--line-soft); padding: 9px 10px; text-align: left; }
.status-table th { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.status-table td.num, .status-table th.num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.status-table a { color: var(--blue-link); font-weight: 600; }
.status-table tr:hover td { background: var(--tint-soft); }

@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-head { padding: 16px 18px 12px; }
  .modal-body { padding: 16px 18px; font-size: 14px; }
  .modal-foot { padding: 12px 18px; }
  .legal-table { font-size: 12.5px; }
  .legal-table th, .legal-table td { padding: 6px 7px; }
  .status-title { font-size: 24px; }
  .stat-value { font-size: 22px; }
  .status-table { font-size: 13px; }
  .status-table th, .status-table td { padding: 8px 6px; }
}
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr; } }

/* Sunucu tarafinda basilan sonuc sayfasinin H1'i.
   Ekranda yer kaplamamali ama arama motorlari icin sayfada bulunmali. */
.ssr-h1 {
  font-size: 15px; font-weight: 700; color: var(--muted-2);
  margin: 0 0 14px; letter-spacing: -.2px;
}

/* Footer'daki uzun etiketler dar ekranda tasiyordu */
.site-footer span { max-width: 100%; overflow-wrap: anywhere; }
