/* Avicenne Clinique - Main styles - Mobile-first, RTL-ready */
/* Theme: Primary Blue #1F6FB2, Medical Green #6BAF45, Dark Blue #0F3E6A */

:root {
  /* Primary palette */
  --color-primary: #1F6FB2;
  --color-primary-hover: #1a5f9a;
  --color-primary-light: rgba(31, 111, 178, .12);
  --color-dark: #0F3E6A;
  --color-accent: #6BAF45;
  --color-accent-hover: #5d9d3b;
  --color-accent-soft: rgba(107, 175, 69, .12);
  /* Backgrounds */
  --color-bg: #F4F6F8;
  --color-bg-card: #FFFFFF;
  --color-border: #D9DEE3;
  /* Text */
  --color-text: #0F3E6A;
  --color-text-muted: #5a6c7d;
  /* Typography & layout */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ar: 'Segoe UI', 'Arabic UI', Tahoma, sans-serif;
  --shadow: 0 2px 12px rgba(15, 62, 106, .06);
  --shadow-hover: 0 4px 20px rgba(15, 62, 106, .1);
  --radius: 10px;
  --header-h: 72px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

body.rtl {
  font-family: var(--font-ar);
  direction: rtl;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.site-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header - Primary Blue + green accent strip */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: var(--shadow);
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 4px solid var(--color-accent);
}

.site-header .site-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
}

.logo:hover {
  text-decoration: none;
}

.logo-img {
  height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

body.rtl .logo-img {
  object-position: right center;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .95);
  font-weight: 500;
}

.main-nav a:hover {
  background: rgba(107, 175, 69, .35);
  color: #fff;
  text-decoration: none;
}

.main-nav a.active {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.5rem;
  color: #fff;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  body.rtl .main-nav { left: auto; right: 0; }
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
}

.lang-switcher button {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, .4);
  background: transparent;
  color: rgba(255, 255, 255, .9);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.lang-switcher button:hover {
  background: rgba(107, 175, 69, .4);
  color: #fff;
  border-color: rgba(255, 255, 255, .6);
}

.lang-switcher button.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* Main content */
.main-content {
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 2rem 0;
}

/* Buttons - rounded + soft shadow */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(107, 175, 69, .25);
}

.btn-accent:hover {
  background: var(--color-accent-hover);
  color: #fff;
  box-shadow: 0 4px 20px rgba(107, 175, 69, .35);
}

/* Hero - blue gradient, white space */
.hero {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 60%, #2583c9 100%);
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
  border-radius: 0 0 var(--radius) var(--radius);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
}

.hero p {
  margin: 0 0 1.5rem;
  opacity: .95;
  font-size: 1.05rem;
}

.hero .btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .btn {
  background: #fff;
  color: var(--color-primary);
}

.hero .btn.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.hero .btn.btn-accent:hover {
  background: var(--color-accent-hover);
  color: #fff;
  box-shadow: 0 4px 20px rgba(107, 175, 69, .35);
}

.hero .btn:not(.btn-accent):hover {
  background: var(--color-accent);
  color: #fff;
}

/* Sections - white space, accent separators */
.section {
  padding: 2.5rem 0;
}

/* Section with light green background (medical accent) */
.section--accent {
  background: var(--color-accent-soft);
}

.section-title {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

.section-subtitle {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  max-width: 600px;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cards-grid--services {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary-light);
  border-top-color: var(--color-accent);
}

/* Service card with icon */
.card--with-icon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

/* Emoji icon beside service title (expandable card) */
.card-icon--emoji {
  width: auto;
  height: auto;
  margin-bottom: 0;
  margin-inline-end: 0.75rem;
  padding: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
}

/* Expandable service card */
.card--expandable details {
  width: 100%;
}

.card--expandable .card-summary {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  list-style: none;
  text-align: start;
}

.card--expandable .card-summary::-webkit-details-marker {
  display: none;
}

.card--expandable .card-summary::after {
  content: '';
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-inline-start: auto;
  border-inline-end: 2px solid var(--color-text-muted);
  border-block-end: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform .2s;
}

.card--expandable details[open] .card-summary::after {
  transform: rotate(-135deg);
  margin-block-end: -0.15rem;
}

.card--expandable .card-summary h3 {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.card--expandable .card-description {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--color-accent);
}

.card--expandable .card-description p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.card--with-icon .card-icon + h3 {
  margin-top: 0;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-dark);
}

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

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Form submit = green CTA (medical accent) */
.form-actions .btn-primary {
  background: var(--color-accent);
}

.form-actions .btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 4px 20px rgba(107, 175, 69, .35);
}

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

.form-group .error {
  color: #c00;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-actions {
  margin-top: 1.25rem;
}

.form-message {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: none;
}

.form-message.success {
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  border: 1px solid var(--color-accent);
  display: block;
}

.form-message.error {
  background: #ffebee;
  color: #c62828;
  display: block;
}

/* Honeypot (hidden from users) */
.form-group.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
body.rtl .form-group.hp { left: auto; right: -9999px; }

/* Footer - Dark Medical Blue + green accent strip */
.site-footer {
  background: var(--color-dark);
  color: #fff;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 4px solid var(--color-accent);
}

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

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr auto;
  }
}

.footer-block h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  opacity: .9;
}

.footer-block p,
.footer-block a {
  margin: 0;
  font-size: 0.95rem;
  opacity: .85;
}

.footer-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-social-link:hover {
  text-decoration: underline;
}

.footer-social-link img,
.footer-social-link svg {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.2);
  font-size: 0.9rem;
  opacity: .8;
  text-align: center;
}

.footer-bottom .footer-date {
  display: inline;
}

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, .5);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 211, 102, .6);
  color: #fff;
  text-decoration: none;
}

body.rtl .whatsapp-float {
  right: auto;
  left: 1.5rem;
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

/* Page titles - Dark blue headings */
.page-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-dark);
}

.page-subtitle {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
}

/* Contact page: map (bottom section) */
.contact-map-section {
  margin-bottom: 0;
}

.contact-map-section--bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.contact-map-section .section-title {
  margin-bottom: 0.5rem;
}

.map-link-wrap {
  margin: 0 0 1rem;
}

.map-embed-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding-bottom: 35%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Contact page: info + form */
.contact-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1.2fr;
  }
}

.contact-info .card {
  margin-bottom: 1rem;
}

/* Contact hours table */
.card--hours .hours-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.hours-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.hours-table {
  width: 100%;
  min-width: 220px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hours-table thead {
  background: var(--color-accent);
  color: #fff;
}

.hours-table th {
  padding: 0.65rem 0.85rem;
  text-align: start;
  font-weight: 600;
}

.hours-table tbody tr {
  border-bottom: 1px solid var(--color-border);
}

.hours-table tbody tr:last-child {
  border-bottom: none;
}

.hours-table tbody tr:nth-child(even) {
  background: var(--color-bg);
}

.hours-table td {
  padding: 0.6rem 0.85rem;
}

.hours-table td:first-child {
  font-weight: 500;
  color: var(--color-dark);
}

.hours-table td:nth-child(2),
.hours-table td:nth-child(3) {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Utility */
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
