/* =========================================================
   components.css
   الهيدر، الفوتر، الأزرار، البطاقات، الأكورديون، Breadcrumbs، النماذج، التنبيهات
   ========================================================= */

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  text-align: center;
  line-height: 1.3;
}

.btn-primary {
  background-color: var(--fresh-teal);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--medical-teal);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--primary-blue);
  border-color: var(--border-color);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--secondary-blue);
  background-color: var(--light-background);
}

.btn-outline {
  background-color: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

/* ---------- الهيدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 0.75rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  color: var(--primary-blue);
  font-size: 1.05rem;
}

.logo-link img {
  width: 42px;
  height: 42px;
}

.logo-text-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted-text);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--primary-blue);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
  position: fixed;
  inset: 0 0 0 auto;
  right: 0;
  width: min(85vw, 340px);
  height: 100vh;
  background-color: var(--white);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 510;
}

.main-nav.is-open {
  transform: translateX(0);
}

.nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 1.3rem;
  margin-inline-start: auto;
  margin-bottom: var(--space-3);
  color: var(--primary-blue);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-list > li > a,
.nav-link-top {
  display: block;
  padding: 0.75rem 0.4rem;
  font-weight: 700;
  color: var(--main-text);
  border-bottom: 1px solid var(--border-color);
}

.nav-group > button.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0.75rem 0.4rem;
  font-weight: 700;
  color: var(--main-text);
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
}

.nav-group-toggle .chevron {
  transition: transform 0.2s ease;
  color: var(--medical-teal);
}

.nav-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  padding-inline-start: var(--space-3);
  background-color: var(--light-background);
  border-radius: var(--radius-sm);
  margin-bottom: 0.3rem;
}

.nav-submenu.is-open {
  display: flex;
}

.nav-submenu a {
  padding: 0.65rem 0.4rem;
  color: var(--muted-text);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

.nav-submenu a:last-child {
  border-bottom: none;
}

.nav-cta {
  margin-top: var(--space-3);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(4, 69, 124, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 490;
}

.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

.header-cta {
  display: none;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding-block: var(--space-2);
  background-color: var(--light-background);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.breadcrumbs a {
  color: var(--secondary-blue);
  font-weight: 600;
}

.breadcrumbs li:not(:last-child)::after {
  content: "\2190";
  margin-inline-start: 0.4rem;
  color: var(--border-color);
}

.breadcrumbs li[aria-current="page"] {
  color: var(--main-text);
  font-weight: 600;
}

/* ---------- البطاقات ---------- */
.card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: var(--light-background);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.card-icon img {
  width: 28px;
  height: 28px;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted-text);
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}

.card-link {
  color: var(--medical-teal);
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- التنبيهات والصناديق ---------- */
.alert-box {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border: 1px solid var(--warning-border);
  background-color: var(--warning-bg);
  margin-bottom: var(--space-3);
}

.alert-box.alert-danger {
  border-color: #e6b3ac;
  background-color: var(--danger-bg);
}

.alert-box h3 {
  color: var(--danger-red);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.alert-box.alert-info h3 {
  color: var(--secondary-blue);
}

.alert-box p:last-child {
  margin-bottom: 0;
}

.summary-box {
  background-color: var(--light-background);
  border-right: 4px solid var(--fresh-teal);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.summary-box h2,
.summary-box h3 {
  margin-bottom: 0.6rem;
}

.quick-answer {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

/* ---------- الأكورديون (الأسئلة الشائعة) ---------- */
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background-color: var(--white);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 1rem;
  background: transparent;
  border: none;
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-blue);
  line-height: 1.7;
  white-space: normal;
}

.accordion-trigger .accordion-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--light-background);
  color: var(--medical-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

.accordion-panel {
  padding: 0 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
}

.accordion-panel.is-open {
  padding: 0 1rem var(--space-3);
  max-height: 600px;
}

.accordion-panel p,
.accordion-panel ul {
  color: var(--muted-text);
  font-size: 0.96rem;
}

.accordion-panel ul {
  padding-inline-start: 1.2rem;
  list-style: disc;
  margin-bottom: 0.5rem;
}

/* ---------- النماذج ---------- */
.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--main-text);
}

.form-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-text);
  margin-top: 0.3rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--main-text);
}

.form-control:focus {
  border-color: var(--fresh-teal);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}

.radio-option input,
.checkbox-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--fresh-teal);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background-color: var(--light-background);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.consent-row input {
  margin-top: 0.3rem;
  width: 18px;
  height: 18px;
  accent-color: var(--fresh-teal);
  flex-shrink: 0;
}

.form-required {
  color: var(--danger-red);
}

.form-status {
  margin-top: var(--space-2);
  font-weight: 700;
  display: none;
}

.form-status.is-visible {
  display: block;
}

/* ---------- الفوتر ---------- */
.site-footer {
  background-color: var(--primary-blue);
  color: rgba(255, 255, 255, 0.88);
  padding-block: var(--space-5) var(--space-3);
  text-align: center;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  justify-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 28rem;
}

.footer-brand .logo-link {
  color: var(--white);
  justify-content: center;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  margin-top: var(--space-2);
}

.footer-heading {
  color: var(--white);
  font-size: 0.98rem;
  margin-bottom: var(--space-2);
}

.footer-links {
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
}

.footer-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-block: var(--space-3);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: var(--space-3);
  text-align: center;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.footer-copyright {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  margin: 0;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

.footer-copyright strong {
  font-weight: 700;
  color: var(--white);
}

.footer-copyright-year {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.footer-copyright-sep {
  opacity: 0.65;
}

.footer-contact {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- شريط التواجد أونلاين ---------- */
.online-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  background: linear-gradient(90deg, #04457c 0%, #08669b 55%, #0987a7 100%);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.online-status-bar a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.online-status-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #5bdcff;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(91, 220, 255, 0.7);
  animation: online-pulse 1.8s ease-out infinite;
}

.online-status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(91, 220, 255, 0.55);
  animation: online-ring 1.8s ease-out infinite;
}

@keyframes online-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(91, 220, 255, 0.65);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(91, 220, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91, 220, 255, 0);
  }
}

@keyframes online-ring {
  0% {
    transform: scale(0.7);
    opacity: 1;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* ---------- زر واتساب عائم ---------- */
.whatsapp-float {
  position: fixed;
  inset-inline-start: 1.1rem;
  bottom: 1.1rem;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: #25d366;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
  color: var(--white);
}

.whatsapp-float img,
.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

.whatsapp-float-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: rgba(37, 211, 102, 0.35);
  animation: wa-float-pulse 2s ease-out infinite;
  z-index: -1;
}

@keyframes wa-float-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}
