/* Base styles */
body {
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  background: #fff6ec;
  color: #4b2c20;
  margin: 0;
  padding: 0;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  z-index: 1;
  font-size: 16px; /* Base for rem scaling */
}

/* Main header */
header {
  background: #7f1d1d; /* rich crimson */
  color: #fbbf24; /* warm gold */
  padding: 1.5rem;
  z-index: 10;
  position: relative;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}
.main-title {
  font-size: 3rem;
  letter-spacing: 3px;
  margin: 0; /* Ensure no extra margins */
}

/* Petal container */
.sakura-falling {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}

/* Petal shapes (using CSS variables for size) */
.sakura {
  position: absolute;
  top: -10px;
  width: var(--size, 20px);
  height: var(--size, 20px);
  background:
    radial-gradient(circle at center, currentColor 40%, transparent 70%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.9;
  animation-name: fall, sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-direction: normal, alternate;
  color: inherit;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.15));
}
@keyframes fall {
  0% { top: -10px; opacity: 0.9; }
  100% { top: 100vh; opacity: 0.15; }
}
@keyframes sway {
  0% { transform: rotate(-4deg); }
  40% { transform: rotate(18deg); }
  100% { transform: rotate(2deg); }
}

/* Countdown container */
#countdown-container {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  margin: 1.5rem auto;
  color: #7f1d1d;
  font-weight: 700;
  font-size: 1.4rem;
  max-width: 90vw; /* Flexible width */
  gap: 0.5rem;
  letter-spacing: 1.5px;
  user-select: none;
  position: relative;
  z-index: 10;
}

#countdown {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

#countdown span {
  background: #fbbf24bb;
  padding: 0.5rem 1rem; /* Relative padding */
  border-radius: 8px;
  min-width: 6rem; /* Smaller min-width for mobile */
  box-shadow: 0 2px 6px #f1c040aa;
  color: #3b1a1a;
  font-size: 1rem;
  text-align: center;
}

/* Countdown icon */
#countdown-icon {
  font-size: 2.5rem;
  line-height: 1;
  color: #fbbf24;
  user-select: none;
}

/* Buttons wrapper */
.side-selector {
  position: relative;
  z-index: 10;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}

/* Common side button style */
.side-btn {
  border-radius: 12px;
  padding: 1.35rem 2.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
  user-select: none;
  max-width: 200px; /* Cap width for large screens */
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  margin-left: auto;
  margin-right: auto;
}

/* Images inside buttons */
.side-btn img {
  max-width: 90px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Bride button style (rose gold, pink) */
.side-btn.bride {
  background: linear-gradient(135deg, #b76e79, #e5b3b1);
  color: #381819;
  box-shadow: 0 6px 15px rgba(181, 139, 140, 0.8);
}
.side-btn.bride:hover {
  background: linear-gradient(135deg, #e5b3b1, #b76e79);
  transform: scale(1.08);
  color: #280d0d;
  box-shadow: 0 8px 25px rgba(213, 168, 153, 1);
}

/* Groom button style (deep crimson, gold) */
.side-btn.groom {
  background: linear-gradient(135deg, #7c1212, #b34026);
  color: #fdd88b;
  box-shadow: 0 6px 15px rgba(124, 18, 18, 0.8);
}
.side-btn.groom:hover {
  background: linear-gradient(135deg, #b34026, #7c1212);
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(176, 69, 38, 1);
  color: #fff1b8;
}

/* Download button */
.download-button {
  background: #a85c4c;
  color: #fff0f0;
  padding: 0.85rem 1.8rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 900;
  margin: 2.5rem 0 3.2rem 0;
  display: inline-block;
  transition: 0.3s ease;
  position: relative;
  z-index: 10;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 5px 12px rgba(168, 92, 76, 0.8);
}
.download-button:hover {
  background: #8f4337;
  box-shadow: 0 7px 18px rgba(143, 67, 55, 1);
}

/* Mute button for music */
.mute-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  background: #b34026;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  z-index: 10000;
}

/* Event page styles (moved from inline for consistency) */
.events-timeline {
  max-width: 90vw;
  margin: 2rem auto;
  font-family: 'Montserrat', sans-serif;
}
.event {
  background: rgba(255,255,255,0.75);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  cursor: default;
}
.event:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.event h3 {
  margin-top: 0;
}
.back-link {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  color: #ff00aa;
}
.back-link:hover {
  text-decoration: underline;
}

/* Responsive media queries */
@media (max-width: 768px) {
  .main-title {
    font-size: 2.5rem;
  }
  .side-selector {
    flex-direction: column;
    gap: 2.2rem;
    margin: 2rem auto;
    align-items: center;
  }
  .side-btn {
    width: 80vw;
    max-width: none;
    padding: 1rem 2rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .side-btn img {
    max-width: 70px;
  }
  #countdown-container {
    font-size: 1.2rem;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  #countdown span {
    min-width: 5rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  #countdown-icon {
    font-size: 2rem;
  }
  .events-timeline {
    max-width: 95vw;
    padding: 0 1rem;
  }
  .event {
    padding: 1rem;
  }
  header {
    padding: 1rem;
    font-size: 1.2rem;
  }
  header img {
    width: 40px;
    height: 40px;
  }
  .mute-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .main-title {
    font-size: 2rem;
    letter-spacing: 1px;
  }
  .side-btn {
    padding: 0.8rem 1.5rem;
  }
  .side-btn img {
    max-width: 60px;
  }
  #countdown-container {
    font-size: 1rem;
  }
  #countdown span {
    min-width: 4rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  #countdown-icon {
    font-size: 1.5rem;
  }
  .download-button {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }
  .event {
    font-size: 0.9rem;
  }
  .back-link {
    font-size: 1.1rem;
    left: 0.5rem;
  }
}
