/* =========================
   RENK TOKENLARI (Material3 tarzı)
   Tüm renkler burada tek noktadan yönetilir.
========================= */

:root {
  --surface-container-low:     #f7f9fc;
  --surface-dim:                #e4e8ef;
  --secondary-fixed:            #d8e3fb;
  --secondary:                  #6b7690;
  --on-tertiary-container:      #4a2e1b;
  --on-primary-container:       #ffffff;
  --surface-container-high:     #eaeef6;
  --surface-container:          #f1f4f9;
  --surface-container-lowest:   #ffffff;
  --on-secondary:                #ffffff;
  --on-error:                   #ffffff;
  --primary-container:          #2563eb;
  --secondary-container:        #e3e8f2;
  --on-background:              #1a2333;
  --background:                 #f6f8fc;
  --surface-container-highest:  #e3e8f2;
  --surface-tint:               #2f5fde;
  --primary-fixed-dim:          #b4c5ff;
  --secondary-fixed-dim:        #bcc7de;
  --on-secondary-fixed:         #111c2d;
  --on-primary:                 #ffffff;
  --outline:                    #c7ced4;
  --on-surface:                 #1a2333;
  --on-surface-variant:         #5b6479;
  --on-primary-fixed:           #00174b;
  --primary-fixed:              #dbe1ff;
  --surface:                    #ffffff;
  --primary:                    #2f5fde;
  --surface-variant:            #e6eaf2;
  --on-secondary-container:     #1a2333;
  --outline-variant:            #e3e8f0;
  --inverse-on-surface:         #ffffff;
  --surface-bright:             #ffffff;

  /* Fontlar */
  --font-display: 'Space Grotesk', sans-serif;   /* eski: Syne */
  --font-body:    'Manrope', sans-serif;         /* eski: DM Sans — alternatif: 'Inter' */
  --font-mono:    'DM Mono', monospace;          /* etiket/badge/kod metinleri (blog, kelimeler) */
  --font-serif:   'Lora', Georgia, serif;        /* uzun okuma metni (blog yazı gövdesi) */

  /* Ana vurgu — hover durumu */
  --primary-hover: #2450be;
}

/* =========================
   RGB TRIPLET'LER
   rgba(var(--x-rgb), alpha) ile saydam tonlar üretmek için.
   Yukarıdaki HEX değerleriyle birebir eşleşir — renk değişirse
   burayı da güncelle.
========================= */
:root {
  --on-surface-rgb:         26,35,51;
  --on-surface-variant-rgb: 91,100,121;
  --primary-rgb:            47,95,222;
  --primary-fixed-dim-rgb:  180,197,255;
  --primary-fixed-rgb:      219,225,255;
  --primary-container-rgb:  37,99,235;
  --outline-rgb:            199,206,212;
  --danger-rgb:             240,112,104;
  --success-rgb:            34,197,94;
  --warning-rgb:            255,210,80;
  --accent-blue-rgb:        29,111,224;
  --marker-blue-rgb:        96,200,240;
  --marker-purple-rgb:      167,139,250;
  --gender-der-rgb:         74,144,217;
  --gender-die-rgb:         217,107,138;
  --gender-das-rgb:         107,191,138;
}

/* =========================
   SEMANTIC TOKENS
   Bunlar site temasından (yukarıdaki paletten) BAĞIMSIZDIR.
   Tema rengini değiştirsen bile bunlar sabit kalmalı, çünkü
   kullanıcıya durum/kategori anlamı taşıyorlar.
========================= */
:root {
  /* Durum bildirimleri (toast, hata mesajı, uyarı, başarı) */
  --danger:   #f07068;
  --success:  #22c55e;
  --warning:  #ffd250;

  /* İkincil vurgu mavisi — ana --primary'den kasıtlı olarak farklı,
     linkler/rozetler gibi ikincil öğelerde kullanılır (dersler sayfası) */
  --accent-blue: #1d6fe0;

  /* Der/Die/Das dilbilgisi renk kodu (artikel bulucu) */
  --gender-der: #4a90d9;
  --gender-die: #d96b8a;
  --gender-das: #6bbf8a;

  /* Fiil çekim zamanı kategori işaretleri (fiil sayfası) */
  --marker-blue:   #60c8f0;
  --marker-purple: #a78bfa;
  --marker-gold:   #c9a84c;

  /* Prose içi link rengi */
  --link: #1e56d6;
}

