/* ==========================================================================
   Modern Canlı Çocuk Zaman Tüneli Stilleri (Interactive & Lively Kids UI)
   3D butonlar, altın ışıltılı kartlar, parıldayan yıldızlar ve bol hareket!
   ========================================================================== */

.timeline-main-wrap {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--header-height) - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 16px) 16px 65px;
  z-index: 10;
}

/* ==========================================================================
   Sihirli Yıldız Patlaması (Star Burst Particle Layer)
   ========================================================================== */

.star-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.burst-particle {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
  animation: burstFly 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.9));
}

@keyframes burstFly {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.3) rotate(0deg);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dest-x), var(--dest-y)) scale(var(--dest-scale)) rotate(var(--dest-rot));
    opacity: 0;
  }
}

/* ==========================================================================
   Yıllar Şeridi (Renkli, 3D Sihirli Yıllar Şeridi)
   ========================================================================== */

.year-ribbon-container {
  width: 100%;
  max-width: 980px;
  position: relative;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ribbon-decor {
  font-size: 26px;
  filter: drop-shadow(0 0 10px #f59e0b);
  animation: decorWiggle 3.2s ease-in-out infinite alternate;
  user-select: none;
  flex-shrink: 0;
}

.decor-right {
  animation-delay: 1.6s;
}

@keyframes decorWiggle {
  0% { transform: translateY(0) rotate(-6deg) scale(0.95); }
  100% { transform: translateY(-4px) rotate(8deg) scale(1.12); }
}

.year-ribbon-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(16, 28, 48, 0.88) 0%, rgba(9, 18, 32, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.25), inset 0 0 20px rgba(251, 191, 36, 0.08);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.year-ribbon-scroll::-webkit-scrollbar {
  display: none;
}

/* Yıl Butonları (Canlı Çocuk Hapları) */
.year-pill-btn {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 999px;
  font-family: var(--font-child);
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.09);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  user-select: none;
}

.year-pill-btn:hover {
  background: rgba(245, 158, 11, 0.35);
  color: #fef08a;
  border-color: #f59e0b;
  transform: translateY(-4px) scale(1.14);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

.year-pill-btn:active {
  transform: translateY(-1px) scale(1.05);
}

/* Aktif Yıl Butonu (Güneş Gibi Parlayan 3D Altın Hap) */
.year-pill-btn.active {
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 50%, #d97706 100%);
  color: #451a03;
  border-color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 0 #92400e, 0 0 25px rgba(251, 191, 36, 0.9), 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: scale(1.16) translateY(-2px);
  animation: activePillBounce 2.4s ease-in-out infinite alternate;
}

@keyframes activePillBounce {
  0% {
    box-shadow: 0 4px 0 #92400e, 0 0 20px rgba(251, 191, 36, 0.8);
    transform: scale(1.16) translateY(-2px);
  }
  100% {
    box-shadow: 0 4px 0 #92400e, 0 0 35px rgba(253, 224, 71, 1);
    transform: scale(1.22) translateY(-4px);
  }
}

/* ==========================================================================
   Hikaye Kartı (Sihirli Altın Işıltılı Canlı Çocuk Kartı)
   ========================================================================== */

.story-card-viewport {
  width: 100%;
  max-width: 980px;
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.story-card {
  position: relative;
  width: 100%;
  min-height: 420px;
  background: radial-gradient(circle at 25% 35%, rgba(30, 42, 80, 0.92) 0%, rgba(13, 22, 38, 0.96) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2.5px solid rgba(251, 191, 36, 0.65);
  border-radius: 32px;
  box-shadow: 0 28px 70px -10px rgba(0, 0, 0, 0.75), 0 0 45px rgba(245, 158, 11, 0.3), inset 0 0 35px rgba(245, 158, 11, 0.08);
  display: grid;
  grid-template-columns: 340px 1fr;
  align-items: center;
  gap: 36px;
  padding: 38px 46px;
  overflow: visible;
  animation: cardFloating 5.5s ease-in-out infinite alternate;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Kartın yumuşak canlı süzülme animasyonu */
@keyframes cardFloating {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* Kart Köşe Yıldızları */
.card-corner-sparkle {
  position: absolute;
  font-size: 20px;
  pointer-events: none;
  filter: drop-shadow(0 0 8px #f59e0b);
  animation: sparkleTwinkle 2.8s ease-in-out infinite alternate;
  user-select: none;
  z-index: 5;
}

.sparkle-tl { top: -12px; left: -10px; animation-delay: 0s; }
.sparkle-tr { top: -12px; right: -10px; animation-delay: 1.4s; }
.sparkle-bl { bottom: -12px; left: -10px; animation-delay: 0.7s; }
.sparkle-br { bottom: -12px; right: -10px; animation-delay: 2.1s; }

@keyframes sparkleTwinkle {
  0% { transform: scale(0.85) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.3) rotate(25deg); opacity: 1; filter: drop-shadow(0 0 14px #fde047); }
  100% { transform: scale(0.95) rotate(-15deg); opacity: 0.8; }
}

/* Kart Pop / Yaylı Geçiş Animasyonları */
.story-card.anim-pop-out {
  opacity: 0;
  transform: scale(0.94) translateY(6px);
  transition: all 0.15s ease-in;
}

.story-card.anim-pop-in {
  animation: cardPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardPopIn {
  0% { opacity: 0; transform: scale(0.94) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   Görsel Alanı (Parlayan Sihirli Resim Portalı)
   ========================================================================== */

.story-image-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.story-image-frame {
  position: relative;
  width: 100%;
  max-width: 290px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 3px solid #f59e0b;
  border-radius: 28px;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.35), inset 0 0 25px rgba(251, 191, 36, 0.2), 0 14px 28px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.story-image-frame:hover {
  border-color: #fde047;
  transform: scale(1.05) rotate(1deg);
  box-shadow: 0 0 45px rgba(253, 224, 71, 0.6), inset 0 0 30px rgba(251, 191, 36, 0.35), 0 18px 36px rgba(0, 0, 0, 0.6);
}

/* Çerçeve Üzerinden Akan Işık Efekti (Shimmer Sweep) */
.image-shimmer-sweep {
  position: absolute;
  top: -50%;
  left: -120%;
  width: 80%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transform: rotate(30deg);
  animation: shimmerPass 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmerPass {
  0% { left: -120%; }
  35% { left: 160%; }
  100% { left: 160%; }
}

/* Çerçeve Köşe Yıldız Rozeti */
.frame-star-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 18px;
  filter: drop-shadow(0 0 6px #f59e0b);
  animation: badgeTwirl 4s ease-in-out infinite;
  user-select: none;
}

@keyframes badgeTwirl {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
}

/* İllüstrasyon Görseli (Hafif Havada Süzülüş) */
.story-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65));
  animation: illustrationBob 3.8s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes illustrationBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-7px); }
}

.story-image-frame:hover .story-image {
  transform: scale(1.12) rotate(2deg);
}

/* Resim Zıplama Efekti (Olay Değiştiğinde) */
.story-image.img-bounce {
  animation: imgBouncePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes imgBouncePop {
  0% { transform: scale(0.8); opacity: 0.5; }
  65% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Metin ve Başlık Alanı (Canlı Tipografi & Rozetler)
   ========================================================================== */

.story-content-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.story-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-year-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.year-sparkle {
  font-size: 24px;
  animation: sparkleRotate 3s linear infinite;
  filter: drop-shadow(0 0 6px #f59e0b);
}

@keyframes sparkleRotate {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(0.9); }
}

/* 3D Kabartmalı Altın Yıl Başlığı */
.story-year-badge {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #fffbeb 0%, #fde047 30%, #f59e0b 65%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #78350f) drop-shadow(0 6px 14px rgba(245, 158, 11, 0.5));
  letter-spacing: 1px;
}

/* Parlak Sayaç Rozeti (⭐ 1 / 60) */
.story-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #ffffff;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  direction: ltr !important;
  unicode-bidi: isolate;
}

.counter-star {
  font-size: 16px;
  animation: starPulse 2s ease-in-out infinite alternate;
}

@keyframes starPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.25); }
}

/* Sevimli Yıldızlı Ayırıcı Çizgi */
.story-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 2px 0 4px;
}

.divider-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.6) 0%, rgba(251, 191, 36, 0.1) 100%);
  border-radius: 2px;
}

.story-divider .divider-line:last-child {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.6) 100%);
}

