/* ====== HOLIDAY THEMES ====== */

/* CHRISTMAS THEME - Snowfall only, no background changes */
body.christmas-theme {
  /* Snowfall effect only, keeping original background */
}

/* Cute hot-chocolate cursor for festive mood */
/* Use a larger cursor hotspot and scope cursor to main content areas to avoid replacing input cursors */
body.christmas-theme .container,
body.christmas-theme .header-buttons,
body.christmas-theme .popular-exams-box,
body.christmas-theme .favorites-box {
  cursor: url("hot-chocolate.svg") 24 24, auto;
}

.dark-mode.christmas-theme .container,
.dark-mode.christmas-theme .header-buttons,
.dark-mode.christmas-theme .popular-exams-box,
.dark-mode.christmas-theme .favorites-box {
  cursor: url("hot-chocolate.svg") 24 24, auto;
}

/* ====== SNOWFALL EFFECT ====== */

.snowfall-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #87ceeb;
  font-size: 1.5em;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 5px rgba(135, 206, 235, 0.9);
  /* Use CSS vars so per-snowflake durations/delays don't get overridden by shorthand elsewhere */
  --fall-duration: 12s;
  --fall-delay: 0s;
  --sway-duration: 3s;
  --sway-delay: 0s;
  animation: fall var(--fall-duration) linear var(--fall-delay) infinite;
  opacity: 0.9;
}

.snowflake:nth-child(1) {
  left: 10%;
  --fall-duration: 10s;
  --fall-delay: 0s;
  font-size: 2em;
}

.snowflake:nth-child(2) {
  left: 20%;
  --fall-duration: 12s;
  --fall-delay: 1s;
  font-size: 2.5em;
}

.snowflake:nth-child(3) {
  left: 30%;
  --fall-duration: 14s;
  --fall-delay: 2s;
  font-size: 1.8em;
}

.snowflake:nth-child(4) {
  left: 40%;
  --fall-duration: 16s;
  --fall-delay: 3s;
  font-size: 2.8em;
}

.snowflake:nth-child(5) {
  left: 50%;
  --fall-duration: 13s;
  --fall-delay: 0.5s;
  font-size: 2.2em;
}

.snowflake:nth-child(6) {
  left: 60%;
  --fall-duration: 11s;
  --fall-delay: 1.5s;
  font-size: 2.4em;
}

.snowflake:nth-child(7) {
  left: 70%;
  --fall-duration: 15s;
  --fall-delay: 2.5s;
  font-size: 1.9em;
}

.snowflake:nth-child(8) {
  left: 80%;
  --fall-duration: 12s;
  --fall-delay: 0s;
  font-size: 2.3em;
}

.snowflake:nth-child(9) {
  left: 90%;
  --fall-duration: 14s;
  --fall-delay: 1s;
  font-size: 2.6em;
}

.snowflake:nth-child(10) {
  left: 5%;
  --fall-duration: 11s;
  --fall-delay: 2s;
  font-size: 1.7em;
}

.snowflake:nth-child(11) {
  left: 25%;
  --fall-duration: 13s;
  --fall-delay: 3s;
  font-size: 2.7em;
}

.snowflake:nth-child(12) {
  left: 35%;
  --fall-duration: 15s;
  --fall-delay: 0.5s;
  font-size: 2.1em;
}

.snowflake:nth-child(13) {
  left: 55%;
  --fall-duration: 12s;
  --fall-delay: 1.5s;
  font-size: 2.5em;
}

.snowflake:nth-child(14) {
  left: 65%;
  --fall-duration: 14s;
  --fall-delay: 2.5s;
  font-size: 1.8em;
}

.snowflake:nth-child(15) {
  left: 75%;
  --fall-duration: 11s;
  --fall-delay: 0s;
  font-size: 2.2em;
}

.snowflake:nth-child(16) {
  left: 15%;
  --fall-duration: 13s;
  --fall-delay: 1s;
  font-size: 2.4em;
}

.snowflake:nth-child(17) {
  left: 45%;
  --fall-duration: 15s;
  --fall-delay: 2s;
  font-size: 1.9em;
}

.snowflake:nth-child(18) {
  left: 85%;
  --fall-duration: 12s;
  --fall-delay: 1.5s;
  font-size: 2.3em;
}

.snowflake:nth-child(19) {
  left: 22%;
  --fall-duration: 14s;
  --fall-delay: 2.5s;
  font-size: 2.6em;
}

.snowflake:nth-child(20) {
  left: 95%;
  --fall-duration: 13s;
  --fall-delay: 0.5s;
  font-size: 1.7em;
}

