body {
  font-family: Georgia, serif;
  background-color: #fdf7f1;
  color: #4a3b2d;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* Ensure footer stays at bottom of page */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* pushes footer to bottom when content is short */
}

/* Header + Nav */
header {
  background-color: #e9d7b7;
  text-align: center;
  padding: 1.5rem 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0;
}

nav a {
  text-decoration: none;
  color: #4a3b2d;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
  background-color: #f2e6d9;
  color: #7b5e3b;
}

nav a.active-link {
  text-decoration: underline;
  color: #7b5e3b;
}

/* 🔐 Password Lock Screen */
.gallery-lock {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6rem 1rem;
  text-align: center;
}

.lock-box {
  background: #fff;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  max-width: 360px;
  width: 100%;
}

.lock-box input {
  width: 100%;
  padding: 0.6rem;
  margin: 0.8rem 0;
  border-radius: 6px;
  border: 1px solid #c9b8a8;
}

.lock-box button {
  padding: 0.6rem 1.2rem;
  background: #c29b72;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}
.lock-box button:hover {
  background: #a6794f;
}

.error {
  color: #b33636;
  margin-top: 0.5rem;
}

.hidden { display: none !important; }

/* Center the upload form cleanly */
.upload-form {
  max-width: 500px;
  margin: 2rem auto 1rem;
  text-align: center;
}

.upload-form input[type="file"] {
  margin: 0.5rem auto;
  display: block;
  width: fit-content; /* prevents it from stretching oddly */
}

.upload-form input[type="text"] {
  width: 90%;
  max-width: 300px;
  margin: 0.5rem auto;
  display: block;
  text-align: center;
}

.upload-form button {
  margin-top: 0.7rem;
}


.gallery-controls {
  max-width: 600px;
  margin: 0 auto 1rem;
  text-align: right;
}

.admin-btn {
  background-color: #c7a46b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-btn:hover {
  background-color: #a8854e;
}

.delete-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #c58a8a;
  color: #b54141;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ===== Edit Button (caption edit) ===== */
.edit-btn {
  position: absolute;
  top: 6px;
  right: 40px; /* leaves space beside delete button */
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  font-size: 14px;
  font-weight: bold;
  background: #f3d08a;
  color: #4a3b2d;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: 0.25s ease;
}

.admin-mode .edit-btn {
  opacity: 1;
}

.edit-btn:hover {
  transform: scale(1.12);
  background: #e6bd6a;
}

body.admin-mode .delete-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* ===========================
   ✏ Edit Caption Modal
=========================== */
#edit-caption-modal .modal-content.edit-caption-box {
  max-width: 420px;
  width: 90%;
  text-align: center;
  background: #fffdf8;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: fadeIn 0.3s ease;
}

#edit-caption-modal img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 1rem;
}

#edit-caption-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  padding: 0.6rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #c8b8a8;
  background: #fff;
  margin-bottom: 1rem;
}

#edit-caption-save {
  background-color: #c2a878;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
}

#edit-caption-save:hover {
  background-color: #a98755;
}

#edit-caption-cancel {
  background-color: #d7d7d7;
  color: #333;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
}

#edit-caption-cancel:hover {
  background-color: #bfbfbf;
}

/* Place admin button in top-right corner */
.lock-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1500;

  background-color: #c7a46b;
  color: white;
  font-size: 1.1rem;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: background-color 0.2s ease;
}

.lock-btn:hover {
  background-color: #a8854e;
}

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
}

.toast {
  background: #fffdf8;
  border: 1px solid #d2c1a8;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  font-size: 0.9rem;
  color: #4a3b2d;
  transform: rotate(-2deg);
  opacity: 0;
  animation: toast-in 0.3s ease forwards, toast-out 0.3s ease 3s forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) rotate(-4deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-2deg); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) rotate(-2deg); }
  to   { opacity: 0; transform: translateY(10px) rotate(-4deg); }
}

.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1500;
  justify-content: center;
  align-items: center;
}

