/* Modern Card Carousel for G2Own Hero Section 
   Implements a clean, modern card carousel with animations 
   Styled to match the G2Own website theme
*/

/* Featured Games Section container */
.featured-games-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 60px 0;
  padding: 0 20px;
}

.hero-modern-carousel {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0 40px;
}

.modern-carousel-container {
  position: relative;
  height: 280px;
  width: 800px;
  display: flex;
  justify-content: center;
}

/* Card styles - Enhanced with more depth */
.modern-card {
  display: flex;
  flex-direction: column;
  height: 320px; /* Further increased height */
  width: 230px; /* Further increased width */
  background-color: var(--bg-tertiary);
  border-radius: 18px; /* Increased border radius for smoother look */
  box-shadow: 
    -1rem 0 3rem rgba(0, 0, 0, 0.85),
    0 10px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(139, 0, 0, 0.2),
    0 0 5px rgba(255, 0, 0, 0.1); /* Enhanced layered shadows for depth with subtle red glow */
  transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother transition */
  position: relative;
  left: 0px;  border: 1px solid rgba(139, 0, 0, 0.4); /* More prominent border with site brand color */
  overflow: hidden; /* Return to hidden for cleaner look */
  backdrop-filter: blur(5px); /* Glass effect */
  -webkit-backdrop-filter: blur(5px);
  transform-style: preserve-3d; /* For 3D effect */
  perspective: 1000px;
  cursor: pointer; /* Add pointer cursor to indicate clickable */
}

/* Add styles for clickable cards */
.modern-card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  text-decoration: none;
  color: inherit;
  display: block;
}

.modern-card:not(:first-child) {
  margin-left: -50px;
}

.modern-card:hover {
  transform: translateY(-35px) scale(1.08) rotateY(5deg); /* Standard hover effect */
  transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    -1.5rem 0 4rem rgba(0, 0, 0, 0.9),
    0 15px 30px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(139, 0, 0, 0.3),
    0 0 20px rgba(255, 0, 0, 0.15); /* Enhanced red glow on hover */
  z-index: 10; /* Ensure hovered card is on top */
}

.modern-card:active {
  transform: translateY(-25px) scale(1.05) rotateY(3deg); /* Slight scale down when clicked */
  transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    -1rem 0 3.5rem rgba(0, 0, 0, 0.95),
    0 12px 25px rgba(0, 0, 0, 0.7),
    inset 0 0 25px rgba(255, 0, 0, 0.4),
    0 0 15px rgba(255, 0, 0, 0.2); /* Enhanced red glow on click */
}

.modern-card:hover ~ .modern-card {
  position: relative;
  left: 70px; /* Pushed further away */
  transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0.8; /* Slightly fade others to focus on hovered card */
}

.title {
  color: var(--text-primary);
  font-weight: 800; /* Even bolder font */
  position: absolute;
  left: 20px;
  top: 15px;
  font-size: 1.3rem; /* Larger font size */
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 3px rgba(255, 0, 0, 0.3); /* Enhanced text shadow with subtle red glow */
  letter-spacing: 0.6px; /* Better letter spacing */
  font-family: 'Space Grotesk', sans-serif; /* Match site font */
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 50%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateZ(5px); /* 3D effect */
  transition: all 0.3s ease;
}

.modern-card:hover .title {
  transform: translateZ(10px) scale(1.05);
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-red) 50%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bar {
  position: absolute;
  top: 100px;
  left: 20px;
  height: 5px;
  width: 150px;
}

.emptybar {
  background-color: var(--bg-tertiary);
  width: 100%;
  height: 100%;
  border: 1px solid rgba(139, 0, 0, 0.2);
}

.filledbar {
  position: absolute;
  top: 0px;
  z-index: 3;
  width: 0px;
  height: 100%;
  background: linear-gradient(90deg, 
    var(--primary-red) 0%, 
    var(--neon-red) 65%, 
    var(--primary-red) 100%);
  transition: 0.6s ease-out;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6); /* Enhanced glow effect */
  animation: pulseBrightness 3s infinite alternate;
  border-radius: 3px; /* Rounded edges */
}

@keyframes pulseBrightness {
  from { filter: brightness(1); opacity: 0.85; }
  to { filter: brightness(1.7); opacity: 1; }
}

