/* نظام العيادات والمراكز الطبية — Brandorix bx-clinic */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --teal-primary: #0d9488;
  --teal-hover: #0f766e;
  --teal-light: #ccfbf1;
  --teal-glow: rgba(13, 148, 136, 0.2);
  --dark: #0f172a;
  --dark-2: #1e293b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-teal: #99f6e4;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 40px -10px rgba(13, 148, 136, 0.12);
  --font: 'Cairo', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
}

.clinic-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.clinic-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.clinic-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.clinic-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.clinic-logo-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--teal-primary), #047857);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px var(--teal-glow);
}
.clinic-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}
.clinic-sub {
  font-size: 12.5px;
  color: var(--teal-primary);
  font-weight: 600;
}

.currency-select {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--dark);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
.btn-teal {
  background: var(--teal-primary);
  color: #fff;
  font-weight: 800;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px var(--teal-glow);
}
.btn-teal:hover {
  background: var(--teal-hover);
  transform: translateY(-2px);
}
.btn-outline {
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: var(--teal-primary);
  color: var(--teal-primary);
}

/* Hero Doctor Showcase */
.clinic-hero {
  padding: 40px 0 20px;
}
.hero-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 860px) {
  .hero-card { grid-template-columns: 1fr; padding: 24px; }
}
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-light);
  color: var(--teal-primary);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 16px;
}
.hero-heading {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 900;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero-heading span {
  color: var(--teal-primary);
}
.hero-desc {
  color: var(--text-muted);
  font-size: 15.5px;
  margin-bottom: 24px;
  max-width: 600px;
}
.doctor-profile-box {
  background: #fff;
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.doctor-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.doctor-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 2px solid var(--teal-primary);
}
.doctor-name {
  font-size: 19px;
  font-weight: 900;
  color: var(--dark);
}
.doctor-spec {
  font-size: 12.5px;
  color: var(--teal-primary);
  font-weight: 700;
  line-height: 1.4;
}

/* Booking System Section */
.booking-section {
  padding: 30px 0 60px;
}
.booking-wizard-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Wizard Steps Bar */
.wizard-steps-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 700px) {
  .wizard-steps-bar { grid-template-columns: 1fr; }
}
.step-item {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  position: relative;
}
.step-item:last-child { border-left: none; }
.step-item.active {
  background: #fff;
  color: var(--teal-primary);
}
.step-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--teal-primary);
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}
.step-item.active .step-num {
  background: var(--teal-primary);
  color: #fff;
}
.step-item.done .step-num {
  background: var(--green);
  color: #fff;
}

.wizard-body {
  padding: 32px;
}

/* Step 1: Services Grid */
.services-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .services-select-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .services-select-grid { grid-template-columns: 1fr; }
}
.service-select-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.service-select-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal-primary);
  box-shadow: 0 10px 20px rgba(13, 148, 136, 0.08);
}
.service-select-card.selected {
  border-color: var(--teal-primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 2px var(--teal-primary);
}
.srv-icon-badge {
  font-size: 32px;
  margin-bottom: 12px;
}
.srv-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.srv-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex: 1;
}
.srv-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.srv-price {
  font-size: 20px;
  font-weight: 900;
  color: var(--teal-primary);
}
.srv-dur {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Step 2: Date & Slots Calendar */
.date-pills-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
}
.date-pill {
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  min-width: 100px;
  transition: all 0.2s;
}
.date-pill:hover {
  border-color: var(--teal-primary);
}
.date-pill.active {
  background: var(--teal-primary);
  color: #fff;
  border-color: var(--teal-primary);
}
.date-pill .day-name { font-size: 13px; font-weight: 800; }
.date-pill .day-date { font-size: 11.5px; opacity: 0.85; margin-top: 3px; }

