/* ================================================
   css/card.css — Стили карточки видео и комментариев
   ================================================ */

/* ---------- ПОЛНОЭКРАННОЕ ВИДЕО (Reels-стиль) ---------- */
.reel {
  position: relative;
  height: 100%;   /* ровно высота ленты — точки остановки при листании совпадают */
  width: 100%;
  background: #000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.reel__video {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* на весь экран без полос; у горизонтального видео обрезаются края по бокам */
  display: block;
  cursor: pointer;
}

/* Плашка активного фильтра ленты по стране */
.feed-country-filter {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; margin: 0 12px 10px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 10px;
  font-weight: 700; font-size: 14px;
}
.feed-country-filter button {
  background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1;
}
.feed-country-filter button:hover { color: var(--text); }

/* Иконка play/pause по центру при остановке */
.reel__playhint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Полоска прогресса просмотра (как в TikTok) */
.reel__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.2);
  z-index: 2;
}
.reel__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* Индикатор буферизации при медленном интернете */
.reel__buffering {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.reel__spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: reel-spin 0.8s linear infinite;
}
@keyframes reel-spin { to { transform: rotate(360deg); } }

/* Большое сердце при двойном тапе (как в Instagram) */
.reel__heart-burst {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  font-size: 96px;
  pointer-events: none;
  opacity: 0;
  animation: reel-heart-burst 0.8s ease forwards;
  z-index: 3;
}
@keyframes reel-heart-burst {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Кнопка вкл/выкл звука */
.reel__mute {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Затемнение + инфо/действия поверх видео */
.reel__overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 60px calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.reel__overlay > * { pointer-events: auto; }

.reel__info { flex: 1; min-width: 0; color: #fff; }
.reel__title {
  font-size: 15px;
  font-weight: 800;
  margin-top: 8px;
  line-height: 1.3;
}
.reel__desc {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Вертикальный ряд действий справа */
.reel__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.reel__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}
.reel__action-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
.reel__action span:last-child { font-size: 12px; font-weight: 700; }
.reel__action--liked .reel__action-icon { filter: none; }

/* Шапка (автор + соцсети) */
.card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card__header--link { cursor: pointer; }
.card__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  object-fit: cover;
}
.card__author { font-weight: 800; font-size: 14px; color: #fff; }
.card__time   { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 1px; }

/* Ссылки на соцсети автора */
.card__social {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.card__social-link {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.card__social-link:hover { transform: scale(1.1); text-decoration: none; }
.card__social-link svg { width: 15px; height: 15px; }

.card__social-link--instagram {
  background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.card__social-link--facebook { background: #1877F2; }
.card__social-link--youtube  { background: #FF0000; }
.card__social-link--tiktok   { background: #000000; }
.card__social-link--telegram { background: #229ED9; }

/* ---------- КОММЕНТАРИИ (внутри выезжающей панели) ---------- */
.comments__list { margin-bottom: 16px; }
.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: cover;
}
.comment__content { flex: 1; }
.comment__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.comment__author { font-size: 13px; font-weight: 800; color: var(--accent); }
.comment__time   { font-size: 11px; color: var(--muted); }
.comment__text   { font-size: 14px; line-height: 1.5; }

.comments__empty {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0 12px;
}

/* Форма добавления комментария */
.comments__form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.comments__input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 9px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.comments__input:focus { border-color: var(--accent); }
.comments__input::placeholder { color: var(--muted); }
.comments__send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.comments__send:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(249,115,22,0.4);
}

.comments__login-hint {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}
.comments__login-hint a { font-weight: 700; }
