/* Theme Animations CSS */

/* Winter Theme */
body[data-theme="winter"] {
  background: linear-gradient(135deg, #e6f7ff 0%, #cceeff 100%);
  transition: background 0.5s ease;
}

body[data-theme="winter"] .snowflake {
  position: fixed;
  top: -20px;
  color: #fff;
  font-size: 1.2em;
  user-select: none;
  z-index: 9998;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(360deg);
  }
}

/* Summer Theme */
body[data-theme="summer"] {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  transition: background 0.5s ease;
}

body[data-theme="summer"] .sun-ray {
  position: fixed;
  width: 2px;
  height: 20px;
  background: #ffd700;
  opacity: 0.7;
  z-index: 9998;
  pointer-events: none;
  animation: sunRay 2s infinite alternate;
}

@keyframes sunRay {
  from { height: 10px; opacity: 0.3; }
  to { height: 30px; opacity: 0.9; }
}

/* Rainy Theme */
body[data-theme="rainy"] {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  transition: background 0.5s ease;
}

body[data-theme="rainy"] .raindrop {
  position: fixed;
  width: 2px;
  height: 15px;
  background: rgba(255, 255, 255, 0.7);
  opacity: 0.7;
  z-index: 9998;
  pointer-events: none;
  animation: fallRain linear forwards;
}

@keyframes fallRain {
  to {
    transform: translateY(105vh);
  }
}

/* New Year Theme */
body[data-theme="newyear"] {
  background: linear-gradient(135deg, #7400b8 0%, #4ea8de 25%, #ff6b6b 50%, #ffbe0b 75%, #fb5607 100%);
  transition: background 0.5s ease;
}

body[data-theme="newyear"] .confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #fff;
  z-index: 9998;
  pointer-events: none;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

/* Christmas Theme */
body[data-theme="christmas"] {
  background: linear-gradient(135deg, #0d5c33 0%, #1a7a4c 100%);
  transition: background 0.5s ease;
}

body[data-theme="christmas"] .christmas-decoration {
  position: fixed;
  font-size: 1.5em;
  z-index: 9998;
  pointer-events: none;
  animation: float linear infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

/* Spring Theme */
body[data-theme="spring"] {
  background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
  transition: background 0.5s ease;
}

body[data-theme="spring"] .spring-petal {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #ff69b4;
  border-radius: 50%;
  z-index: 9998;
  pointer-events: none;
  animation: springPetalFall 4s linear forwards;
}

@keyframes springPetalFall {
  0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) translateX(20px) rotate(360deg); opacity: 0; }
}

/* Autumn Theme */
body[data-theme="autumn"] {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  transition: background 0.5s ease;
}

body[data-theme="autumn"] .autumn-leaf {
  position: fixed;
  font-size: 1.2em;
  z-index: 9998;
  pointer-events: none;
  animation: autumnFall 5s linear forwards;
}

@keyframes autumnFall {
  0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) translateX(30px) rotate(720deg); opacity: 0; }
}

/* Halloween Theme */
body[data-theme="halloween"] {
  background: linear-gradient(135deg, #232931 0%, #393e46 100%);
  transition: background 0.5s ease;
}

body[data-theme="halloween"] .halloween-spooky {
  position: fixed;
  font-size: 1.5em;
  z-index: 9998;
  pointer-events: none;
  animation: floatSpooky 3s infinite alternate;
}

@keyframes floatSpooky {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
  100% { transform: translateY(-15px) rotate(5deg); opacity: 0.4; }
}

/* Theme-specific button animations */
body[data-theme="winter"] button, body[data-theme="winter"] .btn {
  transition: all 0.3s ease;
  animation: winterGlow 2s infinite alternate;
}

@keyframes winterGlow {
  0% { box-shadow: 0 0 5px rgba(173, 216, 230, 0.5); }
  100% { box-shadow: 0 0 15px rgba(173, 216, 230, 0.8); }
}

body[data-theme="summer"] button, body[data-theme="summer"] .btn {
  transition: all 0.3s ease;
  animation: summerGlow 1.5s infinite alternate;
}

@keyframes summerGlow {
  0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
}

body[data-theme="rainy"] button, body[data-theme="rainy"] .btn {
  transition: all 0.3s ease;
  animation: rainyRipple 2s infinite alternate;
}

@keyframes rainyRipple {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

body[data-theme="newyear"] button, body[data-theme="newyear"] .btn {
  transition: all 0.3s ease;
  animation: newYearSparkle 1s infinite;
}

@keyframes newYearSparkle {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.9); }
}

body[data-theme="christmas"] button, body[data-theme="christmas"] .btn {
  transition: all 0.3s ease;
  animation: christmasTwinkle 1.5s infinite alternate;
}

@keyframes christmasTwinkle {
  0% { color: #fff; }
  100% { color: #ffd700; }
}

/* Hide theme elements when not active */
.snowflake, .sun-ray, .raindrop, .confetti, .christmas-decoration, .spring-petal, .autumn-leaf, .halloween-spooky {
  display: none;
}

/* Show theme elements when theme is active */
body[data-theme="winter"] .snowflake { display: block; }
body[data-theme="summer"] .sun-ray { display: block; }
body[data-theme="rainy"] .raindrop { display: block; }
body[data-theme="newyear"] .confetti { display: block; }
body[data-theme="christmas"] .christmas-decoration { display: block; }
body[data-theme="spring"] .spring-petal { display: block; }
body[data-theme="autumn"] .autumn-leaf { display: block; }
body[data-theme="halloween"] .halloween-spooky { display: block; }

/* Theme selector visibility */
.theme-selector {
  position: fixed;
  top: 50%;
  right: -300px;
  width: 280px;
  background: white;
  padding: 20px;
  border-radius: 10px 0 0 10px;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  z-index: 10000;
}

.theme-selector.active {
  right: 0;
}

.theme-toggle-btn {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  background: #007bff;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px 0 0 5px;
  cursor: pointer;
  z-index: 10001;
}