/* ============================================================
   İlkay & Berkay — Nişan Galerisi
   Tema: fildişi zemin, mürekkep grisi, kurdele kırmızısı, altın
   ============================================================ */

:root {
  --ivory: #fbf8f3;
  --paper: #ffffff;
  --ink: #2a2430;
  --ink-soft: #6f6678;
  --ribbon: #b3264a;
  --ribbon-deep: #8e1c3b;
  --blush: #f4dee4;
  --gold: #c4a24c;
  --line: #e9e2d8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(42, 36, 48, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--ink);
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 16px; }

/* ---------- Üst başlık ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 14px 16px 12px;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: 0.01em;
}

.site-title .amp { color: var(--ribbon); font-style: italic; }

.site-sub {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* kurdele çizgisi */
.ribbon-line {
  width: 88px;
  height: 3px;
  margin: 8px auto 0;
  background: linear-gradient(90deg, transparent, var(--ribbon) 22%, var(--ribbon) 78%, transparent);
  border-radius: 2px;
  position: relative;
}
.ribbon-line::after {
  content: "❤";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  font-size: 11px;
  color: var(--ribbon);
  background: var(--ivory);
  padding: 0 6px;
}

.greet-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 8px 16px 0;
}
.greet-bar strong { color: var(--ink); font-weight: 600; }
.greet-bar .pill {
  background: var(--blush);
  color: var(--ribbon-deep);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  max-width: 1020px;
  margin: 10px auto 60px;
}

@media (min-width: 700px) {
  .grid { gap: 10px; padding: 0 10px; }
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--blush);
  cursor: pointer;
}

@media (min-width: 700px) { .cell { border-radius: 10px; } }

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

@media (hover: hover) {
  .cell:hover img { transform: scale(1.04); }
}

.cell .badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(42, 36, 48, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 8px;
  pointer-events: none;
}
.cell .badge.mine { background: var(--ribbon); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 16, 24, 0.96);
  display: none;
  flex-direction: column;
}
.lightbox.open { display: flex; }

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #f3edf5;
  font-size: 14px;
}
.lb-top .lb-count { color: #b9aec2; font-variant-numeric: tabular-nums; }
.lb-close { font-size: 26px; line-height: 1; color: #f3edf5; padding: 4px 8px; }

.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(251, 248, 243, 0.14);
  color: #fff;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
@media (min-width: 700px) { .lb-nav { display: flex; } }

/* çift dokunuş kalp patlaması */
.burst-heart {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  font-size: 96px;
  color: var(--ribbon);
  text-shadow: 0 6px 30px rgba(179, 38, 74, 0.55);
  opacity: 0;
  pointer-events: none;
}
.burst-heart.go { animation: burst 0.9s ease forwards; }
@keyframes burst {
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  30% { transform: translate(-50%, -50%) scale(0.95); }
  45% { transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}

/* alt eylem çubuğu */
.lb-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  color: #f3edf5;
}

.btn-like {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #f3edf5;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243, 237, 245, 0.28);
  transition: all 0.2s ease;
}
.btn-like .hrt { font-size: 18px; transition: transform 0.2s ease; }
.btn-like.liked {
  background: var(--ribbon);
  border-color: var(--ribbon);
  color: #fff;
}
.btn-like.liked .hrt { transform: scale(1.15); }

.btn-dl, .btn-cmt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: #cfc4d6;
  padding: 8px 10px;
}
.btn-dl:hover, .btn-cmt:hover { color: #fff; }

.like-names {
  padding: 0 18px 8px;
  font-size: 13px;
  color: #b9aec2;
}
.like-names strong { color: #f3edf5; font-weight: 600; }

/* yorum paneli */
.lb-comments {
  background: var(--ivory);
  border-radius: 18px 18px 0 0;
  max-height: 46vh;
  display: none;
  flex-direction: column;
}
.lb-comments.open { display: flex; }

.cmt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 8px;
  font-family: var(--font-display);
  font-size: 17px;
}
.cmt-head button { color: var(--ink-soft); font-size: 20px; }

.cmt-list {
  overflow-y: auto;
  padding: 4px 18px;
  flex: 1;
}
.cmt-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmt-item:last-child { border-bottom: none; }
.cmt-item .who { font-weight: 700; margin-right: 6px; }
.cmt-item .when { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.cmt-empty { padding: 18px 0; text-align: center; color: var(--ink-soft); font-size: 14px; }

.cmt-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.cmt-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--paper);
  outline: none;
}
.cmt-form input:focus { border-color: var(--ribbon); }
.cmt-form button {
  background: var(--ribbon);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
}
.cmt-form button:disabled { opacity: 0.5; cursor: default; }

/* ---------- Modallar (isim + tanıtım) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(42, 36, 48, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.open { display: flex; }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 26px;
  text-align: center;
  border-top: 4px solid var(--ribbon);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  margin-bottom: 6px;
}
.card .date {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 18px; }

.card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--ivory);
  outline: none;
}
.card input:focus { border-color: var(--ribbon); }

.btn-primary {
  width: 100%;
  background: var(--ribbon);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  padding: 13px;
  transition: background 0.2s ease;
}
.btn-primary:hover { background: var(--ribbon-deep); }

/* tanıtım (onboarding) adımları */
.tour-emoji { font-size: 40px; margin-bottom: 10px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 14px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--ribbon); }

/* ---------- Bildirim (toast) ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 20px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 90;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1020px; margin: 0 auto; padding: 16px; }

.tabs { display: flex; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.panel { display: none; }
.panel.on { display: block; }

.stat-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stat {
  flex: 1;
  min-width: 130px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat .num { font-family: var(--font-display); font-size: 28px; color: var(--ribbon); }
.stat .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  animation: slideIn 0.35s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.feed-item img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.feed-item .t { flex: 1; }
.feed-item .when { font-size: 11.5px; color: var(--ink-soft); }
.feed-item.unlike { opacity: 0.65; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.rank-item img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.rank-item .cnt {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ribbon);
  min-width: 46px;
  text-align: center;
}
.rank-item .names { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.cmt-admin {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cmt-admin img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.cmt-admin .t { flex: 1; }
.btn-del {
  background: #fbeaea;
  color: #a12626;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}
.btn-del:hover { background: #f5d5d5; }

.btn-csv {
  background: var(--gold);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.empty-note { text-align: center; color: var(--ink-soft); padding: 30px 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
