/*
  Ortak arayüz bileşenleri (bütün sayfalar): kart hareketleri, belirme efekti, iskelet yükleme, istatistik kartları,
  site listeleri, segmentli seçici, popup (modal), doğrulama rozeti, şirket yanıtı, boş durumlar, bildirimler.
*/

/* ---------- Kart hareketleri ---------- */
.card,
.lift {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* Yalnızca tıklanabilir ve vitrin kartları yükselir (form ve panel kartları sabit kalır) */
@media (hover: hover) {
  a.card:hover,
  .card-grid > .card:hover,
  .lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--line);
  }
}

/* Cam efektli kart */
.glass {
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}

/* ---------- Kaydırınca belirme (effects.js ekler) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(n+6) { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* ---------- İskelet yükleme ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s var(--ease) infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.skeleton-line {
  height: 12px;
  margin: 8px 0;
}

.skeleton-line--short { width: 45%; }
.skeleton-line--mid { width: 70%; }

/* Döner yükleme göstergesi */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- İstatistik kartları ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand-glow), transparent);
}

.stat-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand);
}

.stat-card__value {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  color: var(--text-2);
  font-size: 14.5px;
}

@media (max-width: 860px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Site listeleri (popüler, son incelenen, geçmiş) ---------- */
.site-list {
  display: grid;
  gap: 10px;
}

.site-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

a.site-row:hover,
a.site-row:focus-visible {
  transform: translateX(3px);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

.site-row__rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.site-row__main {
  min-width: 0;
}

.site-row__domain,
.site-row__meta {
  display: block;
}

.site-row__domain {
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row__meta {
  color: var(--text-3);
  font-size: 13px;
}

.site-row__side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 52px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--status-unknown-bg);
  color: var(--status-unknown-text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-pill small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.score-pill--low { background: var(--status-low-bg); color: var(--status-low-text); }
.score-pill--caution { background: var(--status-caution-bg); color: var(--status-caution-text); }
.score-pill--high { background: var(--status-high-bg); color: var(--status-high-text); }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Segmentli seçici (Günlük / Haftalık) ---------- */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.segmented button {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.segmented--block {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
}

.segmented--block button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
}

.segmented--block .icon {
  width: 17px;
  height: 17px;
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ---------- Panel kartı (başlık + içerik) ---------- */
.panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
}

.panel__title .icon {
  color: var(--brand);
}

.panel__note {
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Boş durum ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  text-align: center;
}

.empty .icon {
  width: 30px;
  height: 30px;
  color: var(--text-3);
}

.empty__title {
  color: var(--text);
  font-weight: 650;
}

.empty__text {
  max-width: 420px;
  font-size: 14.5px;
}

/* ---------- Popup (modal) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #06110C 55%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade-in var(--dur) var(--ease);
}

.modal__dialog {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  animation: modal-in 0.42s var(--ease);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--brand-tint);
  color: var(--brand);
}

.modal__title {
  padding-right: 32px;
  font-size: 22px;
}

.modal__text {
  color: var(--text-2);
  font-size: 15.5px;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .modal {
    align-items: end;
    padding: 0;
  }

  .modal__dialog {
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  }

  .modal__actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Doğrulanmış kurumsal hesap rozeti ---------- */
.verified-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-tint), var(--brand-tint));
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: help;
}

.verified-badge .icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

/* Açıklama baloncuğu (fareyle veya klavyeyle odaklanınca) */
.verified-badge__tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(300px, 80vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-raised);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.verified-badge:hover .verified-badge__tip,
.verified-badge:focus-visible .verified-badge__tip {
  opacity: 1;
  transform: none;
}

/* ---------- Şirket yanıtı ---------- */
.company-reply {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 16px 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-tint) 70%, var(--surface)), var(--surface));
}

.company-reply::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.company-reply__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.company-reply__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.company-reply__name {
  font-weight: 650;
}

.company-reply__date {
  color: var(--text-3);
  font-size: 12.5px;
}

.company-reply__text {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Yıldızlar ---------- */
.stars {
  display: inline-flex;
  gap: 2px;
  color: #E3A63B;
  letter-spacing: 1px;
}

.stars--muted {
  color: var(--line-strong);
}

/* ---------- Bildirim (toast) çeşitleri ---------- */
.toast--ok { background: var(--status-low-text); color: var(--surface); }
.toast--error { background: var(--status-high-text); color: var(--surface); }

/* ---------- Puan halkası animasyonu ---------- */
@property --score {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.score-ring {
  transition: --score 1.2s var(--ease);
}

/* ---------- Bölüm başlığı satırı ---------- */
.section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* ---------- Bilgi listesi (profil, kurumsal panel, firma profili) ---------- */
.info-list {
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.info-list dt {
  color: var(--text-2);
  font-size: 14.5px;
}

.info-list dd {
  margin: 0;
  font-weight: 540;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .info-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.notice .btn {
  justify-self: start;
  margin-top: 6px;
}