.divider-icon {
  color: #fde047;
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.8));
}

/* Hikaye Metni (Okunabilir, Sıcak ve Sevimli) */
.story-text {
  font-family: var(--font-story);
  font-size: 25px;
  line-height: 1.65;
  color: #fffdf5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  min-height: 100px;
}

/* ==========================================================================
   Navigation Row (3D Oyun Tarzı Canlı Butonlar)
   ========================================================================== */

.timeline-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 980px;
  margin-top: 24px;
  gap: 16px;
}

/* Ortak 3D Buton Stili */
.timeline-nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 30px;
  border-radius: 999px;
  font-family: var(--font-child);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* SONRAKİ Butonu (Canlı Zümrüt Yeşili 3D Oyun Butonu) */
.btn-next {
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  border: 2px solid #a7f3d0;
  color: #ffffff;
  box-shadow: 0 6px 0 #047857, 0 12px 25px rgba(16, 185, 129, 0.5);
  animation: nextBtnPulse 2.6s ease-in-out infinite;
}

.btn-next:hover:not(:disabled) {
  background: linear-gradient(180deg, #6ee7b7 0%, #34d399 50%, #10b981 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #047857, 0 16px 30px rgba(16, 185, 129, 0.65);
}

.btn-next:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #047857, 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

@keyframes nextBtnPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 0 #047857, 0 12px 25px rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 9px 0 #047857, 0 18px 35px rgba(16, 185, 129, 0.7);
  }
}

