/* Fondo navideño con overlay */
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: url("../img/Background.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

/* Título */
h1 {
  margin-top: 40px;
  font-size: 3rem;
  color: #ffecb3;
  text-shadow: 2px 2px 10px #fff700;
  letter-spacing: 2px;
  animation: title-glow 2s infinite alternate;
}

@keyframes title-glow {

  0%,
  100% {
    text-shadow: 2px 2px 10px #fff200, 0 0 20px #fff700;
  }

  50% {
    text-shadow: 2px 2px 15px #ffecb3, 0 0 25px #fff200;
  }
}

/* Cuadrícula del calendario */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  position: relative;
}

/* Casillas */
.day {
  background: linear-gradient(145deg, #ff0000, #ff9500);
  padding: 25px;
  text-align: center;
  cursor: pointer;
  border-radius: 12px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  border: 4px solid #ffd6a1;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
}

/* Bordes tipo “cinta de regalo” */
.day::before,
.day::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  background: gold;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 10px gold, 0 0 20px gold;
  pointer-events: none;
  opacity: 0.7;
}

.day::after {
  width: 4px;
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Hover animado */
.day:hover {
  transform: scale(1.1);
  background: linear-gradient(145deg, #1eff00, #ff0000);
  box-shadow: 0 0 25px 5px gold;
}

/* Casilla bloqueada */
.day.locked {
  background: linear-gradient(145deg, #555, #777);
  opacity: 0.6;
  border: 4px solid #999;
  cursor: pointer;
}

/* Casilla actual */
.day.today {
  border: 4px solid #ffff00;
  box-shadow: 0 0 25px 10px yellow;
  animation: bounce 1.5s infinite alternate;
}

@keyframes bounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: fadeIn 0.5s;
}

.modal img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 15px;
  border: 4px solid white;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
  animation: slideUp 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Botón cerrar */
#close {
  position: absolute;
  top: 40px;
  right: 60px;
  font-size: 3rem;
  cursor: pointer;
  color: white;
  text-shadow: 2px 2px 10px black;
  transition: 0.2s;
}

#close:hover {
  transform: scale(1.2);
  color: #ffbfbf;
}

/* Nieve capa 1 y 2 */
.snowflake,
.snowflake2 {
  position: fixed;
  top: -10px;
  user-select: none;
  z-index: 9999;
  color: rgb(255, 255, 255);
  animation-iteration-count: infinite;
}

.snowflake {
  font-size: 20px;
  animation: snowfall linear infinite;
}

.snowflake2 {
  font-size: 30px;
  animation: snowfall2 linear infinite;
  opacity: 0.5;
}

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

  100% {
    transform: translateY(100vh);
  }
}

@keyframes snowfall2 {
  0% {
    transform: translateY(-200px);
  }

  100% {
    transform: translateY(100vh);
  }
}

/* Confetis/emojis cayendo */
.confetti {
  position: fixed;
  top: -50px;
  pointer-events: none;
  z-index: 9999;
  font-size: 20px;
  animation-iteration-count: infinite;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0.8;
  }
}

.trail {
  position: fixed;
  pointer-events: none;
  font-size: 24px;
  /* tamaño del emoji */
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0.8;
  transition: transform 0.1s, opacity 0.3s;
}


/* CONTENIDOR DEL CALENDARI (marc) */
.calendar-wrapper {
  width: 90%;
  max-width: 1100px;
  margin: 50px auto;
  padding: 40px;
  border: 8px solid rgb(255, 111, 0);
  border-radius: 25px;
  background: rgba(6, 75, 8, 0.55);
  backdrop-filter: blur(4px);
  position: relative;
  box-shadow: 0 0 25px gold, inset 0 0 30px rgba(255, 255, 255, 0.2);
  animation: frameGlow 2s infinite alternate;
}

/* Brillo daurat animat del marc */
@keyframes frameGlow {
  0% {
    box-shadow: 0 0 15px gold, inset 0 0 10px rgba(255, 255, 255, 0.2);
  }

  100% {
    box-shadow: 0 0 40px gold, inset 0 0 30px rgba(255, 255, 255, 0.4);
  }
}


/* 🎀 Cinta nadalenca al voltant */
.calendar-wrapper::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
  background: repeating-linear-gradient(45deg,
      red 0px, red 10px,
      green 10px, green 20px);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 0 15px red;
}

/* 🎁 Llaços a les cantonades */
.ribbon {
  position: absolute;
  width: 40px;
  height: 40px;
  background: red;
  transform: rotate(45deg);
  box-shadow: 0 0 15px rgb(4, 255, 0);
  border-radius: 8px;
}

.ribbon::before,
.ribbon::after {
  content: "";
  position: absolute;
  background: red;
  width: 40px;
  height: 12px;
  top: 14px;
  left: -10px;
  transform: rotate(90deg);
  border-radius: 4px;
  box-shadow: 0 0 15px red;
}

/* 4 cantonades */
.ribbon.top-left {
  top: -20px;
  left: -20px;
}

.ribbon.top-right {
  top: -20px;
  right: -20px;
}

.ribbon.bottom-left {
  bottom: -20px;
  left: -20px;
}

.ribbon.bottom-right {
  bottom: -20px;
  right: -20px;
}

/* 🎄 Footer Nadalenc */
.xmas-footer {
  margin-top: 80px;
  padding: 30px 10px;
  background: rgba(0, 0, 0, 0.65);
  border-top: 4px solid gold;
  position: relative;
  text-align: center;
  color: #ffdca8;
  font-family: "Poppins", sans-serif;
  backdrop-filter: blur(4px);
}

/* Títol */
.footer-title {
  font-size: 1.7rem;
  font-weight: bold;
  margin-bottom: 5px;
  text-shadow: 0 0 10px gold;
}

/* Copyright */
.footer-copy {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Llumetes */
.footer-lights {
  margin-top: 15px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Animació de parpelleig */
.footer-lights span {
  animation: blink 1.2s infinite alternate;
}

.footer-lights span:nth-child(odd) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.3);
  }
}