/* map.css */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f5f5f5;
}

h1 {
  text-align: center;
  margin: 20px 0;
  color: #333;
}

#controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

#controls label {
  font-weight: bold;
}

#controls input {
  width: 80px;
  padding: 4px;
}

#controls button {
  padding: 6px 12px;
  background-color: #0b0b48;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#controls button:hover {
  background-color: #0b0b48;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  color: #6b6b85;
  float: right;
  background: none;
  border: 0;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: #000;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0b0b48;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 10px;
}

.btn-primary {
  background-color: #0b0b48;
  color: white;
}

.btn-primary:hover {
  background-color: #0b0b48;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(11, 11, 72, 0.3);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.success-message {
  background-color: #edf7ee;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 20px;
  color: #1b5e20;
  text-align: center;
}

.success-message h3 {
  margin-top: 0;
  color: #1b5e20;
}

/* Top links */
.map-topbar {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px 0;
  font-size: 14px;
}

.map-topbar a {
  color: #0b0b48;
  text-decoration: none;
  font-weight: 600;
}

.map-unavailable {
  max-width: 760px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  background: #edf2ff;
  color: #1d1d88;
  border-radius: 8px;
  text-align: center;
}

/* Clinic list (no map, no location, or nothing nearby) */
.clinic-list-section {
  max-width: 760px;
  margin: 16px auto 32px;
  padding: 0 16px;
}

.clinic-list-notice {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  color: #9a3412;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 0 12px;
  font-size: 14px;
}

.clinic-search {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
}

.clinic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinic-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.clinic-list-item[hidden] {
  display: none;
}

.clinic-list-info h3 {
  margin: 0 0 4px;
  color: #0b0b48;
  font-size: 17px;
}

.clinic-list-info p {
  margin: 0;
  color: #555;
  font-size: 14px;
}

.clinic-list-info .clinic-list-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #333;
}

.clinic-list-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.clinic-list-actions .btn-primary,
.clinic-list-actions .btn-secondary {
  margin-right: 0;
  padding: 10px 14px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.clinic-list-actions .btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.clinic-list-empty {
  text-align: center;
  color: #666;
  padding: 24px;
}

.clinic-list-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #fae7eb;
  border: 1px solid #f3c1cc;
  color: #a10f29;
  border-radius: 8px;
  padding: 12px 16px;
}

/* How patients can join: badge on clinic cards, reason when online joining is closed */
.join-badge {
  display: inline-block;
  margin: 2px 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.join-badge-at-clinic {
  background: #edf2ff;
  color: #1d1d88;
}

.join-badge-desk {
  background: #f3e8ff;
  color: #6b21a8;
}

.join-badge-paused {
  background: #ffedd5;
  color: #9a3412;
}

.join-blocked-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff7ed;
  border-left: 3px solid #f97316;
  border-radius: 6px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.4;
}

.clinic-list-info .join-blocked-note {
  margin-top: 8px;
  color: #9a3412;
  font-size: 13px;
}

.clinic-list-actions a[hidden] {
  display: none;
}

.at-clinic-hint {
  background: #edf2ff;
  color: #1d1d88;
  border-left: 4px solid #4f73c0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 15px;
}

.join-blocked p {
  background: #fff7ed;
  color: #9a3412;
  border-left: 4px solid #f97316;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.join-blocked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.join-blocked-actions .btn-primary,
.join-blocked-actions .btn-secondary {
  margin-right: 0;
  text-align: center;
  text-decoration: none;
}

.join-blocked-actions a[hidden] {
  display: none;
}

.doctor-break-note {
  font-size: 12px;
  color: #9a3412;
  margin-top: 4px;
  font-weight: 600;
}

/* "+91" prefix in front of the guest phone input */
.phone-field {
  display: flex;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f3f4f6;
  border: 1px solid #ddd;
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-weight: bold;
  color: #333;
}

.form-group .phone-field input {
  flex: 1;
  min-width: 0;
  border-radius: 0 6px 6px 0;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

/* "Who is the visit for?": Myself / Someone else */
.visit-for-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-group label.visit-for-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 160px;
  margin: 0;
  padding: 10px 14px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.form-group .visit-for-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: #0b0b48;
}

.visit-for-option:has(input:checked) {
  border-color: #0b0b48;
  background: #edf2ff;
}

.visit-for-option:has(input:focus-visible) {
  outline: 2px solid #0b0b48;
  outline-offset: 2px;
}

#visitForGroup[hidden] {
  display: none;
}

/* Sessions: today's joining window, "Joining opens at …" and "Remind me" */
.join-window {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 2px 0 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #4b5563;
}