/* ÖNCEKİ Butonu (Canlı Gök Mavisi 3D Oyun Butonu) */
.btn-prev {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  border: 2px solid #bfdbfe;
  color: #ffffff;
  box-shadow: 0 6px 0 #1d4ed8, 0 12px 25px rgba(59, 130, 246, 0.45);
}

.btn-prev:hover:not(:disabled) {
  background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #1d4ed8, 0 16px 30px rgba(59, 130, 246, 0.6);
}

.btn-prev:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1d4ed8, 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

/* Pasif (Disabled) Buton */
.timeline-nav-btn:disabled {
  opacity: 0.35;
  filter: grayscale(0.85);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: 0 4px 0 #334155;
  transform: none !important;
  animation: none !important;
}

/* Buton Ok İkonu Animasyonları */
.nav-arrow {
  font-size: 16px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn-next .nav-arrow-right {
  animation: arrowRightBounce 1.2s ease-in-out infinite alternate;
}

.btn-prev .nav-arrow-left {
  animation: arrowLeftBounce 1.2s ease-in-out infinite alternate;
}

@keyframes arrowRightBounce {
  0% { transform: translateX(0); }
  100% { transform: translateX(4px); }
}

@keyframes arrowLeftBounce {
  0% { transform: translateX(0); }
  100% { transform: translateX(-4px); }
}

/* Klavye / Dokunmatik İpucu Alanı */
.timeline-shortcuts-hint {
  font-family: var(--font-child);
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kbd-badge {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fde047;
}

.hint-touch {
  color: #93c5fd;
}

/* ==========================================================================
   RTL Desteği (Arapça, Farsça, İbranice, Uygurca)
   ========================================================================== */

[dir="rtl"] .story-card {
  grid-template-columns: 1fr 340px;
}

[dir="rtl"] .story-image-column {
  order: 2;
}

[dir="rtl"] .story-content-column {
  order: 1;
  text-align: right;
}

[dir="rtl"] .story-text {
  font-family: 'Cairo', 'Fredoka', sans-serif;
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .story-year-badge {
  font-family: 'Cairo', 'Fredoka', sans-serif;
}

[dir="rtl"] .story-meta-bar {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn-prev .nav-arrow {
  transform: rotate(180deg);
}

[dir="rtl"] .btn-next .nav-arrow {
  transform: rotate(180deg);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobil)
   ========================================================================== */

@media (max-width: 900px) {
  .story-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 24px;
    min-height: auto;
  }

  [dir="rtl"] .story-card {
    grid-template-columns: 1fr;
  }

  [dir="rtl"] .story-image-column {
    order: 1;
  }

  [dir="rtl"] .story-content-column {
    order: 2;
  }

  .story-image-frame {
    max-width: 230px;
  }

  .story-year-badge {
    font-size: 38px;
  }

  .story-text {
    font-size: 21px;
    text-align: center;
  }

  [dir="rtl"] .story-text {
    text-align: center;
  }

  .story-meta-bar {
    justify-content: center;
    gap: 20px;
  }

  .timeline-shortcuts-hint {
    display: none;
  }
}

@media (max-width: 600px) {
  .timeline-main-wrap {
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: 65px;
  }

  .year-ribbon-container {
    margin-bottom: 16px;
  }

  .ribbon-decor {
    font-size: 20px;
  }

  .year-pill-btn {
    padding: 6px 14px;
    font-size: 14px;
  }

  .year-pill-btn.active {
    font-size: 15px;
    padding: 6px 16px;
  }

  .story-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .card-corner-sparkle {
    font-size: 16px;
  }

  .story-image-frame {
    max-width: 175px;
    padding: 14px;
    border-radius: 20px;
  }

  .story-year-badge {
    font-size: 32px;
  }

  .story-counter-badge {
    padding: 5px 12px;
    font-size: 13px;
  }

  .story-text {
    font-size: 18px;
    line-height: 1.55;
    min-height: auto;
  }

  .timeline-nav-btn {
    padding: 10px 18px;
    font-size: 15px;
  }

  .timeline-nav-row {
    margin-top: 18px;
  }
}
