@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  background-image: url('images/background.png');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 15px;
  width: 100%;
}

.header-image {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.heading {
  display: none;
}

.main-container {
  display: flex;
  width: 90%;
  max-width: 1200px;
  gap: 30px;
  align-items: flex-start;
  margin-top: 20px; /* Reduced margin */
}

.jar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  flex: 1;
}

.jar {
  width: 224px;
  height: 304px;
  position: relative;
  perspective: 900px;
}

.jar-back, .jar-front {
  width: 224px;
  height: 304px;
  border-radius: 40% 40% 35% 35% / 50% 50% 70% 70%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.jar-back {
  z-index: 1;
  background: rgba(255, 250, 240, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.jar-front {
  z-index: 10;
  position: relative;
  background: rgba(255, 250, 240, 0.3);
  backdrop-filter: blur(2px);
  box-shadow: 
    inset -3px 0 0 0 rgba(255, 235, 210, 0.6),
    inset -2px -3px 0 0 rgba(255, 235, 210, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.jar-front:before {
  content: "";
  width: 32px;
  height: 200px;
  display: block;
  position: absolute;
  top: 24px;
  right: 40px;
  transform: rotate(-2deg);
  box-shadow: 8px 0 0 0 rgba(255, 245, 230, 0.5);
  border-radius: 50%;
}

.jar-top, .jar-top-back {
  width: 52%;
  height: 32px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -32px;
}

.jar-top {
  z-index: 12;
  background: rgba(255, 250, 240, 0.95);
  box-shadow: 
    inset 3px 0 0 0 rgba(200, 180, 160, 0.3),
    inset 1px -3px 0 0 rgba(200, 180, 160, 0.3);
  border-radius: 5px 5px 0 0;
  transform-origin: 50% 90%;
  transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.35, 1), box-shadow 300ms;
  border: 1px solid rgba(200, 180, 160, 0.3);
}

.jar-top::before, .jar-top::after {
  content: "";
  width: 55%;
  height: 4px;
  position: absolute;
  background: rgba(200, 180, 160, 0.5);
}

.jar-top::before {
  right: 0;
  top: 8px;
  border-radius: 8px 0 0 8px;
}

.jar-top::after {
  left: 0;
  bottom: 8px;
  border-radius: 0 8px 8px 0;
}

.jar-top-back {
  z-index: 1;
  background: rgba(255, 235, 210, 0.5);
  border-radius: 5px 5px 0 0;
}

.jar.open .jar-top {
  transform: translateY(-24px) translateX(-112px) rotate(15deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.stars-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 5;
  overflow: hidden;
  border-radius: 40% 40% 35% 35% / 50% 50% 70% 70%;
}

.star {
  position: absolute;
  background-color: white;
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%,
    79% 91%, 50% 70%, 21% 91%, 32% 57%,
    2% 35%, 39% 35%
  );
  opacity: 0.9;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

.star.popped {
  animation: popStar 2s forwards;
  z-index: 20;
}

@keyframes popStar {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 0.9;
  }
  20% {
    transform: translate(0, -100px) scale(1.2) rotate(90deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(100vw - 80px), -150px) scale(0.8) rotate(360deg);
    opacity: 0;
  }
}

/* Glass-like button styling */
.glass-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 105, 180, 0.4);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  width: 200px;
  padding: 14px 25px;
  margin-top: 15px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  backdrop-filter: blur(10px);
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
}

.glass-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(236, 64, 122, 0.4),
    rgba(186, 104, 200, 0.4),
    rgba(147, 112, 219, 0.4)
  );
  border-radius: 50px;
  z-index: -1;
  opacity: 0.7;
}

.glass-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 25px rgba(255, 105, 180, 0.5);
  border-color: rgba(255, 105, 180, 0.7);
  background: rgba(255, 255, 255, 0.2);
}

.glass-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 15px rgba(255, 105, 180, 0.4);
}

.glass-button:focus {
  outline: none;
  box-shadow: 0 4px 25px rgba(255, 105, 180, 0.6), 0 0 0 3px rgba(255, 105, 180, 0.25);
}

.button-text {
  letter-spacing: 0.5px;
  font-weight: 500;
}

.button-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.glass-button:hover .button-icon {
  transform: rotate(15deg) scale(1.2);
}

/* Original wisdom text styling (unchanged) */
.wisdom-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.wisdom-text {
  font-size: 22px;
  font-style: italic;
  font-weight: bold;
  color: white;
  opacity: 0;
  position: relative;
  display: inline-block;
  padding: 25px;
  border-radius: 15px;
  max-width: 500px;
  text-align: center;
  transition: opacity 1s ease;
  line-height: 1.6;
}

.wisdom-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 15px;
  z-index: -1;
}

.wisdom-text.show {
  opacity: 1;
}

/* Responsive design for smaller screens */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }
  
  .wisdom-container {
    min-height: 180px;
    width: 100%;
  }
  
  .wisdom-text {
    font-size: 19px;
    max-width: 90%;
    padding: 20px;
  }
  
  .glass-button {
    width: 180px;
    padding: 12px 22px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header-image {
    max-width: 200px;
  }
  
  .jar {
    width: 180px;
    height: 245px;
  }
  
  .jar-back, .jar-front {
    width: 180px;
    height: 245px;
  }
  
  .jar-top, .jar-top-back {
    height: 26px;
    top: -26px;
  }
  
  .jar.open .jar-top {
    transform: translateY(-20px) translateX(-90px) rotate(15deg);
  }
  
  .wisdom-text {
    font-size: 17px;
    padding: 18px;
    line-height: 1.5;
  }
  
  .glass-button {
    width: 160px;
    padding: 10px 20px;
    font-size: 0.95rem;
  }
  
  @keyframes popStar {
    0% {
      transform: translate(0, 0) scale(1) rotate(0deg);
      opacity: 0.9;
    }
    20% {
      transform: translate(0, -80px) scale(1.2) rotate(90deg);
      opacity: 1;
    }
    100% {
      transform: translate(calc(100vw - 60px), -120px) scale(0.8) rotate(360deg);
      opacity: 0;
    }
  }
}
