/* ==========================================================
   EHR Patient Intake - Preferred Pharmacy
   Modern Healthcare UI
========================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --white: #ffffff;
  --shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

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

/* .patient-info-wrapper{

    max-width:1300px;

    margin:auto;

    padding:35px;

    background:var(--bg);

} */

/*==========================================================
    Header
==========================================================*/

.pharmacy-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 20px 25px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
}

.header-left,
.header-right {
  width: 180px;
}

.header-right {
  display: flex;
  justify-content: flex-end;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1;
  text-align: center;
}

.header-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.header-content h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #1f2937;
}

.header-content p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 16px;
}

.previous-step,
.next-step {
  min-width: 140px;
  height: 46px;
  border-radius: 10px;
}

.header-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.header-content h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.header-content p {
  margin-top: 6px;
  color: var(--text-light);
  font-size: 16px;
}

/*==========================================================
    Progress Card
==========================================================*/

.step-progress-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px 25px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.step-title {
  font-weight: 600;
  color: var(--text);
}

.step-percent {
  color: var(--primary);
  font-weight: 700;
}

.progress {
  height: 10px;
  border-radius: 50px;
  background: #e5e7eb;
}

.progress-bar {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 50px;
}

/*==========================================================
    Search Card
==========================================================*/

.search-card {
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.search-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 25px;
}

.search-title i {
  color: var(--primary);
  margin-right: 8px;
}

.form-label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.input-group {
  border-radius: 12px;
  overflow: hidden;
}

.input-group-text {
  background: #fff;
  border-right: none;
}

.input-group-text i {
  color: #64748b;
}

.form-control {
  height: 52px;
  border-left: none;
  font-size: 16px;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.18rem rgba(79, 70, 229, 0.12);
}

.btn-primary {
  /* height:52px; */
  border: none;
  background: var(--primary);
  font-weight: 600;
  border-radius: 12px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.results-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 16px;
  color: var(--text-light);
}

/*==========================================================
    Pharmacy Result Card
==========================================================*/

.pharmacy-results {
  margin-top: 20px;
  max-height: 500px;
  /* Adjust height as needed */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */

.pharmacy-results::-webkit-scrollbar {
  width: 8px;
}

.pharmacy-results::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 20px;
}

.pharmacy-results::-webkit-scrollbar-thumb {
  background: #4f46e5;
  border-radius: 20px;
}

.pharmacy-results::-webkit-scrollbar-thumb:hover {
  background: #4338ca;
}

/* Firefox */

.pharmacy-results {
  scrollbar-width: thin;
  scrollbar-color: #4f46e5 #f3f4f6;
}

.pharmacy-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: 0.25s;
  flex-direction: row;
  flex-wrap: nowrap;
  align-content: stretch;
}

.pharmacy-item p {
  color: #4b5563 !important;
  font-size: 16px;
  margin-bottom: 4px;
}

.pharmacy-item h5 {
  color: #0f172a !important;
  font-weight: 600;
}

.pharmacy-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.12);
}

.pharmacy-left {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.pharmacy-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.pharmacy-details h5 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.pharmacy-details p {
  margin-bottom: 6px;
  color: var(--text-light);
  color: black;
  font-size: 16px;
}

.pharmacy-details i {
  width: 18px;
  color: var(--primary);
}

.select-btn {
  min-width: 120px;
  height: 46px;
  border-radius: 10px;
}

/*==========================================================
    Selected Pharmacy
==========================================================*/

.selected-card {
  margin-top: 20px;
  background: var(--success-bg);
  border-left: 5px solid var(--success);
  border-radius: 18px;
  padding: 25px;
}

.selected-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  font-weight: 700;
  color: #047857;
  font-size: 18px;
}

.selected-header i {
  margin-right: 8px;
}

#selectedContent h5 {
  margin-bottom: 8px;
}

#selectedContent p {
  margin-bottom: 5px;
  color: #374151;
}

.btn-outline-primary {
  border-radius: 10px;
}

/*==========================================================
    Empty State
==========================================================*/

.empty-results {
  background: #fff;
  padding: 50px;
  border-radius: 18px;
  text-align: center;
  color: #64748b;
  box-shadow: var(--shadow);
}

.empty-results i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

/*==========================================================
    Loading
==========================================================*/

.loading-box {
  background: #eff6ff;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: #1d4ed8;
  font-weight: 600;
}

/*==========================================================
    Footer
==========================================================*/

.wizard-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-footer .btn {
  min-width: 170px;
  height: 52px;
  border-radius: 12px;
  font-weight: 600;
}

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