.lightbox-modal.show {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-polaroid {
  background: #fffdf8;
  border: 1px solid #d2c1a8;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 14px 14px 24px;
  border-radius: 8px;
  text-align: center;
  max-width: 600px;
}

.lightbox-polaroid img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-polaroid p {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #4a3b2d;
  font-style: italic;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  color: #f5f5f5;
  cursor: pointer;
}

/* Gallery container + perspective wrapper */
.gallery-wrapper {
  perspective: 1000px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  justify-items: center;
  margin: 2rem auto;
  max-width: 1000px;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* Polaroid styling */
.polaroid {
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  width: 220px;
  padding: 10px;
  text-align: center;
  transform: rotate(var(--tilt, 0deg)) translateZ(0);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  transform-style: preserve-3d;
  cursor: pointer;
  overflow: hidden;
}

/* Distinct cozy scatter tilts */
/* Noticeably scattered tilt angles for authentic photo feel */
.polaroid:nth-child(5n+1) { --tilt: -14deg; }
.polaroid:nth-child(5n+2) { --tilt: 9deg; }
.polaroid:nth-child(5n+3) { --tilt: -12deg; }
.polaroid:nth-child(5n+4) { --tilt: 16deg; }
.polaroid:nth-child(5n+5) { --tilt: -9deg; }



/* Hover animation: lift, tilt, and pop */
.polaroid:hover {
  transform:
    rotateX(6deg)     /* smaller backward tilt */
    rotateY(-3deg)    /* smaller sideways tilt */
    translateY(-12px) /* lifts less */
    scale(1.07);      /* pops a bit less */
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
  z-index: 10;
}


/* Consistent photo size inside */
.polaroid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  pointer-events: none;
}



/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(6px);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

.modal-content {
  background: rgba(255,255,255,0.96);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  transform: translateY(-25px) scale(0.95);
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-content img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  margin-bottom: 1rem;
  object-fit: cover;
}

#modal-caption {
  width: 90%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #c2a878;
  font-size: 0.9rem;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: #5e503f;
  cursor: pointer;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-actions button {
  flex: 1 1 40%;
  min-width: 120px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #ffb347;
  color: white;
  font-weight: bold;
  transition: 0.2s;
}

.modal-actions button:hover {
  background-color: #ff9f00;
}

.spinner {
  text-align: center;
  margin-top: 1rem;
}

.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #555;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) rotate(var(--tilt, 0deg));
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(var(--tilt, 0deg));
  }
}

/* ===== FOOTER LAYOUT ===== */
footer {
  text-align: center;
  background-color: #e9d7b7;
  color: #4a3b2d;
  font-size: 0.9rem;
  padding: 1rem 0;
  margin-top: auto;
  width: 100%;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* ========= Handwritten Christmas Note ========= */

/* HANDWRITTEN NOTE */
.christmas-note {
  max-width: 640px;
  margin: 5rem auto 4rem; /* lowered spacing for better balance */
  padding: 2.8rem;
  background: url("images/assets/note.jpg") center/cover no-repeat;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
      0 18px 35px rgba(0,0,0,0.25),
      inset 0px 0px 18px rgba(255,255,255,0.45);
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: fadeInNote 1.2s ease-out forwards;

  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.20));
}

/* Optional Google Font for handwritten feel */
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

.note-title {
  font-family: "Patrick Hand", "Bradley Hand", cursive;
  font-size: 2rem;
  color: #b3542b;
  margin-bottom: 1.5rem;
}

.note-body {
  font-family: "Patrick Hand", "Bradley Hand", cursive;
  font-size: 1.25rem;
  color: #4a3b2d;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.note-signoff {
  font-family: "Patrick Hand", "Bradley Hand", cursive;
  font-size: 1.5rem;
  margin-top: 2rem;
  color: #7b5e3b;
}

/* Fade-in animation */
@keyframes fadeInNote {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.snowflake {
  position: fixed;
  top: -10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;

  background: white;
  box-shadow: 0 0 10px rgba(255,255,255,0.9); /* Glow so it's visible */
  opacity: 0.95;

  animation: fall linear infinite;
}

@keyframes fall {
  to { transform: translateY(110vh); }
}

/* PUSHPIN */
.pushpin {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;

  background: radial-gradient(circle, #d13939 0%, #8a1b1b 70%);
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 6px 10px rgba(0,0,0,0.35);
}

.handwritten-animation {
  overflow: visible !important;
}

/* Folded edges */
.christmas-note:before,
.christmas-note:after {
  content: "";
  position: absolute;
  width: 80px;
  height: 15px;
  background: rgba(255,255,255,0.5);
  bottom: -8px;
  transform: rotate(3deg);
  box-shadow: 0 8px 12px rgba(0,0,0,0.18);
}

.christmas-note:before { left: 20px; }
.christmas-note:after { right: 20px; transform: rotate(-3deg); }

.handwritten-animation p,
.handwritten-animation .note-signoff {
  opacity: 0;
  animation: handwriting 1.6s ease forwards;
}

.handwritten-animation p:nth-of-type(1) { animation-delay: 0.6s; }
.handwritten-animation p:nth-of-type(2) { animation-delay: 1.4s; }
.handwritten-animation .note-signoff { animation-delay: 2.6s; }

@keyframes handwriting {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sparkle-title {
  position: relative;
  display: inline-block;
  font-family: "Patrick Hand", "Bradley Hand", cursive;
  font-size: 2.4rem;
  color: #b3542b;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 9px rgba(255, 240, 220, 0.7);
}

.sparkle-title::after {
  content: "✨";
  position: absolute;
  right: -26px;
  top: -12px;
  animation: sparkle 1.6s infinite;
  font-size: 1.5rem;
}


@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.4) rotate(20deg); }
}


