/* ============================================================
   Sözün Gelişi — Reels (YouTube Shorts tarzı dikey akış)
   Keşfet hibrit görünüm + Gelişi Güzel sayfası ortak stiller.
   ============================================================ */

/* ── Ultra-Modern Segmented View Control ── */
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}

.view-toggle a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.view-toggle a:hover {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.06);
}

.view-toggle a.active {
  background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to));
  color: #fff;
  box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.view-toggle a.active i {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}
.view-toggle a.active:hover {
  box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Akış kapsayıcı */
.reels-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Shorts modu: tam boy, ekran başına tek video */
.reels-feed.snap {
  height: calc(100dvh - 190px);
  min-height: 540px;
  max-height: 900px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  border-radius: 20px;
  padding: 0;
  gap: 14px;
  background: #050508;
  border: 1px solid var(--border-color);
}

.reels-feed.snap::-webkit-scrollbar { display: none; }

.reel-snap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  max-height: calc(100vh - 170px);
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.5);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
}

.reels-feed.snap .reel-snap {
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  scroll-snap-align: center;
}

/* Medya katmanı */
.reel-stage {
  position: absolute;
  inset: 0;
  background: #000;
}

.reel-media,
.reel-yt,
.reel-yt iframe,
.reel-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.reel-media,
.reel-facade {
  object-fit: cover;
}

.reel-yt iframe { border: 0; }

.reel-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.38) 0%, transparent 22%, transparent 55%, rgba(0,0,0,.82) 100%);
}

/* Ses düğmesi (sağ üst) */
.reel-muted-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.reel-muted-btn:hover { background: rgba(0, 0, 0, 0.8); }

/* Sağ aksiyon rayı */
.reel-rail {
  position: absolute;
  right: 8px;
  bottom: 110px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 5;
}

.reel-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  text-decoration: none;
  padding: 0;
  font-family: inherit;
}

.reel-rail-btn .rail-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  backdrop-filter: blur(8px);
  transition: transform 0.15s, background 0.2s;
}

.reel-rail-btn:hover .rail-icon { transform: scale(1.08); background: rgba(255,255,255,.22); }
.reel-rail-btn:active .rail-icon { transform: scale(0.94); }

.reel-rail-btn.liked .rail-icon {
  background: rgba(244, 63, 94, 0.9);
  border-color: rgba(244, 63, 94, 0.9);
}

/* Alt bilgi katmanı */
.reel-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 12px 76px 22px 14px;
  color: #fff;
}

.reel-channel {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  margin-bottom: 8px;
  min-width: 0;
}

.reel-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.reel-channel-name {
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}

.reel-caption {
  font-size: 13.5px;
  line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.reel-caption a { color: #7cc4fa; font-weight: 700; }

.reel-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
}

.reel-duration {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
}

/* Alt ilerleme çubuğu */
.reel-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 6;
  cursor: pointer;
}

.reel-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0;
}

/* Büyük oynat düğmesi */
.reel-big-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 0;
}

.reel-snap.paused .reel-big-play { opacity: 1; }

.reel-big-play span {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  backdrop-filter: blur(6px);
}

/* Çift dokunma kalbi */
.reel-heart-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
}

.reel-heart-burst.show { animation: reelBurst 0.8s ease forwards; }

.reel-heart-burst i {
  font-size: 90px;
  color: #f43f5e;
  filter: drop-shadow(0 6px 20px rgba(244, 63, 94, 0.6));
}

@keyframes reelBurst {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 1; transform: scale(1.15); }
  55% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1) translateY(-30px); }
}

/* Boş durum + yükleyici */
.reels-empty {
  text-align: center;
  padding: 60px 24px;
  border: 2px dashed var(--border-color);
  border-radius: 20px;
  background: rgba(var(--accent-rgb), 0.03);
  max-width: 480px;
  margin: 0 auto;
}

.reels-empty i {
  font-size: 44px;
  color: var(--accent);
  margin-bottom: 14px;
}

.reels-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.reels-feed.snap + .reels-loader {
  max-width: 480px;
  margin: 0 auto;
}

.reels-quota-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), 0.1);
  overflow: hidden;
  margin-top: 8px;
}

.reels-quota-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-from), var(--gradient-to));
  border-radius: 99px;
}

.reels-upload-drop {
  border: 2px dashed rgba(var(--accent-rgb), 0.4);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.reels-upload-drop:hover,
.reels-upload-drop.dragover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.reels-upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

@media (max-width: 560px) {
  .reels-feed { max-width: 100%; gap: 12px; }
  .reels-feed.snap {
    height: calc(100dvh - 210px);
    min-height: 440px;
    border-radius: 16px;
  }
  .reel-rail { bottom: 100px; }
  .reel-rail-btn .rail-icon { width: 44px; height: 44px; font-size: 17px; }
  .reel-bottom { padding: 10px 68px 20px 12px; }
  .view-toggle a { padding: 8px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-heart-burst.show { animation: none; opacity: 1; }
}
