/* ═══════════════════════════════════════
   Ankahukuk Yorum v1.1 — Stil
   ═══════════════════════════════════════ */

/* ── Kapsayıcı değişkenler ── */
#ay-section {
  --c-bg:      #ffffff;
  --c-bg2:     #f7f8fa;
  --c-border:  #e4e6ea;
  --c-text:    #1a1a2e;
  --c-muted:   #6b7280;
  --c-blue:    #1a3c6e;
  --c-blue2:   #2563eb;
  --c-up:      #16a34a;
  --c-down:    #dc2626;
  --c-rail:    #dde1e7;
  --c-railh:   #2563eb;
  --c-rad:     10px;
  --c-font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  #ay-section {
    --c-bg:     #0e1117;
    --c-bg2:    #181c27;
    --c-border: #2a2f3e;
    --c-text:   #e2e8f0;
    --c-muted:  #8892a4;
    --c-rail:   #2a2f3e;
  }
}

#ay-section {
  font-family: var(--c-font);
  color: var(--c-text);
  margin: 32px 0 48px;
  max-width: 100%;
}

#ay-section * { box-sizing: border-box; }

/* ── Üst çubuk ── */
.ay-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--c-border);
}

.ay-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
  padding: 0;
  border: none;
  line-height: 1.2;
}

/* ── Sıralama ── */
.ay-sortbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ay-sortlabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  margin-right: 4px;
}

.ay-sortbtn {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-muted);
  transition: all .15s;
  font-family: var(--c-font);
  line-height: 1.4;
}
.ay-sortbtn:hover {
  background: var(--c-bg2);
  border-color: var(--c-border);
  color: var(--c-text);
}
.ay-sortbtn.ay-sort--on {
  background: var(--c-blue);
  border-color: var(--c-blue);
  color: #fff;
}

/* ── Giriş CTA ── */
.ay-login-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  border-radius: var(--c-rad);
  font-size: 14px;
  color: var(--c-muted);
  margin-bottom: 24px;
}
.ay-login-cta a {
  color: var(--c-blue2);
  font-weight: 700;
  text-decoration: none;
}
.ay-login-cta a:hover { text-decoration: underline; }

/* ── Ana form ── */
.ay-mf {
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--c-rad);
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color .2s;
}
.ay-mf:focus-within {
  border-color: var(--c-blue2);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ay-mf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 0;
}
.ay-mf-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}
.ay-mf-hint {
  font-size: 11px;
  color: var(--c-muted);
  margin-left: auto;
}
.ay-mf-body { padding: 8px 14px 14px; }
.ay-mf-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* ── Textarea ── */
.ay-ta {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--c-font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.ay-ta:focus {
  background: var(--c-bg);
  border-color: var(--c-blue2);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Karakter sayacı ── */
.ay-cc {
  font-size: 11px;
  color: var(--c-muted);
  margin-right: auto;
  user-select: none;
}
.ay-cc.ay-cc-warn { color: #f59e0b; }
.ay-cc.ay-cc-over { color: var(--c-down); font-weight: 700; }

/* ── Butonlar ── */
.ay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--c-font);
  line-height: 1.4;
  transition: all .15s;
  outline: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.ay-btn svg { pointer-events: none; flex-shrink: 0; }
.ay-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.ay-primary {
  background: var(--c-blue);
  color: #fff;
  border-color: var(--c-blue);
}
.ay-primary:hover { background: #142f57; }

.ay-ghost {
  background: transparent;
  color: var(--c-muted);
  border-color: var(--c-border);
}
.ay-ghost:hover { background: var(--c-bg2); color: var(--c-text); }

.ay-outline {
  background: transparent;
  color: var(--c-blue2);
  border-color: var(--c-blue2);
  padding: 9px 24px;
  font-size: 14px;
}
.ay-outline:hover { background: var(--c-blue2); color: #fff; }

/* ── Avatar ── */
.ay-avatar { border-radius: 50% !important; flex-shrink: 0; display: block; }

/* ── Boş durum ── */
.ay-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--c-muted);
}
.ay-empty svg { opacity: .3; margin-bottom: 14px; }
.ay-empty p   { margin: 0; font-size: 15px; }

/* ── Liste ── */
.ay-list { }

/* ═══════════════════════════════════════
   YORUM KARTI
   ═══════════════════════════════════════ */

.ay-comment {
  margin-top: 4px;
  animation: ayIn .22s ease both;
}

@keyframes ayIn {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:none; }
}

.ay-inner {
  display: flex;
  align-items: stretch;
}

/* ── Rail ── */
.ay-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
  cursor: pointer;
  padding-top: 7px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ay-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--c-rail);
  background: var(--c-bg);
  flex-shrink: 0;
  transition: border-color .15s;
}
.ay-line {
  width: 2px;
  flex: 1;
  background: var(--c-rail);
  margin-top: 4px;
  min-height: 12px;
  border-radius: 2px;
  transition: background .15s;
}
.ay-rail:hover .ay-dot  { border-color: var(--c-railh); }
.ay-rail:hover .ay-line { background: var(--c-railh); }
.ay-rail:focus { outline: 2px solid var(--c-blue2); outline-offset: 2px; border-radius: 4px; }

/* ── Gövde ── */
.ay-body {
  flex: 1;
  padding: 4px 0 10px 10px;
  min-width: 0;
}

