/*
 * MedLink patient Blade dashboard.
 *
 * Reproduces the palette and visual language of the Claude Design handoff
 * ("MedLink Web" — mint canvas, navy/teal gradient crown, white cards with
 * one soft shadow and no border, pill CTAs, Tajawal, RTL) using Bootstrap 5
 * RTL as the layout engine rather than the design prototype's own markup.
 *
 * Loaded after Bootstrap so these colours and type win over Reboot. Scoped
 * to `.ml-patient` so nothing here leaks into the Tailwind-based staff and
 * admin views (mirrors public/css/home/home.css's own scoping rule).
 */

.ml-patient {
  --ml-navy: #0f2e4a;
  --ml-deep: #004655;
  --ml-teal: #399391;
  --ml-teal-dark: #256868;
  --ml-teal-pale: #e5f5f4;
  --ml-canvas: #e9f8f7;
  --ml-grey: #f3f4f5;
  --ml-line: #f0f3f3;
  --ml-muted: #8a9aa3;
  --ml-body: #5c6b73;
  --ml-danger: #d94b48;
  --ml-danger-pale: #fbecec;
  --ml-warn: #a9761e;
  --ml-warn-pale: #fdf6e6;

  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  background: var(--ml-canvas);
  color: var(--ml-navy);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.ml-patient h1, .ml-patient h2, .ml-patient h3, .ml-patient h4 { color: var(--ml-navy); }
.ml-patient a { color: var(--ml-teal-dark); text-decoration: none; }
.ml-patient a:hover { color: var(--ml-teal); }

.ml-main { min-height: calc(100vh - 74px); }

/* Offsets the sticky navbar so an anchor jump/scroll to the doctors list
   doesn't land with its heading hidden underneath it. */
#ml-doctors-section { scroll-margin-top: 84px; }

/* Top nav */
.ml-navbar {
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 46, 74, .07);
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.ml-nav-link {
  border-radius: 24px;
  padding: .55rem 1.1rem !important;
  font-weight: 500;
  color: var(--ml-navy) !important;
}
.ml-nav-link.active {
  background: var(--ml-teal-pale);
  color: var(--ml-teal-dark) !important;
  font-weight: 700;
}
/* Kept short at mobile widths (icon-only) so it never crowds the logo/hamburger. */
#mlNavSearchDoctors { white-space: nowrap; flex: none; }

/* Narrow phones: logo + this button + hamburger share one row, so the label
   shrinks rather than disappearing — losing the word "بحث" here made the
   button meaningless at a glance. */
@media (max-width: 400px) {
  #mlNavSearchDoctors { padding: .3rem .55rem; font-size: .72rem; gap: .3rem !important; }
}
.ml-account-chip {
  background: var(--ml-grey);
  border-radius: 26px;
  padding: .35rem .5rem .35rem .9rem;
  color: var(--ml-navy);
}
.ml-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ml-navy); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; flex: none;
}
.ml-account-name { font-weight: 700; font-size: .9rem; }
.ml-logout-btn { color: var(--ml-danger); border: none; background: none; }
.ml-logout-btn:hover { color: var(--ml-danger); background: var(--ml-danger-pale); border-radius: 50%; }

/* Hero / crown */
.ml-crown {
  background: linear-gradient(140deg, var(--ml-navy), var(--ml-deep));
  color: #fff;
}
.ml-crown h1, .ml-crown h2, .ml-crown h3, .ml-crown h4, .ml-crown p { color: #fff; }
.ml-crown-mobile { border-radius: 0 0 28px 28px; }

/* Cards, buttons, chips */
.ml-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 3px 14px rgba(15, 46, 74, .06);
  border: none;
}
.ml-card-lg { border-radius: 26px; box-shadow: 0 4px 18px rgba(15, 46, 74, .07); }

.btn.ml-btn-primary {
  background: var(--ml-teal-dark);
  border-color: var(--ml-teal-dark);
  color: #fff;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(37, 104, 104, .24);
}
.btn.ml-btn-primary:hover, .btn.ml-btn-primary:focus {
  background: var(--ml-navy);
  border-color: var(--ml-navy);
  color: #fff;
}
.btn.ml-btn-primary:disabled { opacity: .5; box-shadow: none; }

.btn.ml-btn-outline {
  border-radius: 30px;
  border: 1.5px solid #c4cbcc;
  color: var(--ml-navy);
  background: #fff;
  font-weight: 700;
}
.btn.ml-btn-danger-outline {
  border-radius: 30px;
  border: 1.5px solid #f0d6d5;
  color: var(--ml-danger);
  background: #fff;
  font-weight: 700;
}
.btn.ml-btn-danger-outline:hover { background: var(--ml-danger-pale); color: var(--ml-danger); }

