/**
 * GönülDefteri — yaprak.css  (v11)
 *
 * Tüm Yaprak ekonomisi UI bileşenleri:
 *  - .gd-yaprak-chip         → header bakiye göstergesi
 *  - .gd-kidem-badge         → kıdem rozeti (4 seviye)
 *  - .gd-kidem-progress      → ilerleme çubuğu
 *  - .gd-badge--kurucu       → Kurucu Şair rozeti
 *  - .gd-badge--altin-muhur  → Altın Mühür rozeti
 *  - .gd-ikram-panel         → Yaprak ikram paneli
 *  - .gd-btn-hizlandir       → Hızlandırma butonları
 *  - .gd-vitrin-limit-modal  → Vitrin limit uyarısı
 *  - .gd-yanki-widget        → Yankı widget (profil)
 *  - .gd-btn-follow          → Takip butonu
 *  - .gd-profile-hero        → Profil başlık alanı
 *  - .gd-bekleme-bar         → Bekleme süresi ilerleme
 *  - Dark mode overrideları
 *
 * Renk tokenleri GP Global Styles'dan gelir (--gd-yaprak-green vb.)
 */

/* ═══════════════════════════════════════════════════════
   1. YAPRAK ÇİP (Header Bakiye)
═══════════════════════════════════════════════════════ */

.gd-yaprak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gd-surface, #f0fdf4);
  border: 1px solid var(--gd-yaprak-green, #86efac);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gd-yaprak-dark, #166534);
  line-height: 1;
  cursor: default;
  transition: background .15s;
  white-space: nowrap;
}