/* ── Başlık ── */
.ay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.ay-head-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ay-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ay-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-blue);
}
.ay-time {
  font-size: 12px;
  color: var(--c-muted);
}
.ay-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ay-tag-me   { background: var(--c-blue2); color: #fff; }
.ay-tag-role { background: #f59e0b; color: #fff; }

/* ── İkon buton (sil) ── */
.ay-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--c-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ay-btn-icon:hover { background: #fee2e2; color: var(--c-down); }

/* ── İçerik ── */
.ay-content {
  font-size: 14px;
  line-height: 1.72;
  color: var(--c-text);
  margin-bottom: 8px;
  word-break: break-word;
  overflow: hidden;
  position: relative;
  transition: max-height .3s ease;
}
.ay-content p         { margin: 0 0 8px; }
.ay-content p:last-child { margin-bottom: 0; }

.ay-content.ay-trunc::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: linear-gradient(transparent, var(--c-bg));
  pointer-events: none;
}

.ay-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-blue2);
  background: transparent;
  border: 1px solid var(--c-border);
  cursor: pointer;
  font-family: var(--c-font);
  transition: all .12s;
}
.ay-expand:hover { background: var(--c-bg2); border-color: var(--c-blue2); }
.ay-expand-ico { transition: transform .2s; }
.ay-expand[data-open="1"] .ay-expand-ico { transform: rotate(180deg); }

.ay-del-msg { color: var(--c-muted); font-style: italic; font-size: 13px; margin: 0; }

/* ── Altlık ── */
.ay-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── Oy ── */
.ay-votes {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 2px 3px;
}
.ay-vbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: color .12s, transform .1s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ay-vbtn:hover { transform: scale(1.18); }
.ay-up:hover,  .ay-up.active  { color: var(--c-up); }
.ay-dn:hover,  .ay-dn.active  { color: var(--c-down); }

.ay-score {
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  color: var(--c-muted);
  padding: 0 2px;
  transition: color .15s;
}
.ay-score.pos { color: var(--c-up); }
.ay-score.neg { color: var(--c-down); }

/* ── Aksiyon buton ── */
.ay-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--c-font);
  text-decoration: none;
  transition: background .12s, color .12s;
  line-height: 1.4;
}
.ay-action:hover { background: var(--c-bg2); color: var(--c-text); text-decoration: none; }

/* ── Yanıt formu ── */
.ay-rf { margin: 10px 0 4px; animation: ayIn .16s ease; }
.ay-rf-box {
  border: 1px solid var(--c-border);
  border-radius: var(--c-rad);
  padding: 10px 12px;
  background: var(--c-bg);
  transition: border-color .15s;
}
.ay-rf-box:focus-within { border-color: var(--c-blue2); }
.ay-rf-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ── Alt yorumlar ── */
.ay-children { margin-left: 0; }

/* ── Collapsed ── */
.ay-comment.ay-col .ay-body > .ay-content,
.ay-comment.ay-col .ay-body > .ay-foot,
.ay-comment.ay-col .ay-body > .ay-rf,
.ay-comment.ay-col .ay-body > .ay-children,
.ay-comment.ay-col .ay-body > .ay-expand {
  display: none !important;
}
.ay-col-peek {
  font-size: 12px;
  color: var(--c-muted);
  font-style: italic;
  cursor: pointer;
  padding-bottom: 8px;
  display: block;
}
.ay-col-peek:hover { color: var(--c-blue2); }

/* ── Daha fazla ── */
.ay-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* ── Toast ── */
.ay-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  white-space: nowrap;
  max-width: 90vw;
}
.ay-toast.ay-toast-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Spinner ── */
.ay-spin {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aySpin .55s linear infinite;
  flex-shrink: 0;
}
@keyframes aySpin { to { transform:rotate(360deg); } }

/* ── Responsive ── */
@media (max-width:600px) {
  .ay-topbar   { flex-direction:column; align-items:flex-start; }
  .ay-sortbtn  { padding:4px 9px; font-size:11px; }
  .ay-rail     { width:20px; }
  .ay-mf-hint  { display:none; }
}
@media (max-width:380px) {
  .ay-votes { display:none; }
  .ay-body  { padding-left:6px; }
}

/* ── Misafir alanları ── */
.ay-guest-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 480px) {
  .ay-guest-fields { grid-template-columns: 1fr; }
}

.ay-input-field {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--c-font);
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.ay-input-field:focus {
  border-color: var(--c-blue2);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: var(--c-bg);
}
.ay-input-field::placeholder { color: var(--c-muted); }

/* Misafir formu bilgi notu */
.ay-mf-guest .ay-mf-hint {
  font-size: 11px;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Giriş yap linki yanında */
.ay-login-link {
  font-size: 12px;
  padding: 6px 12px;
}

/* ── Tema çakışmalarına karşı koruma ── */
#ay-section button,
#ay-section .ay-btn,
#ay-section .ay-action,
#ay-section .ay-vbtn,
#ay-section .ay-btn-icon,
#ay-section .ay-sortbtn,
#ay-section .ay-expand {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#ay-section .ay-foot {
  position: relative;
  z-index: 2;
}

#ay-section .ay-rf {
  position: relative;
  z-index: 3;
}