@media (max-width: 991px) {
  .patient-info-wrapper {
    padding: 20px;
  }

  .pharmacy-page-header {
    flex-direction: column;
    text-align: center;
  }

  .progress-top {
    flex-direction: column;
    gap: 10px;
  }

  .pharmacy-item {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .select-btn {
    width: 100%;
  }

  .wizard-footer {
    flex-direction: column;
    gap: 15px;
  }

  .wizard-footer .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .search-card {
    padding: 20px;
  }

  .header-content h2 {
    font-size: 22px;
  }

  .header-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

.selected-pharmacy {
  border: 2px solid #4f46e5 !important;
  background: #eef2ff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

.selected-pharmacy .select-btn {
  background: #10b981;
  border-color: #10b981;
}

/* Skeleton Loader */

.skeleton {
  pointer-events: none;
  animation: pulse 1.4s infinite;
}

.skeleton-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e5e7eb;
}

.skeleton-line {
  height: 12px;
  background: #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
}

.skeleton-line.lg {
  width: 240px;
}

.skeleton-line.md {
  width: 180px;
}

.skeleton-line.sm {
  width: 120px;
}

.skeleton-btn {
  width: 100px;
  height: 42px;
  border-radius: 8px;
  background: #e5e7eb;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* Container Card & Layout */
.patient-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  padding: 2rem;
  border: 1px solid #f0f2f5;
}

/* Continue sits after the content (main.css places it); nothing floats
   up over the title any more (walkthrough re-check, Sep 28, 2026). */
.continue-btn-d {
  float: none;
  margin-top: 0;
  border-radius: 12px;
  padding: 0.5rem 1.5rem;
  font-weight: 700;
}

/* Card Headers */
.card-header-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.card-header-custom i {
  font-size: 1.5rem;
  color: var(--apns-primary);
  /* Modern medical purple accent */
}

.card-header-custom h4 {
  margin: 0;
  font-weight: 600;
  font-size: 1.25rem;
}

/* Search Form Alignment Controls */
.form-label {
  font-weight: 500;
  color: #4a5568;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.input-group {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--apns-primary);
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.15);
}

.input-group-text {
  background-color: #f8fafc;
  border: none;
  color: #64748b;
  padding-left: 1rem;
  padding-right: 0.75rem;
}

.input-group .form-control {
  border: none;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
}

.input-group .form-control:focus {
  box-shadow: none;
}

/* Search Buttons */
.btn-primary {
  background-color: var(--apns-primary);
  border-color: var(--apns-primary);
  border-radius: 10px;
  padding: 0.65rem 1.2rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #59339e;
  border-color: #59339e;
}

/* Fixes bottom alignment issues with unequal grid sizes */
.align-items-end {
  margin-bottom: 2px;
}

/* Results Metadata Banner */
.results-summary {
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--apns-panel-border);
  color: var(--apns-muted);
  font-size: 1rem;
}

.results-summary strong {
  color: #1e293b;
  font-size: 1.1rem;
}

/* Dynamic Pharmacy Results List Cards */
.pharmacy-results {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbar for Results Box */
.pharmacy-results::-webkit-scrollbar {
  width: 6px;
}

.pharmacy-results::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.pharmacy-results::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Clean Individual Dynamic Items Styling */
.pharmacy-result-card {
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.pharmacy-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05) !important;
  border-color: #cbd5e1 !important;
}

.pharmacy-result-card h5 {
  color: #1e293b !important;
  font-weight: 600;
  font-size: 1.05rem;
}

.pharmacy-result-card p {
  font-size: 1rem;
}

/* Active Selected Pharmacy Banner Card */
.selected-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.selected-header {
  color: #166534;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-header i {
  font-size: 1.1rem;
}

.btn-outline-primary {
  color: var(--apns-primary);
  border-color: var(--apns-primary);
  border-radius: 8px;
}

.btn-outline-primary:hover {
  background-color: var(--apns-primary);
  border-color: var(--apns-primary);
}

div#pharmacyResults {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 20px;
}

button.btn.btn-primary.select-btn.select-pharmacy {
  width: fit-content;
  font-size: 16px;
  min-height: 48px;
  max-width: max-content;
  min-width: fit-content;
}

.appointment-step .input-group input {
  padding: 0 12px !important;
  min-height: 48px;
}

.appointment-step .input-group {
  min-height: 48px;
}

button#searchPharmacyBtn {
  min-height: 48px;
  font-size: 16px;
}
