/* ==========================================================================
   FLOW STORY - Haber Sitesi Story Komponenti
   Kategori bazlı, 9:16 format, mobil odaklı
   Nova CMS Entegrasyonu
   ========================================================================== */

/* Flow Story aktifken main padding ayarı (sadece mobil) */
@media (max-width: 991.98px) {
  main:has(.flow-story-wrapper) {
    padding-top: 0 !important;
  }
}

/* Story Wrapper Background */
.flow-story-wrapper {
  background-color: var(--color-bg, #fff);
  padding: 0 12px;
  margin-bottom: 1rem;
}

[data-bs-theme="dark"] .flow-story-wrapper {
  background-color: var(--bs-body-bg, #1a1a1a);
}

/* --------------------------------------------------------------------------
   Timeline (Yatay Kaydırmalı Story Listesi)
   -------------------------------------------------------------------------- */
.flow-story-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.flow-story-timeline::-webkit-scrollbar {
  display: none;
}

/* Story Item (Timeline'daki her bir kategori) */
.flow-story-item {
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  width: 72px;
}

.flow-story-item:first-child {
  margin-left: 0;
}

/* Avatar Container */
.flow-story-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--te-color, #e91e63) 0%, var(--te-hover-color, #9c27b0) 100%);
  margin: 0 auto 6px;
  transition: transform 0.2s ease;
}

.flow-story-item:active .flow-story-avatar {
  transform: scale(0.95);
}

.flow-story-item.seen .flow-story-avatar {
  background: var(--bs-border-color, #ddd);
}

.flow-story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bs-body-bg, #fff);
}

/* Kategori Adı */
.flow-story-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--bs-body-color, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

.flow-story-item.seen .flow-story-name {
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Modal (Tam Ekran Story Görüntüleyici)
   -------------------------------------------------------------------------- */
.flow-story-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  display: none;
  flex-direction: column;
}

.flow-story-modal.active {
  display: flex;
}

/* Modal Header */
.flow-story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}

/* Progress Bar Container */
.flow-story-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.flow-story-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

.flow-story-progress-bar .fill {
  height: 100%;
  background: #fff;
  width: 0;
  border-radius: 2px;
}

.flow-story-progress-bar.seen .fill {
  width: 100%;
}

.flow-story-progress-bar.active .fill {
  animation: flowStoryProgress var(--story-duration, 5s) linear forwards;
}

@keyframes flowStoryProgress {
  from { width: 0; }
  to { width: 100%; }
}

/* Paused durumunda animasyonu durdur */
.flow-story-modal.paused .flow-story-progress-bar.active .fill {
  animation-play-state: paused;
}

/* Header Info */
.flow-story-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flow-story-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-story-info-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.flow-story-info-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.flow-story-info-time {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

.flow-story-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Story Content (Swiper Container) */
.flow-story-content {
  flex: 1;
  position: relative;
}

.flow-story-swiper {
  width: 100%;
  height: 100%;
}

.flow-story-slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  width: 100%;
  height: 100%;
}

.flow-story-slide > img.media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Story Overlay (Başlık ve Link) - Tıklanabilir alan */
.flow-story-overlay,
.flow-story-overlay:hover,
.flow-story-overlay:focus,
.flow-story-overlay:active,
.flow-story-overlay:visited {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 80px 16px 32px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    transparent 100%
  );
  color: #fff;
  z-index: 10;
  text-decoration: none;
  display: block;
  cursor: pointer;
}

.flow-story-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.flow-story-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--te-color, #e91e63);
  color: #fff;
  text-decoration: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
}

.flow-story-link i {
  font-size: 12px;
}

/* Navigation Arrows (Opsiyonel - Masaüstü için) */
.flow-story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: none;
}

.flow-story-nav.prev { left: 12px; }
.flow-story-nav.next { right: 12px; }

/* Touch Areas (Mobil için görünmez dokunma alanları) */
.flow-story-touch {
  position: absolute;
  top: 0;
  bottom: 100px; /* Overlay alanını bırak */
  width: 30%;
  z-index: 15;
  cursor: pointer;
}

.flow-story-touch.prev { left: 0; }
.flow-story-touch.next { right: 0; }

/* --------------------------------------------------------------------------
   Kategori Swiper (Kategoriler arası geçiş)
   -------------------------------------------------------------------------- */
.flow-story-categories-swiper {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Dark Mode Desteği (Bootstrap 5.3 data-bs-theme)
   -------------------------------------------------------------------------- */
[data-bs-theme="dark"] .flow-story-avatar {
  border-color: var(--bs-body-bg, #1a1a1a);
}

[data-bs-theme="dark"] .flow-story-avatar img {
  border-color: var(--bs-body-bg, #1a1a1a);
}

[data-bs-theme="dark"] .flow-story-name {
  color: var(--bs-body-color, #e0e0e0);
}

[data-bs-theme="dark"] .flow-story-item.seen .flow-story-avatar {
  background: var(--bs-border-color, #444);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .flow-story-nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .flow-story-slide img {
    max-height: 80vh;
    border-radius: 8px;
  }
}

/* Desktop'ta timeline gizle (opsiyonel) */
@media (min-width: 992px) {
  .flow-story-wrapper.mobile-only {
    display: none;
  }
}
