/* Reset and Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse at center, #1e1e2f 0%, #0a0a23 100%);
  color: white;
  overflow-x: hidden;
  min-height: 100vh;
  padding: 1rem;
}

/* Flex Container */
.container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
}
/* =============================================================
Entire body background styling
============================================================= */
.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    z-index: -1;
}

@keyframes orbit {
    to {
        transform: rotate(360deg);
    }
}

/*=============================================================
Left Block Styling 
=============================================================*/

.left-block {
  position: relative;
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
  padding: 2rem 1rem;
  border-radius: 20px;
  /* Updated background for animation */
  background: linear-gradient(180deg, rgba(106, 48, 147, 0.7) 0%, rgba(160, 68, 255, 0.7) 50%, rgba(106, 48, 147, 0.7) 100%);
  background-size: 100% 250%; /* Make gradient taller than the block for vertical flow */
  color: white;
  overflow-y: auto;
  /* box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); /* Replaced by animation */
  z-index: 1;

  /* Apply new animations */
  animation:
    flowGradient 20s ease-in-out infinite, /* Slow flowing gradient */
    pulseGlow 3.5s ease-in-out infinite;    /* Moderate pulsating glow */
}

.left-quote {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #ffffff;
  text-align: justify;
  max-width: 65ch;
  margin: 0 auto;
  position: relative; /* Ensure text is above the ::before pseudo-element if needed */
  z-index: 1; /* Ensure text is above the ::before pseudo-element */
}

.left-block::before {
  content: "";
  position: absolute;
  inset: 0; /* Cover the entire block */
  border-radius: 20px; /* Match parent's border-radius */
  background: url(../assets/img/background-images/nebula.jpg) no-repeat center/cover;
  /* opacity: 0.15; /* Replaced by animation */
  pointer-events: none;
  z-index: 0; /* Behind the content like the quote */

  /* Apply new star twinkle animation */
  animation: starTwinkle 8s ease-in-out infinite;
}

/* A short cosmic story styling */
.subtitle-wrapper {
    width: 100%;
    overflow: hidden;
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative; /* Ensure text is above the ::before pseudo-element if needed */
    z-index: 1; /* Ensure text is above the ::before pseudo-element */
}
.subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffd369;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 211, 105, 0.5);
  text-transform: capitalize;
  animation: typewriter 4s steps(40, end), blink 0.5s step-end infinite alternate;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid white;
  max-width: 100%;
  /* position: relative; z-index: 1; Added to parent wrapper */
}

/*==========================================================
  Animation Keyframes for Effects
============================================================*/

/* For flowing gradient background on .left-block */
@keyframes flowGradient {
  0% { background-position: 50% 0%; }
  50% { background-position: 50% 100%; }
  100% { background-position: 50% 0%; }
}

/* For pulsating glow on .left-block */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2), /* Base shadow */
                0 0 15px rgba(160, 68, 255, 0.3), /* Lighter purple glow */
                0 0 25px rgba(106, 48, 147, 0.2); /* Darker purple glow */
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3), /* Base shadow slightly enhanced */
                0 0 25px rgba(160, 68, 255, 0.5), /* Lighter purple glow intensified */
                0 0 35px rgba(106, 48, 147, 0.35); /* Darker purple glow intensified */
  }
  100% {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2),
                0 0 15px rgba(160, 68, 255, 0.3),
                0 0 25px rgba(106, 48, 147, 0.2);
  }
}

/* For star twinkle on .left-block::before */
@keyframes starTwinkle {
  0% { opacity: 0.1; }
  33% { opacity: 0.25; } /* Brighter twinkle */
  66% { opacity: 0.05; } /* Dimmer twinkle */
  100% { opacity: 0.1; }
}

/* Typewriter and Blink keyframes (already existing, ensure they are present) */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink {
  from { border-right-color: transparent; }
  to { border-right-color: white; }
}

/* ==============================================================
Right Block Styling
Orbit Area Styling 
===================================================================*/
.orbit-wrapper {
  flex: 1;
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.orbit-path {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}
/* Chaitra S and sub content styling */
.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}
.orbit-center h1 {
  font-size: 2rem;
  color: #ffd369;
  text-shadow: 0 0 10px rgba(255,255,255,0.4);
  margin-bottom: 0.5rem;
}
.orbit-center p {
  font-size: 1rem;
  margin: 0.2rem 0;
}

/* orbiting-body is the animated moon ID.*/
.orbit-path {
  width: 100%;
  height: auto;
  display: block;
}

.orbiting-body {
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #fffacd, #ffd700); /* moon-like */
  border-radius: 50%;
  position: absolute;
  z-index: 10;
  box-shadow: 0 0 10px 5px rgba(255, 255, 150, 0.6);
  transform: translate(-50%, -50%);
}
.orbiting-body::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 5px;
  background: linear-gradient(to left, rgba(255,255,255,0.5), transparent);
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-radius: 50%;
}