.shift-selector-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.shift-tab {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.shift-tab.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 800px) {
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
}
.slot-btn {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.slot-btn:hover:not(.taken) {
  border-color: var(--teal-primary);
  background: #f0fdfa;
}
.slot-btn.selected {
  background: var(--teal-primary);
  color: #fff;
  border-color: var(--teal-primary);
}
.slot-btn.taken {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}
.slot-btn.taken::after {
  content: 'محجوز';
  font-size: 10px;
  color: #ef4444;
  font-weight: 800;
}

/* Step 3: Patient Form */
.patient-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .patient-form-grid { grid-template-columns: 1fr; }
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  background: #fff;
  transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* Step 4: Digital Voucher Card */
.voucher-card {
  max-width: 650px;
  margin: 0 auto;
  background: #fff;
  border: 2px dashed var(--teal-primary);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.voucher-stamp {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--teal-light);
  color: var(--teal-primary);
  border: 1px solid var(--border-teal);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.voucher-ref {
  font-size: 26px;
  font-weight: 900;
  color: var(--teal-primary);
  letter-spacing: 1px;
  margin: 8px 0;
}
.voucher-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  text-align: right;
  margin: 24px 0;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 13.5px;
}

/* Floating Emergency Action */
.floating-emergency-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #25d366;
  color: #fff;
  border-radius: 999px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  z-index: 90;
  transition: all 0.25s;
}
.floating-emergency-btn:hover {
  transform: translateY(-3px);
}

/* Toast */
.clinic-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: #fff;
  border-right: 4px solid var(--teal-primary);
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}
.clinic-toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* Clinic Logo */
.clinic-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border-teal);
  background: #fff;
  padding: 2px;
  display: block;
}

/* Patient Medical Docs Dropzone */
.clinic-dropzone {
  border: 2px dashed var(--border-teal);
  background: #f0fdfa;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 12px;
}
.clinic-dropzone:hover, .clinic-dropzone.dragover {
  background: #ccfbf1;
  border-color: var(--teal-primary);
}

.patient-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.patient-doc-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.patient-doc-chip .chip-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.patient-doc-chip .chip-left a {
  color: var(--teal-primary);
  text-decoration: none;
  font-weight: 700;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-doc-chip .chip-left a:hover {
  text-decoration: underline;
}
.patient-doc-chip .chip-size {
  font-size: 11px;
  color: var(--text-muted);
}
.patient-doc-chip .chip-del {
  background: none;
  border: none;
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.attachment-pill:hover {
  background: #99f6e4;
}

.voucher-attachments-badge {
  background: #f0fdfa;
  border: 1px dashed var(--teal-primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--teal-hover);
  font-weight: 700;
  margin-top: 14px;
  text-align: center;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex !important;
}
.modal-box {
  background: #ffffff;
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.25s ease-out;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-close {
  position: absolute;
  top: 18px;
  left: 18px;
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover {
  background: #e2e8f0;
  color: var(--dark);
}

/* EHR Timeline & Patient Profile Tabs */
.ehr-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.ehr-tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-bottom: -2px;
}
.ehr-tab-btn:hover {
  color: var(--teal-primary);
}
.ehr-tab-btn.active {
  color: var(--teal-primary);
  border-bottom-color: var(--teal-primary);
  background: #f0fdfa;
  border-radius: 8px 8px 0 0;
}

/* Visit Cards & Medical Timeline */
.visit-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-right: 4px solid var(--teal-primary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}
.visit-card:hover {
  box-shadow: 0 4px 12px rgba(13,148,136,0.1);
}
.visit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.visit-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdfa;
  color: var(--teal-hover);
  border: 1px solid var(--border-teal);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 800;
}
.visit-diag-box {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--dark);
  line-height: 1.5;
}
.visit-diag-box .lbl {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.visit-rx-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #166534;
  line-height: 1.5;
}
.visit-rx-box .lbl {
  font-size: 11.5px;
  font-weight: 900;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.visit-notes-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.4;
}
.visit-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.visit-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}
.visit-att-chip:hover {
  background: var(--teal-primary);
  color: #fff;
  border-color: var(--teal-primary);
}
.visit-att-img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