@keyframes fall {
  from {
    top: -10px;
    transform: translateX(0) rotate(0deg);
    opacity: 0.8;
  }

  to {
    top: 100vh;
    transform: translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

/* Sway animation for more natural snowfall */
@keyframes sway {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(50px);
  }
}

/* Apply sway to some snowflakes (odd ones). Ensure fall keeps per-snowflake duration/delay. */
.snowflake:nth-child(odd) {
  animation: fall var(--fall-duration) linear var(--fall-delay) infinite,
    sway var(--sway-duration) ease-in-out var(--sway-delay) infinite;
}

/* Storm-specific tweaks */
.snowfall-container.storm {
  z-index: 9999;
}

.snowfall-container.storm .snowflake {
  color: #cfeeff;
  text-shadow: 0 0 8px rgba(200, 240, 255, 0.95);
  filter: drop-shadow(0 0 6px rgba(200, 240, 255, 0.5));
  opacity: 0.98;
}

.snowflake.storm-snowflake {
  /* Ensure storm flakes use CSS vars already provided via inline styles */
  animation: fall var(--fall-duration) linear var(--fall-delay) infinite,
    sway var(--sway-duration) ease-in-out var(--sway-delay) infinite;
}

/* ====== SUMMER THEME (for future use) ====== */
body.summer-theme {
  background: linear-gradient(135deg, #87ceeb 0%, #e0f6ff 100%) !important;
}

.summer-theme .container {
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid #ff9800;
}

.summer-theme h1,
.summer-theme h2,
.summer-theme h3 {
  color: #ff6b35;
}

.summer-theme #donate-btn {
  background-color: #ff9800;
}

.summer-theme #donate-btn:hover {
  background-color: #e68900;
}

/* Dark Mode with Holiday Themes */
.dark-mode.christmas-theme {
  /* Snowfall effect only, keeping original dark background */
}

.dark-mode.christmas-theme .container {
  /* No custom styling, keeping original */
}

.dark-mode.christmas-theme h1,
.dark-mode.christmas-theme h2,
.dark-mode.christmas-theme h3 {
  /* No custom styling, keeping original */
}

.dark-mode.christmas-theme .popular-exams-box,
.dark-mode.christmas-theme .favorites-box {
  /* No custom styling, keeping original */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .snowflake {
    font-size: 1em !important;
  }

  @keyframes fall {
    from {
      top: -10px;
      transform: translateX(0) rotate(0deg);
    }

    to {
      top: 100vh;
      transform: translateX(50px) rotate(360deg);
    }
  }
}

/* ====== CHRISTMAS MUSIC TOGGLE BUTTON ====== */
.music-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #1e90ff 0%, #87ceeb 50%, #1e90ff 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow:
    0 4px 15px rgba(30, 144, 255, 0.4),
    0 0 20px rgba(135, 206, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  animation: christmasGradient 3s ease infinite;
}

.music-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 6px 25px rgba(30, 144, 255, 0.5),
    0 0 30px rgba(135, 206, 235, 0.5),
    0 0 15px rgba(255, 255, 255, 0.4);
}

.music-toggle-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.music-toggle-btn .music-icon {
  font-size: 20px;
  display: inline-block;
  animation: musicBounce 0.5s ease infinite paused;
}

.music-toggle-btn.playing .music-icon {
  animation-play-state: running;
}

.music-toggle-btn.playing {
  background: linear-gradient(135deg, #00bfff 0%, #add8e6 50%, #00bfff 100%);
  animation: christmasGradient 2s ease infinite, pulseGlow 1.5s ease infinite;
}

@keyframes christmasGradient {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes musicBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-3px) rotate(-5deg);
  }

  50% {
    transform: translateY(0) rotate(0deg);
  }

  75% {
    transform: translateY(-3px) rotate(5deg);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow:
      0 4px 15px rgba(30, 144, 255, 0.4),
      0 0 20px rgba(135, 206, 235, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow:
      0 4px 25px rgba(0, 191, 255, 0.6),
      0 0 35px rgba(135, 206, 235, 0.5),
      0 0 20px rgba(255, 255, 255, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

/* Dark mode support */
.dark-mode .music-toggle-btn {
  box-shadow:
    0 4px 20px rgba(30, 144, 255, 0.5),
    0 0 25px rgba(135, 206, 235, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Responsive - smaller on mobile */
@media (max-width: 768px) {
  .music-toggle-btn {
    bottom: 15px;
    right: 15px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .music-toggle-btn .music-icon {
    font-size: 16px;
  }

  .music-toggle-btn .music-status {
    display: none;
  }
}