* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* =====================
   Donate Page
   ใส่รูปพื้นหลังที่ images/background.jpg
===================== */

.donate-page {
  min-height: 100vh;

  background:
    linear-gradient(
      rgba(0, 0, 0, 0.45),
      rgba(0, 0, 0, 0.45)
    ),
    url("./images/background.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

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

  color: white;
}

.donate-card {
  width: 440px;
  max-width: 92vw;

  padding: 30px;

  background: rgba(0, 0, 0, 0.52);

  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  border: 1px solid rgba(255, 255, 255, 0.18);

  border-radius: 25px;

  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.55);
}

.donate-card h1 {
  text-align: center;
}

.donate-card p {
  text-align: center;
  opacity: 0.88;
}

.qr-box {
  text-align: center;
  margin: 18px 0;
}

.qr-box h3 {
  margin-bottom: 10px;
}

.qr-box img {
  width: 220px;
  max-width: 100%;
  padding: 10px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.25);
}

.small-note,
.warning-note {
  font-size: 13px;
  line-height: 1.5;
}

.warning-note {
  margin-top: 16px;
  color: #ffd166;
}

input,
textarea,
button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
}

input,
textarea {
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.35);
}

textarea {
  min-height: 100px;
  resize: none;
}

.file-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
  font-weight: bold;
}

button {
  background: #00d4ff;
  color: black;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background: #00ffcc;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

#ocrStatus {
  min-height: 20px;
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: #00ffcc;
}

/* =====================
   Overlay Page
===================== */

.overlay-page {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  color: white;
}

/* Goal */

#goalBox {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 350px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 15px;
}

#goalTitle {
  font-size: 20px;
  font-weight: bold;
}

#goalText {
  margin: 10px 0;
  font-size: 16px;
}

#goalBar {
  width: 100%;
  height: 20px;
  background: #333;
  border-radius: 20px;
  overflow: hidden;
}

#goalFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ff88, #00d4ff);
  transition: 0.5s;
}

/* Top Donator */

#topDonatorBox {
  position: absolute;
  top: 140px;
  left: 20px;
  min-width: 300px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 15px;
}

#topDonatorBox h3 {
  margin-top: 0;
}

#topDonatorName {
  font-size: 22px;
  font-weight: bold;
}

#topDonatorAmount {
  margin-top: 5px;
  font-size: 18px;
  color: gold;
}

/* Queue */

#queueCounter {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
}

/* =====================
   Alert กลางจอ
===================== */

#alertBox {
  position: fixed !important;

  top: 50% !important;
  left: 50% !important;

  right: auto !important;
  bottom: auto !important;

  width: 700px;
  max-width: 90vw;

  padding: 35px;

  background: rgba(0, 0, 0, 0.88);
  border-radius: 30px;

  text-align: center;

  opacity: 0;

  transform: translate(-50%, -50%) scale(0.7) !important;
  transition: all 0.5s ease;

  border: 1px solid rgba(255, 255, 255, 0.15);

  box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);

  z-index: 99999;
}

#alertBox.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) !important;
  animation: donationPulse 2s infinite;
}

#alertBox h2 {
  margin: 0;
  font-size: 40px;
  color: white;
}

#alertBox h3 {
  margin: 15px 0;
  font-size: 48px;
  font-weight: bold;
  color: #00d4ff;
  text-shadow:
    0 0 15px rgba(0, 212, 255, 0.8),
    0 0 30px rgba(0, 212, 255, 0.6);
}

#alertBox p {
  margin: 10px 0;
  font-size: 24px;
  line-height: 1.5;
  word-break: break-word;
}

@keyframes donationPulse {
  0% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 70px rgba(0, 212, 255, 1);
  }

  100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
}


/* =====================
   Mobile Responsive
===================== */

@media (max-width: 768px) {
  .donate-page {
    min-height: 100svh;
    padding: 18px;
    align-items: flex-start;
    background-attachment: scroll;
  }

  .donate-card {
    width: 100%;
    max-width: 520px;
    margin: 18px auto;
    padding: 22px;
    border-radius: 22px;
  }

  .donate-card h1 {
    font-size: 30px;
    margin: 0 0 10px;
  }

  .donate-card p {
    font-size: 16px;
  }

  .qr-box {
    margin: 20px 0;
  }

  .qr-box h3 {
    font-size: 20px;
  }

  .qr-box img {
    width: 280px;
    max-width: 90%;
  }

  .small-note,
  .warning-note {
    font-size: 15px;
  }

  input,
  textarea,
  button {
    font-size: 18px;
    padding: 15px;
    border-radius: 14px;
  }

  textarea {
    min-height: 130px;
  }

  .file-label {
    font-size: 16px;
  }

  #ocrStatus {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .donate-page {
    padding: 12px;
  }

  .donate-card {
    width: 100%;
    padding: 18px;
    margin: 10px auto;
  }

  .donate-card h1 {
    font-size: 26px;
  }

  .donate-card p {
    font-size: 15px;
  }

  .qr-box img {
    width: 250px;
  }

  input,
  textarea,
  button {
    font-size: 16px;
    padding: 14px;
  }

  textarea {
    min-height: 115px;
  }
}


/* =====================
   Split Overlay Pages
===================== */

.split-alert-page #alertBox {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
}

.split-goal-page #goalBox,
.split-top-page #topDonatorBox,
.split-queue-page #queueCounter {
  position: fixed;
}

.split-goal-page #goalBox {
  top: 20px;
  left: 20px;
}

.split-top-page #topDonatorBox {
  top: 20px;
  left: 20px;
}

.split-queue-page #queueCounter {
  top: 20px;
  left: 20px;
  right: auto;
}
