/* ===== Base: lock page scroll, center layout ===== */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;   /* allow page to expand */
  overflow-x: hidden; /* prevent sideways scroll */
  overflow-y: auto;   /* enable vertical scroll */
  color-scheme: only light;
}

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background-color: #115741; /* green */
  color: #fff5e9;            /* light text */
  text-align: center;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.logo img { max-width: 150px; }

/* ===== Headings & total ===== */
h2, h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  margin: 0;
  color: #fff5e9;
}
.total-amount {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 2.6rem;
  margin: 0 0 6px;
  color: #ffb800; /* yellow */
}
.currency-lg { margin-right: 6px; letter-spacing: .3px; }

/* Donation form */
/* Donation form wrapper */
.donation-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 10px;          /* prevent touching screen edges */
  box-sizing: border-box;
}

/* Row for label + input */
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;         /* limit size even on big screens */
  margin: 0 auto;
}

/* Input container */
.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: #fff5e9;
  border: 2px solid #7a2f00;
  border-radius: 22px;
  padding: 6px 12px;
  min-width: 0;             /* let it shrink without overflow */
  box-sizing: border-box;
}

/* Currency */
.currency {
  color: #7a2f00;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;           /* prevent AU$ from shrinking */
}

/* Input itself */
.donation-form input {
  border: 0;
  outline: 0;
  background: none;
  font-size: 1rem;
  color: #115741;
  flex: 1;
  min-width: 0;
}

/* Button */
.donation-form button {
  width: 100%;
  max-width: 400px;         /* matches input */
  padding: 12px;
  background-color: #ffb800;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 800;
  color: #115741;
  cursor: pointer;
  box-sizing: border-box;
}


/* ===== Sections: title above, table grows downward ===== */
.section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 8px;
}

/* ===== Scrollable table boxes ===== */
.scroll-box {
  width: 100%;
  margin: 0;
  max-height: 600px;         /* adjust to taste */
  overflow-y: auto;          /* just let the table body scroll */
  border-radius: 10px;
  border: 2px solid #7a2f00;
  background: #fff5e9;
}

/* Table internals */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;       /* keep columns equal width */
  color: #115741;
}

.data-table thead {
  position: sticky;
  top: 0;
  background-color: #ffb800;
  color: #7a2f00;
  z-index: 1;
}

/* General table cells */
th, td {
  padding: 12px;
  text-align: center;
  border: 1px solid #7a2f00;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* default for most columns */
}

/* Name column: allow wrapping */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 20%;
  white-space: normal;
  word-break: break-word;
  text-align: left; /* optional: align names left for readability */
}

/* Amount column */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 20%;
}

/* Message column */
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 60%;
  white-space: normal;   /* also allow messages to wrap */
  word-break: break-word;
  text-align: left;      /* optional: left-align for text blocks */
}



/* ===== Modal (descriptions only) ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999; /* force above all other content */
}

.modal.show { display: block; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 92vw);
  background: #fff5e9;
  color: #115741;
  border: 2px solid #7a2f00;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  z-index: 10000; /* ensure above sticky table headers */
}

.modal-header {
  padding: 12px 16px;
  background: #ffb800;
  color: #7a2f00;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: #7a2f00;
}

.modal-body { padding: 16px; max-height: 55vh; overflow-y: auto; }
#descList { list-style: none; padding-left: 0; margin: 0; }
#descList li { margin: 6px 0; color: #115741; }

/* ===== Mobile tweaks ===== */
@media (max-width: 600px) {
  .container {
    display: flex;
    flex-direction: column;
    height: auto;      /* allow natural scrolling on mobile */
    padding: 12px;
    row-gap: 12px;
  }

  .total-amount {
    font-size: 1.8rem;
  }

  .donation-form {
    width: 100%;
    align-items: stretch;
  }
  .form-row {
    flex-direction: column;   /* stack label + input */
    align-items: stretch;
    gap: 6px;
  }
  .input-wrapper {
    width: 100%;              /* full width input */
    font-size: 1rem;
  }

  .scroll-box {
    max-height: 500px;        /* slightly smaller */
    overflow-x: auto;         /* allow sideways scroll */
  }
  .data-table {
    font-size: 0.85rem;
    min-width: 400px;         /* don’t shrink columns too small */
  }

  th, td {
    padding: 8px;
    white-space: normal;      /* allow wrapping on mobile */
    word-break: break-word;
  }

  .modal-card {
    width: 95vw;              /* almost full width */
    border-radius: 10px;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .donation-form button {
    max-width: 100%;
  }

}


/* Reuse modal base from earlier */
.modal-card.small {
  width: 360px;
}

.btn-option {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  background: #ffb800;
  color: #115741;
}
.btn-option:hover {
  background: #7a2f00;
  color: #fff5e9;
}

#cashForm input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 2px solid #7a2f00;
  border-radius: 6px;
}

#onlineForm textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 2px solid #7a2f00;
  border-radius: 6px;
  resize: vertical;
}

#onlineForm input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 2px solid #7a2f00;
  border-radius: 6px;
}

.back-btn {
  display: inline-block;
  position: absolute;
  top: 16px;
  left: 16px;
  background: #7a2f00; /* rust brown */
  color: #fff5e9;       /* light orange */
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.back-btn:hover {
  background: #ffb800; /* yellow/orange hover */
  color: #222;
}
