/**
 * Custom StreamVault Layout - Home Page
 * Unique design that combines the best elements from all platforms
 */

/* Custom Hero Section */
.hero-section.custom-layout {
  background: linear-gradient(135deg, 
    var(--primary-600) 0%, 
    var(--secondary-500) 50%, 
    var(--accent-400) 100%
  );
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero-section.custom-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="25" r="1" fill="white" opacity="0.05"/><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/><circle cx="25" cy="75" r="1" fill="white" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.hero-section.custom-layout .hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: center;
}

.hero-section.custom-layout .hero-text {
  text-align: left;
}

.hero-section.custom-layout .hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, white, rgba(255, 255, 255, 0.8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-section.custom-layout .hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: none;
}

.hero-section.custom-layout .hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-section.custom-layout .hero-stat {
  text-align: center;
}

.hero-section.custom-layout .hero-stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.hero-section.custom-layout .hero-stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.hero-section.custom-layout .hero-visual {
  position: relative;
  height: 250px;
}

.hero-section.custom-layout .hero-featured-card {
  position: absolute;
  width: 180px;
  height: 250px;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.hero-section.custom-layout .hero-featured-card:nth-child(1) {
  top: 0;
  left: 0;
  z-index: 3;
  transform: rotate(-8deg);
}

.hero-section.custom-layout .hero-featured-card:nth-child(2) {
  top: 20px;
  left: 60px;
  z-index: 2;
  transform: rotate(5deg);
  opacity: 0.8;
}

.hero-section.custom-layout .hero-featured-card:nth-child(3) {
  top: 40px;
  left: 120px;
  z-index: 1;
  transform: rotate(-3deg);
  opacity: 0.6;
}

.hero-section.custom-layout:hover .hero-featured-card {
  transform: rotate(0deg) scale(1.05);
}

/* Custom Content Sections */
.custom-layout .section-header {
  position: relative;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid rgba(var(--primary), 0.1);
  margin-bottom: 2rem;
}

.custom-layout .section-title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.custom-layout .section-title::before {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 6px;
  height: 3rem;
  border-radius: 3px;
}

.custom-layout .section-decoration {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--primary) 50%, 
    transparent 100%
  );
}

/* Custom Card Style */
.custom-layout .content-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dark .custom-layout .content-card {
  background: var(--dark-50);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.custom-layout .content-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-layout .content-card:hover::before {
  opacity: 1;
}

.custom-layout .content-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 
    0 25px 50px -12px rgba(var(--primary), 0.25),
    0 0 0 1px rgba(var(--primary), 0.1);
}