.clinic-list-info p.join-window {
  margin: 2px 0 6px;
  font-size: 13px;
}

.join-window-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9ca3af;
  transform: translateY(-1px);
}

.join-window.join-window-open { color: #1b5e20; }
.join-window-open .join-window-dot { background: #2e7d32; }
.join-window.join-window-soon { color: #9a3412; }
.join-window-soon .join-window-dot { background: #f97316; }
.join-window.join-window-closed { color: #4b5563; }

.clinic-list-info .clinic-list-hours {
  margin-top: 4px;
  font-size: 13px;
  color: #333;
}

.closed-join {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.joining-opens {
  display: inline-block;
  padding: 9px 12px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.remind-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 13px;
}

.closed-join .remind-box {
  margin-top: 0;
}

.remind-btn,
.remind-cancel {
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid #0b0b48;
  background: #fff;
  color: #0b0b48;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.remind-btn:hover { background: #edf2ff; }
.remind-btn:disabled,
.remind-cancel:disabled { opacity: 0.6; cursor: wait; }

.remind-cancel {
  border-color: #9ca3af;
  color: #374151;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 13px;
}

.remind-set {
  color: #1b5e20;
  font-weight: 600;
}

.remind-note {
  color: #4b5563;
  line-height: 1.4;
}

.remind-login {
  color: #0b0b48;
  font-weight: 600;
}

.join-blocked-remind {
  margin: -6px 0 14px;
}

.join-blocked-remind[hidden] {
  display: none;
}

.form-error .remind-box {
  margin-top: 8px;
}

.doctor-full-note {
  font-size: 12px;
  color: #a10f29;
  margin-top: 4px;
  font-weight: 600;
}

.doctor-card-off strong {
  color: #6b7280 !important;
}

.doctors-full-note {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  color: #9a3412;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  h1 {
    font-size: 24px;
    margin: 12px 0;
  }

  .clinic-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .clinic-list-actions .btn-primary,
  .clinic-list-actions .btn-secondary {
    flex: 1;
    text-align: center;
  }

  .modal-content {
    margin: 16px auto;
    padding: 20px;
    width: calc(100% - 32px);
    box-sizing: border-box;
  }

  .form-group .btn-primary,
  .form-group .btn-secondary {
    width: 100%;
    margin: 0 0 8px;
  }

  .join-blocked-actions .btn-primary,
  .join-blocked-actions .btn-secondary {
    flex: 1 1 100%;
  }

  .clinic-list-actions {
    flex-wrap: wrap;
  }

  .closed-join {
    flex: 1 1 100%;
  }

  .remind-btn {
    flex: 1 1 auto;
  }
}

/* "💬 Join on WhatsApp" (qc-wa-join.js) */
.btn-wa { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; background: #2e7d32; color: #fff !important; font-weight: 700; text-decoration: none; border: 0; }
.btn-wa:hover { background: #2e7d32; }
.btn-wa:focus-visible { outline: 3px solid #c8e6c9; outline-offset: 2px; }
.wa-join-box { margin: 8px 0 16px; padding: 12px 14px; border-radius: 10px; background: #edf7ee; border: 1px solid #c8e6c9; }
.wa-join-box p { margin: 0 0 10px; font-size: 14px; color: #1b5e20; }
.wa-join-box .wa-join-or { margin: 10px 0 0; color: #475569; font-size: 13px; text-align: center; }

/* Join form on one screen (laptops): the doctor on the left, the patient's details and Join on the right */
@media (min-width: 900px) {
  #queueModal .modal-content { max-width: 960px; width: 94%; margin-top: 3vh; margin-bottom: 3vh; padding: 24px 28px; }
  #queueForm:not([style*="none"]) { display: grid !important; }
  #queueForm { grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: start; grid-auto-flow: row dense; }
  #queueForm > * { grid-column: 2; }
  #queueForm > :not(.form-group):not(#doctor-selection-section) { grid-column: 1 / -1; }
  #queueForm > #doctor-selection-section { grid-column: 1; grid-row: span 8; margin-bottom: 0; }
  #queueForm .form-group { margin-bottom: 12px; }
}

/* "Track my place live" after a guest joins */
.track-live-btn { display: inline-flex; margin: 10px 0 6px; padding: 13px 26px; border-radius: 999px; text-decoration: none; font-weight: 700; }

/* Consent line above the Join button */
.join-consent { font-size: 13px; color: #4A4A6A; margin: 0 0 10px; }
.join-consent a { color: #0B0B48; font-weight: 700; }
