body {
  margin: 0;
  height: 101vh;
  min-height: 101vh;
  display: flex;
  flex-direction: column;
  /* stack header, avatar, controls vertically */
  justify-content: space-between;
  align-items: center;
  /* background: green; */
  background: url('../assets/santaBackground.png') no-repeat center center;
  background-size: cover;
  /* use the festive gradient snowflake image */
  color: white;
  font-family: 'Roboto', sans-serif;
  /* WhatsApp-like font */

}

.contact-name {
  font-size: 2.5rem;
  font-weight: 500;
  /* medium weight like WhatsApp */
}

/* Status line under the name */
.status-text {
  visibility: hidden;
  /* hidden but still takes up space */
  font-size: 1.7rem;
  font-weight: 400;
  color: #cfd8dc;
  /* light gray/blue like WhatsApp */
  margin-top: 2px;
}

/* Header text */
.header {
  margin-top: 50px;
  font-size: 1.8rem;
  /* font-weight: bold; */
  text-align: center;
}

/* Central avatar */
.avatar-container {
  flex: 1;
  /* push it into the middle */
  display: flex;
  align-items: center;
  justify-content: center;
}

#avatar-frame {
  display: none;
  /* hidden until call starts */
  position: fixed;
  /* sit on top of everything */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  /* fill screen like FaceTime/WhatsApp */
  background: black;
  /* fallback background */
  z-index: -1;
  /* sit behind controls */
  /* object-position: center; */
  object-position: 70% 50%;
  /* <-- center the stream horizontally & vertically */
  /* transform: scale(0.85); */
  /* smaller = zoomed out */

}

.avatar {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 5px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}

/* Control bar (bottom) */
.control-bar {
  width: 80vw;
  height: 25vw;
  max-height: 80px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  margin-bottom: 30px;

  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  transition: transform 0.2s;
}

/* .control-btn:hover {
  transform: scale(1.1);
} */

.control-btn.hangup {
  background-color: #e53935;
}

.control-btn.call {
  background-color: #43a047;
}

.control-btn.mute {
  background-color: #1e88e5;
}

/* strongest + simple: handles button + icon */
button.control-btn[disabled],
button.control-btn:disabled {
  background-color: #888 !important;
  /* override red/green/blue */
  opacity: 0.6;
  cursor: not-allowed;
}

/* also dim the icon itself */
button.control-btn[disabled] i,
button.control-btn:disabled i {
  filter: grayscale(100%) brightness(90%);
  opacity: 0.8;
}

/* muted look (grey) */
.control-btn.mute-muted {
  background-color: #888 !important;
}

/* Add this: festive pulse applied to the circular image itself */
.avatar.ringing {
  /* keep your existing border + look, just animate the ring */
  will-change: box-shadow;
  animation: xmasPulse 1.2s ease-in-out infinite;
}

/* Red → Green soft ring while preserving your existing drop shadow */
@keyframes xmasPulse {
  0% {
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.4),
      /* keep your base shadow */
      0 0 0 0 rgba(220, 20, 60, 0.75);
    /* crimson ring starts tight */
  }

  50% {
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.4),
      0 0 0 26px rgba(34, 139, 34, 0);
    /* forest green ring expands/fades */
  }

  100% {
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(220, 20, 60, 0);
    /* back to none */
  }
}

/* (Optional) respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .avatar.ringing {
    animation: none;
  }
}

/* Add pulsing effect to status text */
.status-text.ringing {
  animation: textPulse 1.8s ease-in-out infinite;
}

@keyframes textPulse {
  0% {
    opacity: 1;
    transform: scale(1);
    color: #fff;
  }

  50% {
    opacity: 0.6;
    transform: scale(1.05);
    color: #fff;
  }

  /* light red */
  100% {
    opacity: 1;
    transform: scale(1);
    color: #fff;
  }
}


.error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 15;
  padding: 20px;
  box-sizing: border-box;
}

.error-box {
  background: #1f1f1f;
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 90%;
  text-align: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

.error-box p {
  margin: 0;
}

.error-box .subtext {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 6px;
}

.notify-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* center child elements horizontally */
  gap: 12px;
  margin-top: 16px;
}

.notify-form input {
  width: 100%;
  max-width: 300px;
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #555;
  background-color: #2b2b2b;
  color: white;
  box-sizing: border-box;
}

.notify-form button {
  min-width: 140px;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  background-color: #28a745;
  /* Green */
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  align-self: center;
}

.notify-form button:hover {
  background-color: #218838;
  /* Darker green on hover */
}

.hidden {
  display: none !important;
}

.notify-form textarea {
  width: 100%;
  /* full width of the form */
  height: 150px;
  /* taller, like a block */
  padding: 10px;
  font-size: 1rem;
  resize: vertical;
  /* let the user resize up/down */
  border: 1px solid #ccc;
  border-radius: 4px;
}

.back-arrow-fixed {
  position: absolute;
  top: 8%;
  left: 20px;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
  font-size: 20px;
  z-index: 10;
  transition: opacity 0.2s ease;
}

.back-arrow-fixed:hover {
  opacity: 0.7;
}

/* .back-arrow {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background-color: #dc2626;
  color: white;
  border-radius: 50%;
  text-decoration: none;
  z-index: 10000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.back-arrow:hover {
  background-color: #b91c1c;
  transform: scale(1.1);
}

.back-arrow i {
  font-size: 18px;
} */

/* ============================= */
/* SANTA POPUP OVERLAY + FORM    */
/* ============================= */
/* ====================================================== */
/*  S A N T A   P R E - C A L L   F O R M   (ISOLATED)    */
/* ====================================================== */

#santaFormOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  /* form visible initially */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#santaFormOverlay.hidden {
  display: none !important;
}

#santaFormBox {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  padding: 26px 22px;
  font-family: "Roboto", sans-serif;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  animation: santaFadeIn 0.25s ease-out;
  color: black;
  /* override your global white font */
}

#santaFormBox h2 {
  margin: 0 0 18px 0;
  text-align: center;
  font-size: 22px;
  color: #c00000;
  font-weight: 700;
}

/* ---------- Input Fields ---------- */

#santaFormBox .santa-field {
  margin-bottom: 18px;
}

#santaFormBox .santa-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

#santaFormBox input,
#santaFormBox textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  background: #fafafa;
  color: black;
}

#santaFormBox input:focus,
#santaFormBox textarea:focus {
  border-color: #c00000;
  background: white;
}

/* ---------- Topic checkboxes ---------- */

#santaFormBox .topic-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 8px 0;
}

#santaFormBox .topic-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#santaFormBox .topic-option label {
  font-size: 15px;
  font-weight: 500;
  color: #222;
  cursor: pointer;
}

/* ---------- Reason Boxes (aligned under checkbox) ---------- */

#santaFormBox .topic-reason {
  margin-left: 28px;
  /* indent under checkbox */
  margin-top: 6px;
  margin-bottom: 14px;
}

#santaFormBox .topic-reason label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

#santaFormBox .topic-reason textarea {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fafafa;
  color: black;
}

/* ---------- Button ---------- */

#santaFormSubmit {
  width: 100%;
  padding: 12px;
  background: #c00000;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s ease;
}

#santaFormSubmit:hover {
  background: #a20000;
}

/* ---------- Animation ---------- */

@keyframes santaFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Hidden utility ---------- */

#santaFormBox .hidden {
  display: none !important;
}

/* ====================================================== */
/* FIX: Make Santa Form scrollable + mobile safe          */
/* ====================================================== */

#santaFormBox {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;

  /* Make the box scrollable */
  max-height: 85vh;
  overflow-y: auto;

  /* Create breathing room so it doesn't touch edges */
  margin-top: 20px;
  margin-bottom: 20px;

  padding: 26px 22px;
  font-family: "Roboto", sans-serif;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  animation: santaFadeIn 0.25s ease-out;
  color: black;

  /* Prevent background scrolling behind it on iOS Safari */
  -webkit-overflow-scrolling: touch;
}

/* Ensure overlay content stays centered on mobile */
#santaFormOverlay {
  padding: 20px;
  /* so box never touches edges */
  align-items: flex-start;
  /* avoid top/bottom cutoff */
}

/* Tighten layout slightly on small phones */
@media (max-height: 700px) {
  #santaFormBox {
    max-height: 90vh;
    padding: 18px 18px;
  }
}

@media (max-width: 400px) {
  #santaFormBox {
    padding: 18px 16px;
  }

  #santaFormBox h2 {
    font-size: 20px;
  }
}

/* ====================================================== */
/* FIX: Reliable Mobile Scrolling for Santa Form          */
/* ====================================================== */

#santaFormOverlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  /* Required for mobile Safari */
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
  box-sizing: border-box;

  overflow: hidden;
  /* Prevent whole page scroll */
  z-index: 9999;
}

/* SCROLLABLE BOX */
#santaFormBox {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;

  /* This is the critical fix */
  max-height: calc(100vh - 80px);
  /* leave room for margins */
  overflow-y: scroll;
  /* MUST be scroll not auto */
  -webkit-overflow-scrolling: touch;
  /* iOS momentum scrolling */

  padding: 24px 20px;
  margin: auto;
  /* keeps it centered vertically */

  color: black;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* On very small phones, tighten the padding */
@media (max-width: 400px) {
  #santaFormBox {
    padding: 18px 16px;
  }
}

/* Also adjust for short screens (landscape phones) */
@media (max-height: 700px) {
  #santaFormBox {
    max-height: calc(100vh - 40px);
    padding: 16px 16px;
  }
}

/* ========= Overlay ========= */
.postcall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.postcall-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========= Popup Box ========= */
.postcall-box {
  background: #ffffff;
  width: 90%;
  max-width: 420px;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

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

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

/* ========= Typography ========= */
.postcall-title {
  margin-top: 0;
  font-size: 1.6rem;
}

.postcall-subtext {
  font-size: 1rem;
  margin-bottom: 15px;
}

.postcall-section h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.postcall-section p {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #333;
}

/* ========= Buttons ========= */
.cta-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 6px;
  background: #e63946;
  color: white;
  font-weight: 600;
  transition: background 0.2s ease;
}

.cta-btn:hover {
  background: #cc2f3b;
}

.cta-btn.secondary {
  background: #457b9d;
}

.cta-btn.secondary:hover {
  background: #386f8c;
}

/* ========= Close Button ========= */
.close-btn {
  margin-top: 18px;
  background: transparent;
  border: none;
  font-size: 0.95rem;
  color: #666;
  cursor: pointer;
}

.close-btn:hover {
  color: #333;
}

/* ========= Feedback Link ========= */
.feedback-line {
  text-align: center;
  margin-top: 10px;
}

.feedback-line a {
  font-size: 0.85rem;
  color: #555;
  text-decoration: underline;
  opacity: 0.8;
}

.feedback-line a:hover {
  opacity: 1;
}

/* Prevent dark-mode auto inversion */
@media (prefers-color-scheme: dark) {
  .postcall-box {
    background: #ffffff !important;
  }

  .postcall-box * {
    color: #111 !important;
  }
}