/* =========================
   BASE RESET
   (Tüm sayfalarda geçerli — sayfa CSS'lerinde tekrar yazmaya gerek yok)
========================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--background);
  color: var(--on-background);
  min-height: 100vh;
}

/* =========================
   NAVBAR
========================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');
/* Body fontu olarak Manrope yerine Inter tercih edilirse alttaki satırı da ekleyip
   --font-body değerini 'Inter', sans-serif olarak değiştir:
   @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 44px;
  height: 62px;

  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(26,35,51,0.06);
  box-shadow:
    0 1px 0 0 rgba(47,95,222,0.08),
    0 4px 24px rgba(0,0,0,0.35);

  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ── Logo ── */
.logo {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-primary-container);
  position: relative;
  user-select: none;
  flex-shrink: 0;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 2px;
  opacity: 0.7;
}

/* ── Nav Right ── */
.navbar > div:last-child {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Anamenü Button ── */
.home-btn {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid rgba(26,35,51,0.1);
  border-radius: 8px;
  cursor: pointer;

  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
  letter-spacing: 0.01em;

  white-space: nowrap;
  transition: all 0.2s ease;

  /* Minimum dokunma hedefi */
  min-height: 36px;
  min-width: 44px;
}

.home-btn:hover {
  background: rgba(26,35,51,0.07);
  border-color: rgba(26,35,51,0.2);
  color: var(--on-primary-container);
  transform: translateY(-1px);
}

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

/* ── Tag chips ── */
.tag-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(26,35,51,0.1);
  background: rgba(26,35,51,0.04);
  color: var(--secondary);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.tag-chip:hover {
  border-color: rgba(47,95,222,0.5);
  color: var(--primary);
  background: rgba(47,95,222,0.06);
}

.tag-chip.selected {
  background: rgba(47,95,222,0.15);
  border-color: rgba(47,95,222,0.5);
  color: var(--primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   NAVBAR — RESPONSIVE
══════════════════════════════════════════════ */

/* ── Tablet (≤768px) ── */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
    height: 56px;
  }

  .logo {
    font-size: 15px;
  }

  .home-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ── Mobil (≤480px) ── */
@media (max-width: 480px) {
  .navbar {
    padding: 0 14px;
    height: 52px;
  }

  .logo {
    font-size: 14px;
  }

  .home-btn .home-btn-label {
    display: none;
  }

  .home-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .profile-avatar-img {
    width: 30px !important;
    height: 30px !important;
  }
}

/* ════════════════════════════════════════════════
   FAB (Floating Action Button) — RADYAL MENÜ
════════════════════════════════════════════════ */

/* ══ Ana Konteynır ══ */
.fab-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  width: 56px;
  height: 56px;
  --radius: 110px;
  /* Kendi stacking context'ini oluştur — transform'lar dışarıya taşmasın */
  isolation: isolate;
}

/* ── Ana Buton ──
   position: absolute + en yüksek z-index ile fab-item'ların
   DAIMA üstünde kalır; transform animasyonları butonun
   üstüne çıkamaz.                                         */
.fab-main {
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-fixed));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  border: none;
  /* fab-item z-index: 1 → fab-main z-index: 10 → her zaman üstte */
  z-index: 10;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fab-wrapper.active .fab-main {
  transform: rotate(135deg);
  background: var(--primary-container);
}

