/**
 * KH Core FAZ 2 — KH Tube premium cards (glass + hover lift + glow)
 */

.kh-tube-feed__loading {
  margin: 0;
  padding: 16px;
  font-size: 13px;
  color: var(--muted, #94a3b8);
  text-align: center;
}

.kh-tube-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 260px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--kh-radius-md, 14px);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  will-change: transform;
}

.kh-tube-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 212, 255, 0.2);
}

.kh-tube-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.kh-tube-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.kh-tube-card:hover .kh-tube-card__media img {
  transform: scale(1.06);
}

.kh-tube-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(0, 212, 255, 0.15));
}

.kh-tube-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.88;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

.kh-tube-card__play svg {
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.45);
}

.kh-tube-card:hover .kh-tube-card__play {
  opacity: 1;
  transform: scale(1.08);
}

.kh-tube-card__glow {
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 212, 255, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.kh-tube-card:hover .kh-tube-card__glow {
  opacity: 1;
}

.kh-tube-card__body {
  padding: 12px 14px 14px;
}

.kh-tube-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text, #f8fafc);
}

/* Sidebar compact cards */
.kh-tube-feed--sidebar .kh-sb-tube-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kh-tube-card--sidebar {
  min-width: 0;
  max-width: 100%;
  flex-direction: row;
  align-items: stretch;
}

.kh-tube-card--sidebar .kh-tube-card__media {
  flex: 0 0 88px;
  width: 88px;
  aspect-ratio: 16 / 10;
}

.kh-tube-card--sidebar .kh-tube-card__play svg {
  width: 28px;
  height: 28px;
  padding: 6px;
}

.kh-tube-card--sidebar .kh-tube-card__body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 12px;
}

.kh-tube-card--sidebar .kh-tube-card__title {
  font-size: 13px;
  -webkit-line-clamp: 3;
}

/* Homepage slider track */
.kh-tube-feed--slider .kh-tube-feed__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.kh-tube-feed--slider .kh-tube-feed__track::-webkit-scrollbar {
  display: none;
}

.kh-tube-feed--slider .kh-tube-card {
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  .kh-tube-card {
    min-width: 170px;
    max-width: 220px;
  }
}