.ml-pill {
  border-radius: 22px;
  padding: .5rem .9rem;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.ml-pill-idle { background: #fff; color: var(--ml-navy); box-shadow: 0 2px 8px rgba(15,46,74,.05); }
.ml-pill-active { background: var(--ml-navy); color: #fff; }

.ml-input-group {
  display: flex; align-items: center; gap: .6rem;
  background: var(--ml-grey);
  border-radius: 18px;
  padding: 0 1rem;
  height: 54px;
}
.ml-input-group input, .ml-input-group .ml-input-value {
  border: none; background: transparent; flex: 1; font-weight: 500;
  color: var(--ml-navy);
}
.ml-input-group input:focus { outline: none; box-shadow: none; }
.ml-input-group.is-focused {
  background: #fff;
  border: 2px solid var(--ml-teal);
  box-shadow: 0 0 0 4px rgba(57, 147, 145, .13);
}

/* Live queue number + status */
.ml-queue-number { font-weight: 800; line-height: 1; color: var(--ml-navy); }
.ml-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ml-teal);
  display: inline-block;
  animation: ml-pulse 1.7s ease-in-out infinite;
}
@keyframes ml-pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1; transform: scale(1); }
}

/* Booked-appointment card */
.ml-visit-card { border-inline-start: 4px solid var(--ml-teal); }
.ml-visit-status {
  background: var(--ml-teal-pale);
  color: var(--ml-teal-dark);
}

.ml-track-step { display: flex; gap: .8rem; align-items: flex-start; }
.ml-track-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
}
.ml-track-dot.is-done { background: var(--ml-teal); color: #fff; }
.ml-track-dot.is-current { background: var(--ml-teal-pale); border: 2px solid var(--ml-teal); }
.ml-track-dot.is-pending { border: 2px solid #c4cbcc; opacity: .55; }

/* Day picker */
.ml-daygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
@media (min-width: 992px) { .ml-daygrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ml-day {
  border-radius: 14px;
  padding: .8rem .5rem;
  text-align: center;
  cursor: pointer;
  background: #f3f5f6;
  color: var(--ml-navy);
  border: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  line-height: 1.3;
}
.ml-day strong { font-size: .9rem; font-weight: 700; }
.ml-day span { font-size: .78rem; color: var(--ml-muted); }
.ml-day.is-selected {
  background: var(--ml-navy);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 46, 74, .22);
}
.ml-day.is-selected span { color: rgba(255, 255, 255, .82); }

/* Doctor cards */
.ml-doctor-avatar {
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--ml-teal-pale);
  color: var(--ml-teal-dark);
  display: grid; place-items: center; flex: none;
  font-size: 1.6rem;
}
.ml-badge-open { background: var(--ml-teal-pale); color: var(--ml-teal-dark); border-radius: 20px; padding: .3rem .7rem; font-weight: 700; font-size: .75rem; }
.ml-badge-closed { background: var(--ml-grey); color: var(--ml-muted); border-radius: 20px; padding: .3rem .7rem; font-weight: 700; font-size: .75rem; }

.ml-doctor-card { cursor: pointer; }
.ml-doctor-card:focus-visible { outline: 2px solid var(--ml-teal); outline-offset: 2px; }
.ml-doctor-availability {
  top: .7rem; left: .7rem;
  font-size: .68rem; font-weight: 700;
}
.ml-doctor-hint {
  display: inline-block;
  margin-top: .35rem;
  background: var(--ml-grey);
  color: var(--ml-body);
  border-radius: 14px;
  padding: .2rem .6rem;
  font-size: .68rem;
  font-weight: 600;
}

/* Info / warn banners */
.ml-info-banner { background: var(--ml-grey); border-radius: 18px; padding: .9rem 1rem; color: var(--ml-body); }
.ml-warn-banner { background: var(--ml-warn-pale); border-radius: 18px; padding: .9rem 1rem; color: var(--ml-warn); }
.ml-lock-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--ml-teal-pale); color: var(--ml-teal-dark);
  border-radius: 22px; padding: .45rem .9rem; font-weight: 700; font-size: .8rem;
}

/* Skeleton loading */
.ml-skeleton {
  background: linear-gradient(90deg, #eef1f2 25%, #f6f8f8 37%, #eef1f2 63%);
  background-size: 400% 100%;
  animation: ml-skeleton 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes ml-skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.ml-empty { text-align: center; color: var(--ml-muted); padding: 3rem 1rem; }

/* Small utility classes used across pages */
.ml-patient .text-teal { color: var(--ml-teal) !important; }
.ml-patient .text-navy { color: var(--ml-navy) !important; }
.ml-otp-icon {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--ml-teal-pale); color: var(--ml-teal-dark);
  display: grid; place-items: center; font-size: 1.5rem;
}
.ml-auth-wrap .ml-card { border-radius: 24px; }
.ml-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ml-teal-dark); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex: none;
}

/* Live SSE toast notifications (any patient page) */
.ml-toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: 100%;
  max-width: 420px;
  padding: 0 1rem;
  pointer-events: none;
}
.ml-toast {
  width: 100%;
  background: var(--ml-navy);
  color: #fff;
  border-radius: 14px;
  padding: .8rem 1.1rem;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 10px 30px rgba(15, 46, 74, .25);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .25s ease, transform .25s ease;
}
.ml-toast.is-visible { opacity: 1; transform: translateY(0); }