/* ── FAB Item (her alt buton) ── */
.fab-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  pointer-events: none;
  /* fab-main'in altında kalır */
  z-index: 1;
}

.fab-wrapper.active .fab-item {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── İçerik Katmanı (yuvarlak ikon) ── */
.fab-item-content {
  width: 48px;
  height: 48px;
  background: var(--surface-container-high);
  border: 1px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background 0.2s ease;
  transform: translate(0, 0) scale(0.3);
  position: relative;
}

/* ── Açık hâlde radyal konumlandırma ── */
.fab-wrapper.active .fab-item .fab-item-content {
  transform:
    rotate(calc(var(--angle) * 1deg))
    translate(var(--radius))
    rotate(calc(var(--angle) * -1deg))
    scale(1);
}

/* ── Hover (yalnızca masaüstü) ── */
@media (hover: hover) {
  .fab-item:hover .fab-item-content {
    background: var(--primary);
    color: var(--on-primary);
    transform:
      rotate(calc(var(--angle) * 1deg))
      translate(var(--radius))
      rotate(calc(var(--angle) * -1deg))
      scale(1.1) !important;
  }
}

/* ── Açılarda geçikme (stagger) ── */
.item-1 { --angle: -90;  transition-delay: 0.00s; }
.item-2 { --angle: -125; transition-delay: 0.05s; }
.item-3 { --angle: -155; transition-delay: 0.10s; }
.item-4 { --angle: -190; transition-delay: 0.15s; }

/* ════════════════════════
   FAB — ETİKETLER
════════════════════════ */

.fab-label {
  position: absolute;
  background: var(--primary);
  color: var(--on-primary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 2020;
  font-family: var(--font-display);

  /* Varsayılan konum: üst */
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
}

/* Ok işareti — üste bakan (item-1, 2, 3) */
.fab-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
}

/* item-2: üst-sol köşe */
.item-2 .fab-label {
  left: 20%;
  transform: translateX(-80%);
}

/* item-3: sol çapraz */
.item-3 .fab-label {
  left: 0%;
  transform: translateX(-105%) translateY(15px);
}

/* item-4: tam sol ─ ok sağa baksın */
.item-4 .fab-label {
  bottom: 50% !important;
  right: calc(100% + 12px);
  left: auto;
  transform: translateY(50%);
}
.item-4 .fab-label::after {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-color: transparent transparent transparent var(--primary);
}

/* Masaüstü hover'da etiket belir */
@media (hover: hover) {
  .fab-item:hover .fab-label {
    opacity: 1;
  }
}

/* ════════════════════════════════════════════════
   FAB — MOBİL / DOKUNMATIK (hover desteklenmiyor)
   Masaüstü davranışına dokunulmaz; sadece touch
   cihazlarda geçerli.
════════════════════════════════════════════════ */

@media (hover: none) {
  /* Açık olduğunda tüm etiketler görünsün */
  .fab-wrapper.active .fab-item .fab-label {
    opacity: 1;
  }

  /* item-4 etiketi ekran soluna taşmayabilir;
     küçük ekranda açıyı biraz kıs */
  .item-4 { --angle: -180; }

  /* item-3 etiketini biraz sağa kaydır — sol kenar overflow önlemi */
  .item-3 .fab-label {
    transform: translateX(-90%) translateY(15px);
  }

  /* İkon büyütme efekti (dokunuş geri bildirimi) */
  .fab-item:active .fab-item-content {
    background: var(--primary);
    color: var(--on-primary);
    transform:
      rotate(calc(var(--angle) * 1deg))
      translate(var(--radius))
      rotate(calc(var(--angle) * -1deg))
      scale(1.12) !important;
  }
}

/* ── Küçük telefon radius ayarı ── */
@media (max-width: 480px) {
  .fab-wrapper {
    --radius: 100px;
    bottom: 24px;
    right: 20px;
  }
  .fab-item-content {
    width: 44px;
    height: 44px;
  }
  .fab-main {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}