/* Shelf Collection System - Disney+ Style */

/* ==========================================
   SHELF COLLECTION CONTAINER
========================================== */

.shelf-collection {
  margin-bottom: 3rem;
  padding: 0 3.5vw;
}

@media (max-width: 767px) {
  .shelf-collection {
    padding: 0 4vw;
    margin-bottom: 2rem;
  }
}

/* Collection Header */
.shelf-collection__header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shelf-collection__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (min-width: 768px) {
  .shelf-collection__title {
    font-size: 1.75rem;
  }
}

/* Collection Section */
.shelf-collection__section {
  position: relative;
}

.shelf-collection__container {
  position: relative;
  display: flex;
  align-items: center;
}

/* ==========================================
   SHELF SCROLL CONTAINER
========================================== */

.shelf-scroll-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.5rem 0;
  flex: 1;
}

.shelf-scroll-container::-webkit-scrollbar {
  display: none;
}

@media (max-width: 767px) {
  .shelf-scroll-container {
    gap: 0.75rem;
    padding-right: 2rem;
  }
}

/* ==========================================
   SHELF ITEM WRAPPER
========================================== */

.shelf-item-wrapper {
  flex: 0 0 auto;
  scroll-snap-align: start;
  transition: transform 0.3s ease;
}

/* Responsive sizing based on collection style */
.shelf-collection--standard_art .shelf-item-wrapper,
.shelf-collection--continue_watching .shelf-item-wrapper {
  width: calc((100vw - 7vw - 4rem) / 5);
  max-width: 300px;
  min-width: 180px;
}

.shelf-collection--poster_vertical .shelf-item-wrapper {
  width: calc((100vw - 7vw - 4rem) / 6);
  max-width: 200px;
  min-width: 140px;
}

.shelf-collection--hero_inline_single .shelf-item-wrapper {
  width: calc((100vw - 7vw - 2rem) / 2);
  max-width: 600px;
  min-width: 400px;
}

@media (max-width: 1200px) {
  .shelf-collection--standard_art .shelf-item-wrapper,
  .shelf-collection--continue_watching .shelf-item-wrapper {
    width: calc((100vw - 8vw - 3rem) / 4);
  }
  
  .shelf-collection--poster_vertical .shelf-item-wrapper {
    width: calc((100vw - 8vw - 4rem) / 5);
  }
  
  .shelf-collection--hero_inline_single .shelf-item-wrapper {
    width: calc((100vw - 8vw - 1rem) / 1.5);
  }
}

@media (max-width: 767px) {
  .shelf-collection--standard_art .shelf-item-wrapper,
  .shelf-collection--continue_watching .shelf-item-wrapper,
  .shelf-collection--poster_vertical .shelf-item-wrapper {
    width: calc((100vw - 8vw - 2rem) / 3);
    min-width: 120px;
  }
  
  .shelf-collection--hero_inline_single .shelf-item-wrapper {
    width: calc(100vw - 8vw - 1rem);
  }
}

/* ==========================================
   SHELF ITEM STYLES
========================================== */

.shelf-item {
  width: 100%;
  height: auto;
  position: relative;
}

.shelf-item__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: visible; /* Allow hover effects to show outside */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: transparent; /* Use transparent for Disney+ cards */
}

/* Remove old hover styles - these are now handled in the component */
.shelf-item__link:hover {
  /* Styles are now in the component */
}

/* Image Container */
.shelf-item__image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Updated aspect ratios for different styles */
.shelf-item--continue_watching .shelf-item__image-container {
  aspect-ratio: 16/9;
}

.shelf-item--poster_vertical .shelf-item__image-container {
  aspect-ratio: 5/8;
}

.shelf-item--hero_inline_single .shelf-item__image-container {
  aspect-ratio: 16/9;
}

/* Note: standard_art aspect ratio is now handled in the component for flexible height */

.shelf-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.shelf-item__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.shelf-item__placeholder-text {
  color: white;
  font-weight: bold;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.2;
}

/* Progress Bar (for continue_watching) */
.shelf-item__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
}

.shelf-item__progress-bar {
  height: 100%;
  background: #3b82f6;
  transition: width 0.3s ease;
}

/* Rating Badge */
.shelf-item__rating-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Item Content (metadata) - Legacy styles, most now handled in component */
.shelf-item__content {
  padding: 1rem;
  background: #2d2d34;
}

.shelf-item__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-item__metadata {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.shelf-item__metadata-item {
  font-size: 0.75rem;
  color: #9ca3af;
}

.shelf-item__metadata--rating {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ==========================================
   NAVIGATION ARROWS
========================================== */

.shelf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(42, 42, 42, 0.8);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.shelf-nav:hover {
  background: rgba(42, 42, 42, 0.95);
  transform: translateY(-50%) scale(1.1);
}

.shelf-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.shelf-nav--left {
  left: -1.5rem;
}

.shelf-nav--right {
  right: -1.5rem;
}

/* Adjust navigation arrows for taller standard_art cards */
.shelf-collection--standard_art .shelf-nav {
  top: 35%; /* Position arrows relative to image area, not full card */
}

@media (max-width: 767px) {
  .shelf-nav {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .shelf-nav--left {
    left: -1rem;
  }
  
  .shelf-nav--right {
    right: -1rem;
  }
}

/* Hide navigation on very small screens */
@media (max-width: 480px) {
  .shelf-nav {
    display: none;
  }
}

/* ==========================================
   SPECIAL STYLE VARIATIONS
========================================== */

/* Hero Inline Single - larger format */
.shelf-collection--hero_inline_single .shelf-item__link {
  border-radius: 12px;
}

.shelf-collection--hero_inline_single .shelf-item__title {
  font-size: 1.125rem;
  font-weight: 700;
}

/* Continue Watching - special progress styling */
.shelf-item--continue_watching .shelf-item__progress {
  height: 6px;
}

.shelf-item--continue_watching .shelf-item__progress-bar {
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Trending Searches - special highlight */
.shelf-collection--trending_searches .shelf-item__link {
  border: 2px solid transparent;
  background: linear-gradient(#2d2d34, #2d2d34) padding-box,
              linear-gradient(45deg, #3b82f6, #8b5cf6) border-box;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
========================================== */

@media (prefers-reduced-motion: reduce) {
  .shelf-item__link,
  .shelf-nav,
  .shelf-item-wrapper {
    transition: none !important;
  }
  
  .shelf-scroll-container {
    scroll-behavior: auto;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .shelf-item__link {
    border: 2px solid white;
  }
  
  .shelf-nav {
    border: 2px solid white;
  }
}

/* Focus styles for accessibility */
.shelf-item__link:focus-visible,
.shelf-nav:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}