html, body {
  overflow-x: hidden !important;
  width: 100vw;
  max-width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Font', sans-serif;
    color: #ffffff;
    background-image: url('../assets/images/background.webp');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

header {
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 3em;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* Slideshow container styling */
.slideshow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* Full viewport height */
  z-index: 1; /* Ensure proper stacking context */
}

/* Slideshow images */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  object-fit: cover; /* Ensure images cover the container properly */
  z-index: 1;
}

/* Active slide */
.slide.active {
  opacity: 1;
  z-index: 2;
}

/* Logo positioning */
#logo-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%; /* Adjust size as needed */
  max-width: 500px;
  z-index: 1000; /* Very high z-index to ensure it's above everything */
  pointer-events: none; /* Allows clicking through the logo to elements below */
}

#main-logo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); /* Optional: adds depth */
}

/* For any interactive elements in your logo */
#logo-container button,
#logo-container a {
  pointer-events: auto; /* Re-enable pointer events only for interactive elements */
}

footer {
    text-align: center;
    padding: 20px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
}

/* Add these styles at the end of the file */

/* Journey Button */
.journey-button {
  position: fixed;
  bottom: 25%; /* Changed from 50% to 35% to move down */
  left: 50%;
  transform: translate(-50%, 50%); /* Center the button */
  padding: 25px 50px; /* Increased padding */
  background: rgba(75, 0, 130, 0.7);
  color: white;
  border: 4px solid #9370DB; /* Thicker border */
  border-radius: 45px; /* Larger radius */
  font-family: 'Space Font', sans-serif;
  font-size: 2.5em; /* Much larger font size (3x) */
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 0 25px rgba(147, 112, 219, 0.8); /* More prominent glow */
  text-transform: uppercase;
  letter-spacing: 2px;
}

.journey-button:hover {
  background: rgba(75, 0, 130, 0.9);
  box-shadow: 0 0 30px rgba(147, 112, 219, 1);
  transform: translate(-50%, 50%) scale(1.05);
}

/* Popup Container */
.popup-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.popup-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(white 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: 0 0, 25px 25px;
  animation: starTwinkle 4s linear infinite;
  opacity: 0.1;
}

/* Update the popup-content to control width */
.popup-content {
  position: relative;
  background-color: rgba(20, 10, 30, 0.95);
  border: 2px solid rgba(147, 112, 219, 0.8); 
  padding: 25px;
  border-radius: 10px;
  z-index: 300;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(147, 112, 219, 0.3);
  
  /* Add these constraints */
  max-width: 600px;
  width: 80%;
}

.popup-content h2, 
.popup-content h3,
.popup-content p {
  position: relative;
  z-index: 310; /* Even higher z-index */
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); /* Text shadow to improve readability */
  padding: 5px 0;
  margin: 10px 0;
  color: white;
  font-weight: normal;
}

/* Add special styling for headings */
.popup-content h2 {
  font-weight: bold;
  color: rgba(147, 112, 219, 1);
  border-bottom: 1px solid rgba(147, 112, 219, 0.4);
  padding-bottom: 15px;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.popup-content h3 {
  color: rgba(147, 112, 219, 0.9);
  margin-top: 20px;
  font-size: 1.3em;
}

/* Add a solid background panel behind all text */
#orgInfoText {
  background-color: rgba(20, 10, 30, 0.98); /* Very opaque background */
  padding: 15px;
  border-radius: 5px;
  border: 1px solid rgba(147, 112, 219, 0.3);
  max-height: 50vh;
  overflow-y: auto;
}

/* Override animation effects that might cause flickering */
.popup-content::before,
.popup-content::after {
  pointer-events: none;
  z-index: 290; /* Lower than content */
  content: none; /* Disable potentially problematic pseudo-elements */
}

/* Data stream specific fixes */
.data-stream {
  z-index: 100; /* Lower z-index */
  pointer-events: none;
}

/* Ensure the popup container doesn't cause flickering */
.popup-container {
  isolation: isolate; /* Create a stacking context */
  transform-style: flat; /* Don't preserve 3D for child elements */
}

/* Sci-Fi Close Button Styling */
#closePopup {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(20, 10, 30, 0.8);
  border: 2px solid #9370DB;
  border-radius: 50%;
  color: transparent;
  font-size: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 310;
  box-shadow: 0 0 10px rgba(147, 112, 219, 0.5);
  outline: none;
  animation: pulseRing 2s infinite; /* Add pulsing effect */
}

#closePopup:hover {
  background: rgba(75, 0, 130, 0.9);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 15px rgba(147, 112, 219, 0.9);
}

#closePopup::before,
#closePopup::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: white;
}

#closePopup::before {
  transform: rotate(45deg);
}

#closePopup::after {
  transform: rotate(-45deg);
}

/* Pulsing effect for the close button */
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(147, 112, 219, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(147, 112, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(147, 112, 219, 0); }
}