.custom-layout .content-card-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--primary), 0.1) 0%,
    transparent 50%,
    rgba(var(--secondary), 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-layout .content-card:hover .content-card-image-wrapper::after {
  opacity: 1;
}

.custom-layout .content-card-info {
  background: linear-gradient(135deg, 
    rgba(var(--primary), 0.02) 0%, 
    rgba(var(--secondary), 0.02) 100%
  );
  border-top: 1px solid rgba(var(--primary), 0.1);
}

.custom-layout .content-card-title {
  background: linear-gradient(135deg, 
    rgb(17, 24, 39), 
    rgb(55, 65, 81)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 600;
}

.dark .custom-layout .content-card-title {
  background: linear-gradient(135deg, white, rgba(255, 255, 255, 0.8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Custom Featured Section */
.custom-layout .featured-content {
  background: linear-gradient(135deg, 
    var(--primary) 0%,
    var(--secondary) 50%,
    var(--accent) 100%
  );
  position: relative;
  overflow: hidden;
}

.custom-layout .featured-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  z-index: 1;
}

.custom-layout .featured-content::after {
  content: '';
  position: absolute;
  bottom: -50%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path d="M40,20 Q60,0 80,20 T120,20 T160,20 T200,20 L200,200 L0,200 Z" fill="rgba(255,255,255,0.05)"/></svg>');
  background-size: cover;
  z-index: 1;
}

.custom-layout .featured-content-inner {
  position: relative;
  z-index: 2;
}

.custom-layout .featured-info {
  max-width: 60%;
}

.custom-layout .featured-title {
  font-weight: 800;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}

.custom-layout .featured-description {
  font-size: 1.125rem;
  line-height: 1.7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Custom Category Tabs */
.custom-layout .category-tabs {
  background: linear-gradient(135deg, 
    rgba(var(--primary), 0.05) 0%,
    rgba(var(--secondary), 0.05) 100%
  );
  border: 1px solid rgba(var(--primary), 0.1);
  padding: 0.5rem;
  border-radius: 1.5rem;
}

.custom-layout .category-tab {
  position: relative;
  border-radius: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.custom-layout .category-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.custom-layout .category-tab:hover::before,
.custom-layout .category-tab.active::before {
  opacity: 1;
}

.custom-layout .category-tab:hover,
.custom-layout .category-tab.active {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Custom Quick Actions */
.custom-layout .quick-actions .quick-action {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.custom-layout .quick-actions .quick-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.custom-layout .quick-actions .quick-action:hover::before {
  transform: translateX(100%);
}

/* Responsive Adjustments */
@media (max-width: 1023px) {
  .hero-section.custom-layout .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-section.custom-layout .hero-text {
    text-align: center;
  }
  
  .hero-section.custom-layout .hero-visual {
    height: 200px;
    justify-self: center;
  }
  
  .hero-section.custom-layout .hero-featured-card {
    width: 140px;
    height: 200px;
  }
  
  .hero-section.custom-layout .hero-featured-card:nth-child(2) {
    left: 40px;
  }
  
  .hero-section.custom-layout .hero-featured-card:nth-child(3) {
    left: 80px;
  }
}

@media (max-width: 767px) {
  .hero-section.custom-layout {
    min-height: 50vh;
  }
  
  .hero-section.custom-layout .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-section.custom-layout .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-section.custom-layout .hero-stats {
    gap: 1rem;
    justify-content: center;
  }
  
  .hero-section.custom-layout .hero-stat-number {
    font-size: 1.5rem;
  }
  
  .hero-section.custom-layout .hero-visual {
    height: 150px;
  }
  
  .hero-section.custom-layout .hero-featured-card {
    width: 100px;
    height: 150px;
  }
  
  .hero-section.custom-layout .hero-featured-card:nth-child(2) {
    left: 30px;
  }
  
  .hero-section.custom-layout .hero-featured-card:nth-child(3) {
    left: 60px;
  }
  
  .custom-layout .featured-info {
    max-width: 100%;
  }
  
  .custom-layout .section-title {
    font-size: 1.5rem;
  }
}

/* Animation Enhancements */
@keyframes customFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  33% { transform: translateY(-10px) rotate(-6deg); }
  66% { transform: translateY(-5px) rotate(-10deg); }
}

@keyframes customFloat2 {
  0%, 100% { transform: translateY(0) rotate(5deg); }
  33% { transform: translateY(-8px) rotate(3deg); }
  66% { transform: translateY(-12px) rotate(7deg); }
}

@keyframes customFloat3 {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  33% { transform: translateY(-6px) rotate(-1deg); }
  66% { transform: translateY(-3px) rotate(-5deg); }
}

.custom-layout .hero-featured-card:nth-child(1) {
  animation: customFloat 6s ease-in-out infinite;
}

.custom-layout .hero-featured-card:nth-child(2) {
  animation: customFloat2 8s ease-in-out infinite;
}

.custom-layout .hero-featured-card:nth-child(3) {
  animation: customFloat3 7s ease-in-out infinite;
}

/**
 * Custom Hero Section - Layout Fixes
 * Fixes for positioning and layout issues
 */

/* Ensure custom hero section doesn't overlap header */
.custom-hero-section {
    margin-top: 80px !important; /* Account for fixed header */
    position: relative;
    overflow: hidden;
}

/* Hero visual section should contain floating cards properly */
.hero-visual-section {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
}

/* Main poster container */
.hero-main-poster {
    position: relative;
    z-index: 2;
    width: 300px;
    height: 400px;
    margin-left: 0; /* Reset margin */
    /* Removed transform - will apply to image instead */
}

.poster-3d-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1000px;
    overflow: hidden; /* Ensure image fills container */
    border-radius: 12px; /* Match image border radius */
}

.main-poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center; 
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    display: block;
    transform: none; /* explicitly reset */
}

.main-poster-image:hover {
    transform: scale(1.05) rotateY(5deg) rotateX(5deg); /* no more translateX */
}


.poster-reflection {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 100%);
    border-radius: 0 0 12px 12px;
    opacity: 0.3;
}

/* Content panel styling */
.hero-content-panel {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Gradient orbs for background */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float-orb 8s ease-in-out infinite;
}

.hero-orb-1 {
    width: 200px;
    height: 200px;
    background: var(--primary-500, #8B5CF6);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 150px;
    height: 150px;
    background: var(--secondary-500, #06B6D4);
    top: 60%;
    right: 20%;
    animation-delay: 2s;
}

.hero-orb-3 {
    width: 100px;
    height: 100px;
    background: var(--accent-500, #F59E0B);
    bottom: 20%;
    left: 70%;
    animation-delay: 4s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Floating Cards Container */
.hero-floating-cards {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Behind main poster */
    pointer-events: none; /* Allow clicks to pass through to cards */
}

/* Individual Floating Cards */
.floating-card {
    position: absolute;
    width: 80px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    pointer-events: all; /* Re-enable clicks on cards */
    opacity: 0.8;
}

.floating-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.floating-card:hover {
    transform: scale(1.1) translateY(-5px);
    opacity: 1;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.floating-card:hover img {
    transform: scale(1.05);
}

/* Position each floating card */
.floating-card.card-1 {
    top: 20px;
    left: -20px;
    animation: float-card-1 6s ease-in-out infinite;
}

.floating-card.card-2 {
    top: 60px;
    right: -30px;
    animation: float-card-2 8s ease-in-out infinite;
}

.floating-card.card-3 {
    bottom: 80px;
    left: -10px;
    animation: float-card-3 7s ease-in-out infinite;
}

.floating-card.card-4 {
    bottom: 20px;
    right: -20px;
    animation: float-card-4 9s ease-in-out infinite;
}

/* Floating animations for each card */
@keyframes float-card-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, -10px) rotate(-2deg); }
    50% { transform: translate(-3px, -15px) rotate(1deg); }
    75% { transform: translate(8px, -5px) rotate(-1deg); }
}

@keyframes float-card-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-8px, 12px) rotate(2deg); }
    66% { transform: translate(5px, -8px) rotate(-3deg); }
}

@keyframes float-card-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    30% { transform: translate(10px, -5px) rotate(1deg); }
    70% { transform: translate(-5px, 8px) rotate(-2deg); }
}

@keyframes float-card-4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    40% { transform: translate(-10px, -8px) rotate(-1deg); }
    80% { transform: translate(3px, 10px) rotate(2deg); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .custom-hero-section {
        margin-top: 70px !important;
    }
    
    .hero-visual-section {
        height: 300px;
    }
    
    .hero-main-poster {
        width: 250px;
        height: 350px;
    }
    
    .main-poster-image {
        transform: translateX(calc(-50% + 80px)) translateX(8px); /* Adjust centering for tablet */
    }
    
    .main-poster-image:hover {
        transform: translateX(calc(-50% + 80px)) translateX(8px) rotateY(5deg) rotateX(5deg) scale(1.02);
    }
    
    /* Adjust floating card sizes for tablets */
    .floating-card {
        width: 70px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .custom-hero-section {
        margin-top: 60px !important;
    }
    
    .hero-content-panel {
        padding: 1.5rem;
    }
    
    .hero-visual-section {
        height: 250px;
    }
    
    .hero-main-poster {
        width: 200px;
        height: 300px;
    }
    
    .main-poster-image {
        transform: translateX(calc(-50% + 60px)) translateX(6px); /* Adjust centering for mobile */
    }
    
    .main-poster-image:hover {
        transform: translateX(calc(-50% + 60px)) translateX(6px) rotateY(5deg) rotateX(5deg) scale(1.02);
    }
    
    /* Adjust floating cards for mobile - make them smaller */
    .floating-card {
        width: 50px;
        height: 75px;
    }
    
    /* Adjust positions for mobile */
    .floating-card.card-1 {
        top: 10px;
        left: -10px;
    }
    
    .floating-card.card-2 {
        top: 40px;
        right: -15px;
    }
    
    .floating-card.card-3 {
        bottom: 50px;
        left: -5px;
    }
    
    .floating-card.card-4 {
        bottom: 10px;
        right: -10px;
    }
}
