/* ====== SKY BACKGROUND ====== */
body {
  background-image: url('../images/purple.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ====== ACTIVITY CARDS ====== */
.card.sad-card {
  background-color: #864a9c;
  min-height: 280px;
  border: none;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.card.sad-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 30px rgba(134, 74, 156, 0.35);
}

.card.sad-card .card-body {
  color: white;
  text-align: center;
  padding: 2rem;
}

/* ====== BUBBLES BACKGROUND ====== */
.bubbles-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -100px;
  border-radius: 50%;
  opacity: 0.4;
  animation: riseBubble linear infinite;
}

.bubble-1 {
  width: 40px;
  height: 40px;
  left: 10%;
  background: #f48fb1;
  animation-duration: 8s;
  animation-delay: 0s;
}

.bubble-2 {
  width: 60px;
  height: 60px;
  left: 30%;
  background: #ce93d8;
  animation-duration: 12s;
  animation-delay: 2s;
}

.bubble-3 {
  width: 30px;
  height: 30px;
  left: 50%;
  background: #f48fb1;
  animation-duration: 10s;
  animation-delay: 4s;
}

.bubble-4 {
  width: 50px;
  height: 50px;
  left: 70%;
  background: #ce93d8;
  animation-duration: 9s;
  animation-delay: 1s;
}

.bubble-5 {
  width: 35px;
  height: 35px;
  left: 90%;
  background: #f48fb1;
  animation-duration: 11s;
  animation-delay: 3s;
}

@keyframes riseBubble {
  0% {
    bottom: -100px;
    opacity: 0.4;
  }
  100% {
    bottom: 110%;
    opacity: 0;
  }
}

/* ====== SCROLLING TICKER ====== */
.ticker-wrapper {
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  margin-bottom: 20px;
}

.ticker-text {
  color: black;
  display: inline-block;
  animation: ticker 25s linear infinite;
  font-size: 1.2rem;
  font-weight: bold;
}

@keyframes ticker {
  0% {
    transform: translateX(30vw);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ====== OVERLAYS ====== */
#funnyOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
  z-index: 9999;
}

#funnyOverlay[hidden] {
  display: none;
}

.breathe-box {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 56rem);
  padding: clamp(1rem, 3vw, 2rem);
  gap: 30px;
}

.breathe-close {
  display: block;
  margin: 0 auto 20px;
  background: #9b59b6;
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(155, 89, 182, 0.3);
  border-top-color: #9b59b6;
  animation: spin 1s linear infinite;
  border-radius: 50%;
  margin: 20px auto;
}

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

/* ====== MUSIC OVERLAY ====== */
#sadMusicOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
  z-index: 9999;
}

#sadMusicOverlay[hidden] {
  display: none;
}

/* ====== POETRY OVERLAY ====== */
#poetryOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
  z-index: 9999;
}

#poetryOverlay[hidden] {
  display: none;
}

.poetry-box {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(100%, 38rem);
  max-width: 38rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.poetry-scroll {
  overflow: hidden;
  height: clamp(220px, 50vh, 300px);
  width: 100%;
}

.poetry-text {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  line-height: 1.8;
  font-style: italic;
  animation: scrollPoem 35s linear infinite;
  margin: 0;
}

@keyframes scrollPoem {
  0% {
    transform: translateY(300px);
  }
  100% {
    transform: translateY(-100%);
  }
}

/* ====== WORD CLOUD OVERLAY ====== */
#sadWordCloudOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
  z-index: 9999;
}

#sadWordCloudOverlay[hidden] {
  display: none;
}

#funnyVideo {
  width: min(100%, 56rem);
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

.sad-spotify-frame {
  width: min(100%, 38rem);
  max-width: 100%;
  border: 0;
  border-radius: 12px;
}

#sadWordCloudOverlay img {
  width: min(100%, 38rem);
  max-height: min(70vh, 42rem);
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .card.sad-card {
    min-height: auto;
  }

  .card.sad-card .card-body {
    padding: 1.5rem;
  }

  .ticker-text {
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .card.sad-card .card-body {
    padding: 1.25rem;
  }

  .breathe-box,
  .poetry-box {
    gap: 1rem;
  }
}

@media (min-width: 1400px) {
  .card.sad-card {
    min-height: 300px;
  }
}
