/* ==========================================================
   GLOBAL RESET & BASE
   ========================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: #fafafa;
  padding: 20px;
  color: #444;
  line-height: 1.5;
}

/* ==========================================================
   STICKY HEADER (logo only)
   ========================================================== */
.header {
  width: 100%;
  background: #fafafa;
  text-align: center;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #e6e6e6; /* subtle divider */
}

.logo {
  width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Add spacing below header so content doesn't sit under it */
body {
  padding-top: 0px; /* adjust if logo height changes */
}

/* Page title under header */
.page-title {
  font-size: 1.4rem;
  color: #ec619a;
  font-weight: 700;
  text-align: center;
  margin-top: 30px;
}

/* Subheader under title */
.subheader {
  font-size: 0.9rem;
  font-weight: 400;
  color: #444;
  max-width: 800px;
  margin: 10px auto 30px auto;
  text-align: center;
  line-height: 1.5;
  padding: 0 15px;
}

/* ==========================================================
   AD CONTAINERS
   ========================================================== */

/* Side Ad Containers */
.side-ad {
  position: fixed;
  top: 200px; /* ensures ads appear below the header */
  width: 300px;
  height: 600px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.left-ad {
  left: 10px;
}

.right-ad {
  right: 10px;
}

/* Ad images fill container nicely */
.ad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Hide ads on smaller screens */
@media (max-width: 1300px) {
  .side-ad {
    display: none;
  }
}

/* ==========================================================
   FORM CONTAINER
   ========================================================== */
.form-container {
  max-width: 920px;
  margin: auto;
  background: #fff;
  padding: 25px;
  border: 2px solid #ececec;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

.form-container h2 {
  color: #88cdd3;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Labels */
label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
  color: #444;
}

/* Required asterisk */
.required {
  color: #ec619a;
  font-weight: bold;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  border-color: #88cdd3;
  outline: none;
}

textarea {
  resize: vertical;
}

.info-icon {
  display: inline-block;
  background: #88cdd3;
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  line-height: 16px;
  cursor: pointer;
  margin-left: 6px;
  position: relative;
}

.info-icon:hover::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  width: 150px;
  height: 150px;
  background-image: var(--tooltip-img);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 50;
}

/* Pharmacy badge icon */
.pharm-icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  cursor: pointer;
  position: relative;
}

.pharm-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.9;
}

/* Tooltip for pharmacy badge */
.pharm-icon:hover::after {
  content: "Supplied by Avail Pharmacy";
  position: absolute;
  top: 22px;
  left: 0;
  padding: 6px 10px;
  background: #333;
  color: #fff;
  font-size: 12px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Header container so the button sits right */
.header-with-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Clear Form button styling */
.clear-btn {
  background-color: #88cdd3;      /* Avail teal */
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.clear-btn:hover {
  background-color: #6dbbc5;
}

/* ==========================================================
   ITEM ROWS
   ========================================================== */
.item-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 70px 180px 34px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}


/* Remove top margin inside item rows so inputs align */
.item-row input {
  margin-top: 0;
}

.remove-x {
  flex-shrink: 0;
}

/* Remove item X button */
.remove-x {
  width: 34px;
  height: 34px;
  border-radius: 50%;

  background: transparent;
  border: 2px solid transparent;

  color: #ec619a;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  position: relative;
  padding: 0;
}

/* Tooltip for remove button */
.remove-x::after {
  content: "Remove item";
  position: absolute;
  bottom: -36px;
  right: 50%;
  transform: translateX(50%);

  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

/* Show tooltip on hover */
.remove-x:hover::after {
  opacity: 1;
}

/* Add-again + button (fixed items) */
.add-again {
  width: 34px;
  height: 34px;
  border-radius: 50%;

  background: transparent;
  border: 2px solid transparent;

  color: #88cdd3;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  padding: 0;
  position: relative;
}

/* Tooltip for add-again (+) button */
.add-again::after {
  content: "Add line again";
  position: absolute;
  bottom: -36px;
  right: 50%;
  transform: translateX(50%);

  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

/* Show tooltip on hover */
.add-again:hover::after {
  opacity: 1;
}

/* Adjust when screen gets smaller */
@media (max-width: 600px) {
  .item-row {
    grid-template-columns: 1fr;
  }

  .qty-input {
    width: 100%;
  }
}

.qty-input {
  width: 70px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;

  /* Force black text */
  color: #000;
}

/* Prevent greyed placeholder */
.qty-input::placeholder {
  color: #000;
  opacity: 1;
}

/* Always show spinner arrows (Chrome / Edge / Safari) */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  opacity: 1;
  margin: 0;
}

.qty-input:focus {
  border-color: #88cdd3;
  outline: none;
}

/* Force identical height for qty + date inputs */
.qty-input,
.item-row input[type="date"] {
  height: 44px;
  padding: 10px;
  box-sizing: border-box;
}

/* ==========================================================
   "ADD NEW ITEM" BUTTON
   ========================================================== */
.add-btn {
  background: #88cdd3;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  color: white;
  font-weight: 600;
  margin-top: 10px;
  cursor: pointer;
  font-size: 15px;
}

.add-btn:hover {
  background: #6abac2;
}

/* ==========================================================
   SUBMIT BUTTON
   ========================================================== */
.submit-btn {
  background: #ec619a;
  padding: 14px;
  width: 100%;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  color: white;
  font-weight: bold;
  margin-top: 25px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: #d25785;
}

/* ==========================================================
   CONFIRMATION MESSAGE
   ========================================================== */
.confirmation {
  max-width: 600px;
  margin: 60px auto;
  background: #f7fbfb;
  border: 2px solid #88cdd3;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}

.confirmation h2 {
  color: #ec619a;
  font-size: 2rem;
  margin-bottom: 10px;
}

.confirmation p {
  color: #444;
  font-size: 1.1rem;
}

/* ==========================================================
   SMALL NOTE TEXT
   ========================================================== */
.note {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}