.gd-yaprak-chip:hover {
  background: var(--gd-yaprak-green-light, #dcfce7);
}

.gd-yaprak-chip__icon { font-size: 1rem; }

.gd-yaprak-chip__amount {
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}

/* Animasyon: bakiye değişince */
.gd-yaprak-chip--updated {
  animation: gd-chip-pulse .4s ease-out;
}

@keyframes gd-chip-pulse {
  0%   { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════
   2. KIDEMROZETİ
═══════════════════════════════════════════════════════ */

.gd-kidem-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.gd-kidem-badge--yaprak {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.gd-kidem-badge--cilt {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.gd-kidem-badge--defter {
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #c4b5fd;
}

.gd-kidem-badge--muhurlu_defter {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
  box-shadow: 0 1px 4px rgba(251,191,36,.3);
}

/* Kıdem ilerleme çubuğu */
.gd-kidem-progress {
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 6px;
  max-width: 200px;
}

.gd-kidem-progress__fill {
  height: 100%;
  border-radius: 2px;
  transition: width .6s ease;
}

.gd-kidem-progress--yaprak   .gd-kidem-progress__fill { background: #22c55e; }
.gd-kidem-progress--cilt     .gd-kidem-progress__fill { background: #3b82f6; }
.gd-kidem-progress--defter   .gd-kidem-progress__fill { background: #a855f7; }

.gd-kidem-progress-label {
  font-size: .7rem;
  color: #6b7280;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   3. ÖZEL ROZETLEr
═══════════════════════════════════════════════════════ */

.gd-badge--kurucu {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fdf4ff, #fce7f3);
  color: #86198f;
  border: 1px solid #e879f9;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 700;
}

.gd-badge--altin-muhur {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  color: #854d0e;
  border: 1px solid #facc15;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(250,204,21,.25);
}

/* ═══════════════════════════════════════════════════════
   4. YAPRAK İKRAM PANELİ
═══════════════════════════════════════════════════════ */

.gd-ikram-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  width: 260px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  display: none;
  flex-direction: column;
  gap: 12px;
}

.gd-ikram-panel.is-open { display: flex; }

.gd-ikram-panel__title {
  font-size: .9rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.gd-ikram-panel__amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.gd-ikram-btn {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 8px;
  color: #166534;
  font-size: .8rem;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, transform .1s;
}

.gd-ikram-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
  transform: translateY(-1px);
}

.gd-ikram-btn:active { transform: translateY(0); }

.gd-ikram-panel__balance {
  font-size: .78rem;
  color: #6b7280;
  text-align: center;
}

.gd-ikram-panel__feedback {
  font-size: .8rem;
  text-align: center;
  min-height: 1.2em;
}

.gd-ikram-panel__feedback--success { color: #16a34a; }
.gd-ikram-panel__feedback--error   { color: #dc2626; }

.gd-ikram-panel__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #9ca3af;
  line-height: 1;
}

/* Tetikleyici buton (şiir kartı / şiir başlığı yanında) */
.gd-ikram-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid #d1fae5;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .8rem;
  color: #065f46;
  cursor: pointer;
  transition: background .15s;
}

.gd-ikram-trigger:hover { background: #f0fdf4; }

/* ═══════════════════════════════════════════════════════
   5. HIZLANDIRMA BUTONLARI
═══════════════════════════════════════════════════════ */

.gd-btn-hizlandir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  border: none;
}

/* Akış */
.gd-btn-hizlandir--akis {
  background: #eff6ff;
  color: #1d4ed8;
}
.gd-btn-hizlandir--akis:hover { background: #dbeafe; }

/* Vitrin */
.gd-btn-hizlandir--vitrin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}
.gd-btn-hizlandir--vitrin:hover { filter: brightness(1.05); }

/* Disabled (bekleme süresi dolmadı) */
.gd-btn-hizlandir:disabled,
.gd-btn-hizlandir[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.gd-btn-hizlandir:not(:disabled):active { transform: scale(.97); }

/* Vitrin rozeti (aktif şiirde gösterilir) */
.gd-vitrin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fef9c3, #fef3c7);
  color: #b45309;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: .72rem;
  font-weight: 700;
}

/* Bekleme ilerleme çubuğu */
.gd-bekleme-bar {
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.gd-bekleme-bar__fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 60s linear;
}

/* Vitrin limit modal */
.gd-vitrin-limit-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  padding: 1rem;
}

.gd-vitrin-limit-modal__box {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.gd-vitrin-limit-modal__icon { font-size: 2.5rem; margin-bottom: 12px; }
.gd-vitrin-limit-modal__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.gd-vitrin-limit-modal__body  { font-size: .9rem; color: #6b7280; }

/* ═══════════════════════════════════════════════════════
   6. YANKI WİDGET
═══════════════════════════════════════════════════════ */

.gd-yanki-widget {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.gd-yanki-title {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111827;
}

.gd-yanki-week-total { font-size: .85rem; color: #374151; margin: 0 0 12px; }

.gd-yanki-events { list-style: none; padding: 0; margin: 0 0 12px; }

.gd-yanki-event-item {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.yanki-event-total { font-weight: 700; color: #16a34a; }

.yanki-poems-title {
  font-size: .8rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 6px;
}

.gd-yanki-poem-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  padding: 4px 0;
}

.yanki-poem-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1d4ed8;
}

.yanki-poem-age   { color: #9ca3af; font-size: .72rem; white-space: nowrap; }
.yanki-poem-total { font-weight: 700; color: #16a34a; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════
   7. PROFİL HERO
═══════════════════════════════════════════════════════ */

.gd-profile-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f9fafb;
  margin-bottom: 2rem;
}

.gd-profile-hero__cover {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.gd-profile-hero__content {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gd-profile-hero__avatar-wrap {
  margin-top: -40px;
  width: 80px;
  height: 80px;
}

.gd-profile-hero__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.gd-profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gd-profile-hero__name {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  color: #111827;
}

.gd-profile-hero__stats {
  display: flex;
  gap: 24px;
}

.gd-stat { display: flex; flex-direction: column; align-items: center; }
.gd-stat__value { font-size: 1.1rem; font-weight: 700; color: #111827; }
.gd-stat__label { font-size: .72rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════════════════════════════
   8. TAKİP BUTONU
═══════════════════════════════════════════════════════ */

.gd-btn-follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  transition: background .15s, transform .1s;
}

.gd-btn-follow:hover { background: #1e40af; border-color: #1e40af; }

.gd-btn-follow--active {
  background: #fff;
  color: #1d4ed8;
}

.gd-btn-follow--active:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

.gd-btn-follow:active { transform: scale(.97); }

/* ═══════════════════════════════════════════════════════
   9. BİLDİRİM BADGE
═══════════════════════════════════════════════════════ */

.gd-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

.gd-notif-badge--hidden { display: none; }

/* ═══════════════════════════════════════════════════════
   10. FLOAT ANİMASYON (+10 🍃 efekti)
═══════════════════════════════════════════════════════ */

.gd-yaprak-float {
  position: fixed;
  z-index: 99999;
  font-size: 1.1rem;
  font-weight: 700;
  color: #16a34a;
  pointer-events: none;
  animation: gd-float-up 1.4s ease-out forwards;
}

@keyframes gd-float-up {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  80%  { opacity: .6; transform: translateY(-60px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-80px) scale(.9); }
}

/* ═══════════════════════════════════════════════════════
   11. DARK MODE
═══════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  .gd-yaprak-chip {
    background: #052e16;
    border-color: #166534;
    color: #4ade80;
  }

  .gd-kidem-badge--yaprak {
    background: #052e16;
    color: #4ade80;
    border-color: #166534;
  }

  .gd-kidem-badge--cilt {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1e40af;
  }

  .gd-kidem-badge--defter {
    background: #2e1065;
    color: #c4b5fd;
    border-color: #6d28d9;
  }

  .gd-ikram-panel,
  .gd-vitrin-limit-modal__box {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }

  .gd-ikram-btn {
    background: #052e16;
    border-color: #166534;
    color: #4ade80;
  }

  .gd-yanki-widget {
    background: #111827;
    border-color: #374151;
  }

  .gd-profile-hero {
    background: #1f2937;
  }

  .gd-profile-hero__name { color: #f9fafb; }

  .gd-btn-follow {
    background: #1d4ed8;
    border-color: #1d4ed8;
  }
}

/* data-theme="dark" override (JS ile uygulanan) */
[data-gd-theme="dark"] .gd-yaprak-chip {
  background: #052e16;
  border-color: #166534;
  color: #4ade80;
}

[data-gd-theme="dark"] .gd-profile-hero { background: #1f2937; }
[data-gd-theme="dark"] .gd-ikram-panel,
[data-gd-theme="dark"] .gd-vitrin-limit-modal__box {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}