/*==========================================================
Planet Styling 
============================================================*/
.planet-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.planet-link {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: auto;
  gap: 0.2rem;
  transition: transform 0.3s;
}

.planet-link img {
  width: clamp(10px, 6vw, 100px);
  height: clamp(10px, 6vw, 100px);
  transition: transform 0.3s ease;
}
.planet-link img:hover {
  transform: scale(1.2);
}

.planet-link span {
  font-size: 0.9rem;
  color: #ffd369;
  margin-top: 0.5rem;
  gap: 0.2rem;
  text-shadow: 0 0 10px rgba(255,255,255,0.4);
  font-weight: bold;
  
}
.planet-link:hover {
  transform: scale(1.1);
}

/*==================================================================
 Responsive Design 
 ===================================================================*/
/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
  .left-block {
    flex: 0 0 35%; /* Give left block a bit more space on tablets */
  }
}


 /* Small devices (landscape phones, tablets in portrait, 768px and down) */
@media (max-width: 768px) {
  body {
    padding: 0.5rem; /* Reduce body padding on smaller screens */
  }
  .container {
    flex-direction: column; /* Stack left and right blocks */
    /* height: auto; Allow container to grow as needed */
  }

  .left-block {
    flex: 1 1 100%; /* Make left block take full width */
    width: 100%;
    height: auto; /* Adjust height automatically */
    min-height: auto; /* Reset min-height or set a smaller one if needed */
    padding: 1.5rem 1rem;
    margin-bottom: 1rem; /* Add space between stacked blocks */
    /* overflow-y: visible; /* Or auto, depending on desired behavior */
  }

  .left-quote {
    font-size: 1rem;
    max-width: 90%; /* Allow text to use more of the width */
  }

  .subtitle {
    font-size: 1.3rem;
    /* animation: none; /* Optionally disable typewriter on mobile if it causes issues */
    /* white-space: normal; /* Allow wrapping if text is long */
    /* border-right: none; */
    /* overflow: visible; */
  }
  /* If keeping typewriter on mobile and it might overflow, consider this: */
  .subtitle-wrapper { /* You'd need to wrap .subtitle in a div with this class */
      width: 100%;
      overflow: hidden; /* This parent div would handle the overflow for the nowrap subtitle */
      text-align: center; /* Re-center if subtitle is inline-block */
  }


  .orbit-wrapper {
    flex: 1 1 100%; /* Make orbit wrapper take full width */
    width: 100%;
    height: 60vh; /* Fixed height for orbit area on mobile, adjust as needed */
    /* Or use a fixed pixel height like 500px if vh is problematic */
    /* height: 500px; */
    min-height: 350px; /* Ensure it's not too small */
  }

  .orbit-center h1 {
    font-size: 1.6rem;
  }
  .orbit-center p {
    font-size: 0.9rem;
  }

  .planet-link img {
    width: clamp(35px, 10vw, 60px); /* Adjust planet sizes for mobile */
    height: clamp(35px, 10vw, 60px);
  }
  .planet-link span {
    font-size: 0.8rem;
  }

  .orbiting-body {
    width: 15px;
    height: 15px;
  }
  .orbiting-body::after {
    width: 20px;
    height: 3px;
  }
  .home-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
  body {
    padding: 0.5rem 0.25rem; /* Further reduce padding */
  }
  .left-block {
    padding: 1rem 0.75rem;
  }
  .left-quote {
    font-size: 0.9rem; /* Slightly smaller text for very small screens */
  }
  .subtitle {
    font-size: 1.1rem; /* Smaller subtitle */
  }

  .orbit-wrapper {
    height: 50vh; /* Can adjust height again for smallest screens */
    /* height: 400px; */
    min-height: 300px;
  }

  .orbit-center h1 {
    font-size: 1.4rem;
  }
  .orbit-center p {
    font-size: 0.8rem;
  }

  .planet-link img {
    width: clamp(50px, 12vw, 50px); /* Further adjust planet sizes */
    height: clamp(50px, 12vw, 50px);
  }
  .planet-link span {
    font-size: 0.75rem;
  }

  .orbiting-body {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 6px 3px rgba(255, 255, 150, 0.6);
  }
  .orbiting-body::after { /* Smaller tail for smaller moon */
    width: 15px;
    height: 2px;
  }
}

/* Very small devices, optional adjustments */
@media (max-width: 360px) {
    .left-quote {
        font-size: 0.85rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .orbit-center h1 {
        font-size: 1.3rem;
    }
    .orbit-center p {
        font-size: 0.75rem;
    }
    .planet-link span {
      font-size: 0.7rem;
    }
}
