/* Shared video card layout (home + search) — YouTube Kids style */
.video-feature {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  min-height: 0;
}

.video-feature .video-thumb-btn {
  order: -1;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  cursor: pointer;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  flex: 1 1 auto;
  min-height: 0;
  line-height: 0;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.video-feature .video-thumb,
.video-feature iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  object-position: center center;
  aspect-ratio: 16 / 9;
  max-height: none;
  background-color: #000;
}

.video-thumb {
  transition: transform 0.25s ease;
}

/* Improve perceived thumbnail sharpness and styling */
.video-thumb {
  filter: contrast(1.04) saturate(1.08);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.08);
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

.video-thumb-btn:hover .video-thumb {
  transform: scale(1.02);
}

.video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.video-content-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-top: 0;
  /* give the text/content more breathing room from card edges */
  padding: 12px 10px 10px;
  width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.video-text-content {
  flex: 1;
  min-width: 0;
}

.video-text-content h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-text-content p {
  display: none;
}

.video-actions {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
}

.video-menu-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-feature .video-menu-item,
.video-feature .video-menu-popup,
.video-menu-wrap .video-menu,
.video-menu-wrap .video-menu-popup-panel,
.video-menu-wrap > .video-menu {
  display: none !important;
}

.video-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.video-menu-btn::before {
  content: "⋮";
  font-weight: 700;
}

.video-menu-btn.is-active,
.video-menu-btn:hover {
  background: rgba(15, 23, 42, 0.08);
}

/* Home feed: show videos in a centered column with breathing room */
#featured-video-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#featured-video-list .video-feature {
  flex: 0 0 calc((100% - 16px) / 3);
  /* Raised card minimum height so the image area is visually larger */
  min-height: 260px;
}

#featured-video-list .video-feature .video-thumb-btn {
  flex: 1 1 auto;
}

#featured-video-list .video-feature .video-thumb {
  aspect-ratio: unset;
  height: 100%;
}

.video-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: transparent;
  pointer-events: none;
}

.video-menu-backdrop.is-open {
  pointer-events: auto;
}

#kids-video-menu-popup.video-menu-popup {
  position: fixed;
  z-index: 46;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

#kids-video-menu-popup.video-menu-popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#kids-video-menu-popup.video-menu-popup[hidden] {
  display: none !important;
}

#kids-video-menu-popup .video-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #0f172a;
}

#kids-video-menu-popup .video-menu-item:hover,
#kids-video-menu-popup .video-menu-item:active {
  background: #f1f5f9;
}

#kids-video-menu-popup .video-menu-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

#kids-video-menu-popup .video-menu-item-label {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

#kids-video-menu-popup .video-menu-item[data-action="download"] .video-menu-item-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

#kids-video-menu-popup .video-menu-item[data-action="playlist"] .video-menu-item-icon {
  background: #ede9fe;
  color: #6d28d9;
}

#kids-video-menu-popup .video-menu-item[data-action="like"] .video-menu-item-icon {
  background: #fce7f3;
  color: #be185d;
}

#kids-video-menu-popup .video-menu-item[data-action="remove"] .video-menu-item-icon {
  background: #fee2e2;
  color: #b91c1c;
}
