/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #fffefb;
  padding: 1rem 0;
}

/* FIXED A4 PAGE */
.page {
  width: 60rem; /* EXACT A4 width for html2pdf */
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* MOBILE: auto-scale A4 to fit screen */

/* WATERMARK — FIXED CENTERED */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22rem;
  height: 22rem;
  transform: translate(-50%, -50%); /* centered for desktop */
  background: url("assets/watermark2.webp") center/contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* MOBILE FIX — shift watermark slightly upward */
@media (max-width: 600px) {
  .watermark {
    top: 50%;
    left: 50%;
    transform: translate(130%, 50%); /* perfect mobile centering */
    width: 10rem; /* optional smaller watermark */
    height: 10rem;
  }
}

/* Keep all content above watermark */
.page > * {
  position: relative;
  z-index: 5;
}

/* Toast */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4d4f;
  padding: 1rem 1.4rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  display: flex;
  gap: 0.6rem;
  z-index: 9999;
  transition: 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, -1rem);
}

.toast-close {
  cursor: pointer;
  font-size: 1.4rem;
}

/* Loader styling */
.loader-container {
  width: 100%;
  text-align: center;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Loader animation */
.loader {
  width: 3rem;
  height: 3rem;
  border: 0.4rem solid #ddd;
  border-top-color: #1883c1;
  border-radius: 50%;
  animation: spinner 0.9s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Loader text */
.loader-text {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: #444;
  font-weight: 500;
}

/* Doctor container */
.doctor-container {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

#doctor-info h3 {
  font-size: 1.4rem;
  color: #333;
  font-weight: 600;
}

#doctor-info p {
  font-size: 1rem;
  color: #888;
  margin-top: 0.2rem;
}

.saya-logo {
  width: 14rem;
}

/* Gray line */
.gray-line {
  width: 100%;
  height: 0.1rem;
  background: #a6a6a6;
  margin: 1rem 0;
}

/* Patient Table */
.patient-table-wrapper {
  border: 1px solid rgba(102, 102, 102, 0.4);
  border-radius: 0.3rem;
  overflow: hidden;
  margin-top: 2rem;
}

.patient-table {
  width: 100%;
  border-collapse: collapse;
}

.patient-table th,
.patient-table td {
  padding: 0.6rem;
  font-size: 1rem;
  border: 0.1rem solid rgba(102, 102, 102, 0.4);
}

.patient-table th {
  color: #888;
  font-weight: 400;
}

.patient-table td {
  color: #333;
  font-weight: 500;
  text-transform: capitalize;
}

/* Complaints section */
#p-complaints {
  margin-top: 1rem;
  font-size: 1rem;
}

.complaint-section {
  margin-top: 2rem;
}

.complaint-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.complaint-header h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  color: #888;
}

.gray-line-complaint {
  flex: 1;
  height: 0.1rem;
  background: #a6a6a6;
}

/* Medicine Table */
.medicine-table-wrapper {
  margin-top: 1.6rem;
  border: 1px solid rgba(102, 102, 102, 0.4);
  border-radius: 0.4rem;
  overflow: hidden;
}

.medicine-table {
  width: 100%;
  border-collapse: collapse;
}

.medicine-table th,
.medicine-table td {
  padding: 0.6rem;
  border: 0.1rem solid rgba(102, 102, 102, 0.4);
  font-size: 1rem;
  text-transform: capitalize;
}

.medicine-table th {
  color: #888;
  font-weight: 500;
}

.medicine-table td {
  color: #333;
  font-weight: 500;
}

.drug-name {
  text-transform: uppercase !important;
}

/* Signature section */
.signature-section {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.doctor-signature {
  width: 8rem;
}

#doctor-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.slogan {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Disclaimer */
#disclaimer-container {
  margin-top: 3rem;
  background: #e7e7e7;
  padding: 1rem;
  border-radius: 0.4rem;
}

.disclaimer-list {
  margin-left: 1.4rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.6;
}

/* Download Button */
.download-btn {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  background: #1883c1;
  color: white;
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 0.3rem 0.6rem rgba(0, 0, 0, 0.15);
  font-weight: 500;
}

.download-btn:hover {
  background: #0f6fa4;
}
