/* ===================================
   ENHANCED VIDEO CARDS
   =================================== */

/* Card Container */
.video-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  border: 1px solid transparent;
}

.video-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
              0 0 24px rgba(229, 9, 20, 0.3);
  border-color: rgba(229, 9, 20, 0.3);
}

/* Thumbnail Container */
.video-card .thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.video-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .thumbnail img {
  transform: scale(1.1);
}

/* Gradient Overlay */
.thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-card:hover .thumbnail::after {
  opacity: 1;
}

/* Play Icon */
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(229, 9, 20, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.video-card:hover .play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.play-icon svg {
  width: 24px;
  height: 24px;
  fill: white;
  margin-left: 3px;
}

/* Badges Container */
.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  width: fit-content;
}

.badge-new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.badge-trending {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.badge-featured {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.badge-exclusive {
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: white;
}

/* Duration Badge */
.duration-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Progress Bar for Watched Content */
.watch-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 3;
}

.watch-progress__fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.6);
}

/* Card Info Section */
.video-card .info {
  padding: 1rem;
  position: relative;
}

.video-card .info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.video-card:hover .info h3 {
  color: var(--accent-secondary);
}

/* Meta Information */
.video-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

/* Views Counter */
.views {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.views svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Rating Stars */
.rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.rating-stars svg {
  width: 14px;
  height: 14px;
  transition: fill 0.2s ease;
}

.star-full {
  fill: var(--accent-tertiary);
}

.star-half {
  fill: url(#half-star-gradient);
}

.star-empty {
  fill: rgba(255, 255, 255, 0.2);
}

.rating-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* Overlay Actions */
.overlay-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 4;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-card:hover .overlay-actions {
  opacity: 1;
  transform: translateY(0);
}

.action-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.action-button.active {
  background: var(--accent-primary);
}

.action-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Hover Preview Info */
.preview-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.95) 100%
  );
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2;
}

.video-card:hover .preview-info {
  transform: translateY(0);
  opacity: 1;
}

.preview-info__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}

.preview-info__description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-info__meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Genre Tags */
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.5rem;
}

.genre-tag {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading State for Cards */
.video-card.loading {
  pointer-events: none;
}

.video-card.loading .thumbnail {
  background: linear-gradient(
    90deg,
    #1a1a1a 0%,
    #2a2a2a 50%,
    #1a1a1a 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .video-card {
    border-radius: 8px;
  }

  .card-badges {
    top: 8px;
    left: 8px;
    gap: 4px;
  }

  .badge {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  .duration-badge {
    bottom: 8px;
    right: 8px;
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  .play-icon {
    width: 48px;
    height: 48px;
  }

  .play-icon svg {
    width: 20px;
    height: 20px;
  }

  .overlay-actions {
    gap: 6px;
  }

  .action-button {
    width: 32px;
    height: 32px;
  }

  .action-button svg {
    width: 16px;
    height: 16px;
  }

  .preview-info {
    padding: 0.75rem;
  }

  .video-card .info {
    padding: 0.75rem;
  }

  .video-card .info h3 {
    font-size: 0.9rem;
  }
}

/* SVG Gradient Definition for Half Stars */
svg defs {
  display: none;
}

/* Accessibility */
.video-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

.action-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Animation for new cards appearing */
@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-card.appear {
  animation: card-appear 0.5s ease-out forwards;
}
