/*
 * <VideoEndOverlay/> styles. All selectors carry the `.video-end-`
 * prefix so they don't collide via CSS hoisting. Colors are intentional
 * raw values (not design tokens) — the overlay sits on a dark navy
 * gradient and needs hand-tuned alpha rgba()s and a softened brand
 * blue (#5b9ed6) that the global --accent isn't tuned for.
 */

.video-end-overlay {
  position: absolute;
  inset: 0;
  /* Above .post-theater-placeholder (z:2) AND .post-theater-duration
     pill (z:3). Without this the timestamp pill bleeds over the
     replay button corner. */
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: #fff;
  /* Match the dark topbar + theater so the overlay reads as the
     same shell, not a stacked panel. Pure #000 reserved for things
     like video letterboxing, not chrome. */
  background: var(--bg-dark);
  font-family: var(--font-sans);
  opacity: 0;
  animation: video-end-overlay-in 250ms cubic-bezier(0.2, 0.7, 0.2, 1) 100ms forwards;
}

@media (max-width: 480px) {
  .video-end-overlay { padding: 16px; }
}

.video-end-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  opacity: 0;
  animation: video-end-fade-up 250ms ease-out 200ms forwards;
}

.video-end-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 48px;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  background: #5b9ed6;
  color: #fff;
  border: 1px solid #5b9ed6;
  border-radius: 4px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
  line-height: 1;
}
.video-end-primary:hover {
  background: #7ab2e0;
  border-color: #7ab2e0;
}

.video-end-nav-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.video-end-button-toc {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
  padding: 0;
  text-decoration: none;
}
.video-end-button-toc:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.03);
}

.video-end-button-next {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.video-end-button-next:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.video-end-button-next-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  overflow: hidden;
}

.video-end-button-next-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.30);
  line-height: 1;
  transition: color 180ms ease;
}

.video-end-button-next-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  transition: color 180ms ease;
}

.video-end-button-next-chevron {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 180ms ease, color 180ms ease;
}

/* On hover, brighten Next text up to full white. */
.video-end-button-next:hover .video-end-button-next-title   { color: #fff; }
.video-end-button-next:hover .video-end-button-next-eyebrow { color: rgba(255, 255, 255, 0.55); }
.video-end-button-next:hover .video-end-button-next-chevron {
  color: rgba(255, 255, 255, 0.85);
  transform: translateX(2px);
}

@media (max-width: 380px) {
  .video-end-button-next { padding: 0 12px; gap: 8px; }
}

.video-end-button-replay {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 12px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  animation: video-end-fade-up 250ms ease-out 350ms forwards;
}
.video-end-button-replay:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 480px) {
  .video-end-button-replay { bottom: 12px; right: 12px; }
}

@keyframes video-end-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes video-end-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
