/* =========================================
   ANNOTATIONS OVERVIEW - Обзорная полоса эскизов аннотаций
   ========================================= */

/* Кнопка-переключатель справа снизу (наследует .meeting-control-btn/.btn-summary из video.css) */
details.annotations-overview-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

/* Скрываем нативный маркер details */
.annotations-overview-toggle > summary { list-style: none; }
.annotations-overview-toggle > summary::-webkit-details-marker { display: none; }

.ao-icon { display: inline-flex; width: 20px; height: 20px; }
.ao-icon .icon { width: 100%; height: 100%; }

/* Бейджи счётчиков */
.ao-total,
.ao-unread {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.ao-total {
  background: rgba(0, 123, 255, 0.18);
  color: var(--cdr-primary-color);
}
.ao-unread {
  background: rgba(16, 185, 129, 0.22);
  color: #10b981;
}
.ao-unread.hidden { display: none; }

/* Полоса эскизов — над video-controls, скрыта по умолчанию */
.annotations-overview-strip {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  width: min(100vw - 32px, 1200px);
  z-index: 90;
  background: var(--cdr-background);
  backdrop-filter: blur(6px);
  border: 1px solid var(--cdr-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 8px;
  display: none;
}
.annotations-overview-toggle[open] .annotations-overview-strip {
  display: block;
  animation: ao-slide-up 0.18s ease-out;
}

@keyframes ao-slide-up {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Горизонтальный список эскизов */
.annotations-overview-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}

/* Эскиз — квадрат с закруглёнными краями */
.annotations-overview-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f3f4f6;
  cursor: pointer;
  padding: 0;
  scroll-snap-align: start;
}
.annotations-overview-thumb img.ao-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.annotations-overview-thumb img.ao-thumb-imgloaded,
.annotations-overview-thumb img.ao-thumb-img.complete { opacity: 1; }

/* Непросмотренная — изумрудный акцент (по образцу .comment-unread) */
.annotations-overview-thumb.unseen {
  border-color: rgba(16, 185, 129, 0.9);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.35);
}
.annotations-overview-thumb.unseen::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: rgba(16, 185, 129, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  z-index: 2;
}

/* Номер страницы */
.ao-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  z-index: 2;
}

/* Плейсхолдер: skeleton-shimmer + иконка типа */
.ao-thumb-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(100deg, #ececec 30%, #f6f6f6 50%, #ececec 70%);
  background-size: 200% 100%;
  animation: ao-shimmer 1.4s ease-in-out infinite;
}
.ao-thumb-skeleton .ao-thumb-emoji {
  display: inline-flex;
  width: 24px;
  height: 24px;
  opacity: 0.4;
}
@keyframes ao-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Failed-состояние: эскиз недоступен, остаётся кликабельным */
.ao-thumb-failed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: repeating-linear-gradient(45deg, #efefef, #efefef 6px, #e4e4e4 6px, #e4e4e4 12px);
  color: #999;
}
.ao-thumb-failed .ao-thumb-emoji { display: inline-flex; width: 24px; height: 24px; }
.ao-thumb-emoji .icon { width: 100%; height: 100%; }
.ao-thumb-failed .ao-thumb-hint { font-size: 9px; }

@media (max-width: 768px) {
  details.annotations-overview-toggle { bottom: 10px; right: 10px; }
  .annotations-overview-strip { bottom: 76px; }
  .annotations-overview-thumb { width: 80px; height: 80px; }
}
