/* Responsive styles for Liberation Engine */
.cover-image-container {
  width: 100%;
  max-width: 450px; /* Increased from 400px to match the screenshot */
  margin: 1.5rem auto !important; /* Added vertical margin plus auto horizontal centering */
  padding: 0;
  position: relative;
  display: flex;
  justify-content: center; /* Ensure horizontal centering */
  text-align: center;
  left: 0;
  right: 0;
}

.cover-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto; /* Center horizontally within container */
  border: 2px solid #00ffff;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4), 0 0 40px rgba(255, 0, 255, 0.2); /* Enhanced dual-color glow */
  filter: brightness(1.15) contrast(1.1);
  transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
  object-fit: contain;
  align-self: center; /* For flex container */
  position: relative;
  animation: flicker 2.5s infinite alternate; /* Faster flicker (3s to 2.5s) */
  padding: 3px; /* Added inner padding */
}

/* Add scanlines with pseudo-element */
.cover-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 50%, /* Increased contrast from 0.2 to 0.3 */
    rgba(0, 0, 0, 0) 51%,
    rgba(0, 0, 0, 0.3) 100% /* Increased contrast from 0.2 to 0.3 */
  );
  background-size: 100% 2px; /* Even smaller scanlines (2px instead of 3px) */
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.8; /* Increased opacity from 0.7 to 0.8 */
  border-radius: 8px;
  animation: scanline-drift 8s infinite linear; /* Faster animation (8s instead of 10s) */
}

/* Flickering effect */
@keyframes flicker {
  0%, 100% {
    opacity: 1;
  }
  5% {
    opacity: 0.85; /* More pronounced flicker (from 0.92 to 0.85) */
  }
  10% {
    opacity: 0.95;
  }
  15% {
    opacity: 0.78; /* More pronounced flicker (from 0.88 to 0.78) */
  }
  20% {
    opacity: 1;
  }
  21% {
    opacity: 0.88;
  }
  22% {
    opacity: 1;
  }
  55% {
    opacity: 0.75; /* More pronounced dip (from 0.85 to 0.75) */
  }
  56% {
    opacity: 0.95;
  }
  60% {
    opacity: 0.65; /* More significant flicker (from 0.75 to 0.65) */
  }
  61% {
    opacity: 0.95;
  }
  65% {
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  75% {
    opacity: 1;
  }
  80% {
    opacity: 0.8; /* More pronounced flicker (from 0.88 to 0.8) */
  }
  81% {
    opacity: 0.92;
  }
  95% {
    opacity: 0.85; /* More pronounced flicker (from 0.92 to 0.85) */
  }
}

/* Scanline drift animation */
@keyframes scanline-drift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100px; 
  }
}

/* Optimize for larger screens */
@media screen and (min-width: 992px) {
  .cover-image {
    max-height: 550px; /* Increased height for desktop (from 480px to 550px) */
  }
  .cover-image:hover {
    transform: scale(1.01); /* Very subtle zoom effect on hover */
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5); /* Enhanced glow on hover */
  }
}

/* Optimize for tablets */
@media screen and (max-width: 991px) and (min-width: 768px) {
  .cover-image {
    max-height: 420px; /* Increased height (from 370px to 420px) */
  }
}

/* Optimize for mobile devices */
@media screen and (max-width: 767px) {
  .cover-image {
    max-height: 380px; /* Increased height (from 330px to 380px) */
    border-width: 1px; /* Thinner border on mobile */
  }
}

/* Optimize for small mobile devices */
@media screen and (max-width: 480px) {
  .cover-image {
    max-height: 340px; /* Increased height (from 290px to 340px) */
  }
}

/* Optimize for high-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .cover-image {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.35);
  }
}

/* Handle dark mode preferences */
@media (prefers-color-scheme: dark) {
  .cover-image {
    filter: brightness(1.2) contrast(1.15);
  }
}

/* Handle reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cover-image {
    transition: none;
    animation: none !important; /* Disable flickering for users with motion sensitivity */
  }
  .cover-image::after {
    opacity: 0.25; /* Reduce scanline intensity */
  }
}

/* Add vaporwave-style digital noise to container */
.cover-image-container::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.0' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.75 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.08; /* Increased from 0.06 */
  z-index: 2; /* Place above image but below scanlines */
  pointer-events: none;
  border-radius: 12px;
  mix-blend-mode: overlay; /* Add blend mode for better effect */
  animation: noise 3s infinite alternate; /* Faster animation (4s to 3s) */
}

@keyframes noise {
  0%, 100% {
    opacity: 0.08;
  }
  15% {
    opacity: 0.12;
  }
  30% {
    opacity: 0.06;
  }
  45% {
    opacity: 0.1;
  }
  60% {
    opacity: 0.04;
  }
  75% {
    opacity: 0.11;
  }
  90% {
    opacity: 0.07;
  }
}

.cover-image-container::after {
  display: none;
}

@media (min-width: 992px) {
  .cover-image-container {
    margin-top: 2rem; /* Increased from 1.5rem */
    margin-bottom: 2rem; /* Decreased from 4.5rem to 2rem */
  }
}

/* Reduce content grid gap for tighter spacing */
.content-grid {
  gap: 2rem !important; /* Reduced from 4rem to 2rem for tighter spacing */
}

/* Additional spacing for centered alignment */
.tagline + .cover-image-container {
  margin-top: 2rem; /* Decreased spacing between tagline and image (from 4.5rem to 2rem) */
}

/* Make sure the main title container is properly centered */
.main-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem; /* Added padding around the entire main title section */
  margin: 1rem 0; /* Added vertical margin */
}