.modern-card:hover .filledbar {
  width: 120px;
  transition: 0.4s ease-out;
}

.circle {
  position: absolute;
  top: 150px;
  left: calc(50% - 60px);
  width: 120px;
  height: 120px;
  animation: circlePathOne 20s linear infinite;
}

/* Individual circle path animations for each card */
.modern-card:nth-child(1) .circle {
  animation: circlePathOne 25s linear infinite;
}

.modern-card:nth-child(2) .circle {
  animation: circlePathTwo 30s linear infinite reverse;
}

.modern-card:nth-child(3) .circle {
  animation: circlePathThree 22s linear infinite;
}

.modern-card:nth-child(4) .circle {
  animation: circlePathFour 28s linear infinite reverse;
}

/* Circular path animations with different timings */
@keyframes circlePathOne {
  0% { transform: translate(0, 0); }
  25% { transform: translate(30px, -30px); }
  50% { transform: translate(0, -50px); }
  75% { transform: translate(-30px, -30px); }
  100% { transform: translate(0, 0); }
}

@keyframes circlePathTwo {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-20px, -40px) rotate(90deg); }
  50% { transform: translate(-40px, 0) rotate(180deg); }
  75% { transform: translate(-20px, 40px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes circlePathThree {
  0% { transform: translate(0, 0); }
  33% { transform: translate(40px, -20px); }
  66% { transform: translate(-40px, -20px); }
  100% { transform: translate(0, 0); }
}

@keyframes circlePathFour {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(0, -40px) rotate(180deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

.circle svg {
  width: 100%;
  height: 100%;
  shape-rendering: geometricPrecision;
  /* Add a subtle shadow for additional blurring effect */
  filter: drop-shadow(0 0 1.5px rgba(255, 0, 0, 0.4));
}

.circle-interior {
  fill: #141414; /* Slightly darker black for better contrast with the blurred edge */
  filter: none; /* Remove filter from interior to keep it clean and dark */
}

.stroke {
  fill: none;
  stroke: #8b0000; /* Using direct color value for better control */
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  stroke-width: 2px;
  transition: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: url(#softRedBorder); /* Using new filter for subtle blur on the border */
}

.modern-card svg {
  fill: var(--bg-tertiary);
  stroke-width: 2px;
  transform-origin: center;
  animation: slowRotate 15s linear infinite;
}

.modern-card:hover .stroke {
  stroke-dashoffset: 80;
  transition: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  stroke: #a30000; /* Using direct color value for better control */
  stroke-width: 2.5px;
  filter: url(#softRedBorder); /* Keep consistent blur effect on hover */
}

.modern-card:hover svg {
  animation: pulseRotate 4s ease-in-out infinite;
}

@keyframes slowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseRotate {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

/* Card content additions to match G2Own style - Enhanced */
.card-meta {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: var(--text-primary);  opacity: 0;
  transition: all 0.5s ease-out;
  transform: translateY(10px);
  z-index: 20; /* Increased z-index to ensure it's above the card link */
  background: rgba(0, 0, 0, 0.65);
  padding: 12px;
  border-radius: 10px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(139, 0, 0, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 3px rgba(255, 0, 0, 0.2);
  transform-style: preserve-3d;
}

.modern-card:hover .card-meta {
  opacity: 1;
  transform: translateY(0) translateZ(5px); /* 3D effect */
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 0, 0, 0.3);
}

.card-meta .meta-item {
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
}

.card-meta .meta-item:last-child {
  margin-bottom: 0;
}

.modern-card:hover .meta-item {
  transform: translateX(3px);
  transition-delay: calc(0.1s * var(--i, 0));
}

.card-meta .meta-item i {
  margin-right: 10px;
  color: var(--neon-red);
  font-size: 1.2rem;
  filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.7));
  transition: all 0.3s ease;
}

.modern-card:hover .meta-item i {
  transform: scale(1.2);
}

/* Game card background image - Enhanced */
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 0;
  filter: contrast(1.2) saturate(1.3) brightness(0.9); /* Enhanced colors */
}

.modern-card:hover .card-bg {
  opacity: 0.7;
  transform: scale(1.15); /* Enhanced zoom effect */
  filter: contrast(1.3) saturate(1.6) brightness(1.1); /* More vibrant on hover */
}

/* Add gradient overlay for better text contrast */
.card-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 30%,
    rgba(139, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: 1;
  transition: all 0.4s ease;
}

.modern-card:hover .card-bg::after {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 30%,
    rgba(255, 0, 0, 0.2) 70%, 
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* Shimmer effect on cards */
.modern-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shimmer 7s infinite linear;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modern-card:hover::after {
  opacity: 1;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Enhanced Featured Games Header */
.featured-modern-header {
  margin-bottom: 50px; /* Increased space */
  text-align: center;
  position: relative;
  z-index: 10;
  animation: fadeInUp 1.2s ease-out;
  width: 100%;
  max-width: 800px; /* Match carousel container width */
}

.featured-modern-header::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px; /* Wider line */
  height: 4px; /* Thicker line */
  background: linear-gradient(90deg, 
    transparent, 
    var(--primary-red), 
    var(--neon-red),
    var(--neon-red), 
    var(--primary-red), 
    transparent);
  animation: pulseLine 3s infinite alternate;
  border-radius: 4px; /* Rounded ends */
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); /* Subtle glow */
}

@keyframes pulseLine {
  from { width: 120px; opacity: 0.85; }
  to { width: 160px; opacity: 1; }
}

.modern-title-text {
  font-size: 3.5rem; /* Larger size */
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: none; /* Changed from uppercase to normal capitalization */
  background: linear-gradient(135deg, 
    #ffffff 0%,
    var(--neon-red) 50%,
    #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.9);
  filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.3)); /* Red glow */
  position: relative;
  display: inline-block;
  transform: perspective(500px) translateZ(0);
  transition: all 0.4s ease;
}

.modern-title-text:hover {
  transform: perspective(500px) translateZ(10px);
  filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

.modern-subtitle {
  font-size: 1.4rem; /* Larger size */
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 3px rgba(255, 0, 0, 0.2);
  animation: fadeInSubtitle 1.5s ease-out;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.featured-modern-header:hover .modern-subtitle {
  transform: translateY(-3px);
  color: rgba(255, 255, 255, 1);
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInSubtitle {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Original card hover effect restored */
.modern-card:hover {
  transform: translateY(-35px) scale(1.08) rotateY(5deg); /* Standard hover effect */
  transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    -1.5rem 0 4rem rgba(0, 0, 0, 0.9),
    0 15px 30px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(139, 0, 0, 0.3),
    0 0 20px rgba(255, 0, 0, 0.15); /* Enhanced red glow on hover */
  z-index: 10; /* Ensure hovered card is on top */
}

/* When buy button is visible, adjust card meta position */
.modern-card:hover .card-meta {
  transform: translateY(-10px) translateZ(5px);
}

/* Click animation */
.modern-card-link:active .modern-card {
  transform: translateY(-25px) scale(1.04) rotateY(5deg);
  transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    -1rem 0 3.5rem rgba(0, 0, 0, 0.85),
    0 8px 15px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(139, 0, 0, 0.25),
    0 0 15px rgba(255, 0, 0, 0.1); /* Slightly reduced shadow for click effect */
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .modern-carousel-container {
    width: 600px;
  }
}

@media (max-width: 700px) {
  .modern-carousel-container {
    width: 400px;
  }
  
  .modern-card {
    width: 160px;
    height: 250px;
  }
  
  .modern-card:not(:first-child) {
    margin-left: -40px;
  }
}

@media (max-width: 480px) {
  .modern-carousel-container {
    width: 300px;
  }
  
  .modern-card {
    width: 140px;
    height: 220px;
  }
  
  .modern-card:not(:first-child) {
    margin-left: -30px;
  }
  
  .title {
    font-size: 0.9rem;
  }
  
  .bar {
    width: 100px;
  }
}

/* Card links (wrapper) */
.modern-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 5;
}

.modern-card-link:focus {
  outline: none;
}

.modern-card-link:focus .modern-card {
  box-shadow: 
    -1.5rem 0 4rem rgba(0, 0, 0, 0.9),
    0 15px 30px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(139, 0, 0, 0.3),
    0 0 20px rgba(255, 0, 0, 0.2),
    0 0 0 2px var(--neon-red); /* Focus outline */
}
