/**
 * Reels & Shorts Styles
 * Video feed grid, category filters, full-screen player modal & controls
 */

/* Фильтры тематик */
.reels-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 18px;
  margin-bottom: 30px;
  scrollbar-width: none;
}

.reels-filter-bar::-webkit-scrollbar {
  display: none;
}

.reels-filter-btn {
  background: #ffffff;
  border: 1px solid var(--line);
  color: #4a5568;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.reels-filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.reels-filter-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.reels-filter-cnt {
  font-size: 11px;
  opacity: 0.75;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 7px;
  border-radius: 10px;
}

.reels-filter-btn.active .reels-filter-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Сетка карточек */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.reel-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.reel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.reel-thumbnail-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  background: #0f172a;
  overflow: hidden;
}

.reel-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.reel-card:hover .reel-poster {
  transform: scale(1.04);
}

.reel-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 40%, transparent 100%);
}

.reel-tag-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.reel-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0.9;
  transition: all 0.2s;
}

.reel-play-icon svg {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 12px;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.reel-card:hover .reel-play-icon svg {
  transform: scale(1.1);
  background: var(--blue);
}

.reel-stats-bar {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 14px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.reel-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.reel-card-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.reel-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--ink);
}

.reel-card-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* Модальный плеер Reels */
.reel-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(14px);
  padding: 16px;
  user-select: none;
}

.reel-modal-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.reel-player-box {
  position: relative;
  z-index: 10;
  width: 440px;
  max-width: 100%;
  height: 780px;
  max-height: 94vh;
  background: #000000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .reel-modal {
    padding: 0;
  }
  .reel-player-box {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

.reel-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.reel-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.reel-video-container {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#reel-active-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-tap-pause-indicator {
  position: absolute;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.4);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  pointer-events: none;
}

.reel-tap-pause-indicator.show {
  opacity: 1;
  transform: scale(1);
}

/* Верхний градиент (для кнопок X и стрелок) */
.reel-top-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.25) 60%, transparent 100%);
  pointer-events: none;
  z-index: 25;
}

/* Нижний градиент (кинематографичный, на всю ширину 100%) */
.reel-bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 360px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 45%, rgba(0, 0, 0, 0.35) 80%, transparent 100%);
  pointer-events: none;
  z-index: 25;
}

/* Всплывающее сердце при двойном тапе (Double Tap Like) */
.reel-heart-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 45;
  filter: drop-shadow(0 4px 20px rgba(239, 68, 68, 0.65));
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

.reel-heart-burst.animate {
  transform: translate(-50%, -50%) scale(1.35);
  opacity: 1;
}

/* Боковые кнопки */
.reel-side-actions {
  position: absolute;
  right: 14px;
  bottom: 80px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.reel-action-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reel-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.reel-action-btn.liked {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  background: rgba(239, 68, 68, 0.25) !important;
}

.reel-action-btn.liked svg {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.5));
}

.reel-action-btn.pip-active {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  background: rgba(56, 189, 248, 0.25) !important;
}

.reel-action-label {
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Кнопки переключения вверх/вниз */
.reel-nav-buttons {
  position: absolute;
  right: 14px;
  top: 16px;
  z-index: 40;
  display: flex;
  gap: 6px;
}

.reel-nav-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.15s ease;
}

.reel-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* Нижняя панель */
.reel-bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  padding: 30px 78px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.reel-bottom-info > * {
  pointer-events: auto;
}

.reel-author-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reel-author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffffff;
}

.reel-author-name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  display: block;
}

.reel-badge-pill {
  display: inline-block;
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 12px;
}

.reel-modal-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.reel-modal-desc {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.reel-modal-cta-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.reel-modal-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue, #2563eb);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.reel-modal-cta-btn:hover {
  filter: brightness(1.1);
}

.reel-direct-link {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  line-height: 1;
  transition: all 0.15s;
}

.reel-direct-link:hover {
  color: var(--blue);
  background: #e0f2fe;
}

.reel-modal-link-subtle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  text-decoration: underline;
  padding: 6px 8px;
}

.reel-modal-link-subtle:hover {
  color: #fff;
}

.modal-share-sheet {
  position: absolute;
  bottom: 80px;
  right: 68px;
  z-index: 55;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-share-btn {
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.modal-share-btn.tg { background: #0284c7; }
.modal-share-btn.wa { background: #16a34a; }
.modal-share-btn.vk { background: #2563eb; }
.modal-share-btn.copy { background: #334155; }
.modal-share-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

.reel-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  z-index: 50;
}

.reel-progress-bar {
  height: 100%;
  width: 0%;
  background: #ffffff;
  transition: width 0.1s linear;
}

