/* ===== Variables ===== */
:root {
  --red: #CE1126;
  --red-dark: #a50e1f;
  --green: #007A3D;
  --green-dark: #005a2c;
  --black: #1a1a1a;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #868e96;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Noto Sans Arabic', 'Inter', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-main);
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ===== RTL Support ===== */
html[dir="rtl"] body {
  font-family: var(--font-arabic);
}

html[dir="rtl"] .header-inner,
html[dir="rtl"] .top-bar-inner,
html[dir="rtl"] .emergency-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .logo-group {
  flex-direction: row-reverse;
}

html[dir="rtl"] .logo-text {
  text-align: right;
}

html[dir="rtl"] .main-nav {
  flex-direction: row-reverse;
}

html[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .service-card,
html[dir="rtl"] .about-text,
html[dir="rtl"] .info-card,
html[dir="rtl"] .news-content,
html[dir="rtl"] .community-card {
  text-align: right;
}

html[dir="rtl"] .service-card ul {
  padding-right: 1.2rem;
  padding-left: 0;
}

html[dir="rtl"] .footer-links {
  text-align: right;
}

html[dir="rtl"] .footer-about {
  text-align: right;
}

html[dir="rtl"] .top-bar-contact {
  flex-direction: row-reverse;
}

html[dir="rtl"] .top-bar-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .news-card {
  flex-direction: row-reverse;
}

html[dir="rtl"] .contact-form-wrapper {
  text-align: right;
}

html[dir="rtl"] .appt-form {
  text-align: right;
}

html[dir="rtl"] .fees-table {
  direction: rtl;
}

html[dir="rtl"] .quick-card {
  text-align: right;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Emergency Banner ===== */
.emergency-banner {
  background: var(--red);
  color: var(--white);
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

.emergency-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-align: center;
}

.emergency-inner strong {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===== Top Bar ===== */
.top-bar {
  background: var(--gray-900);
  color: var(--gray-400);
  font-size: 0.8rem;
  padding: 0.5rem 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-contact {
  display: flex;
  gap: 1.5rem;
}

.top-bar-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.lang-btn {
  background: transparent;
  border: 1px solid var(--gray-600);
  color: var(--gray-400);
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition);
  font-family: var(--font-arabic);
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ===== Header ===== */
.header {
  background: var(--white);
  border-bottom: 3px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emblem img {
  display: block;
  height: 110px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-line1 {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 400;
  line-height: 1.3;
}

.logo-line2 {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
  line-height: 1.3;
}

.logo-line3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.main-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--green);
  background: var(--gray-50);
}

.nav-link.active {
  color: var(--green);
  font-weight: 600;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
  padding: 0.5rem;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #1a2a1a 0%, #0d1f0d 50%, var(--gray-900) 100%);
  padding: 5rem 0;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  text-align: center;
  color: var(--white);
}

.hero-flag {
  width: 80px;
  height: auto;
  margin: 0 auto 1.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.flag-stripe {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2rem;
}

.stripe {
  width: 40px;
  height: 6px;
  border-radius: 3px;
}

.stripe-green { background: var(--green); }
.stripe-white { background: var(--white); }
.stripe-black { background: var(--gray-800); }

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-text {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

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

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

.btn-full {
  width: 100%;
}

/* ===== Quick Links ===== */
.quick-links {
  padding: 3rem 0 2rem;
  background: var(--white);
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.quick-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--green);
}

.quick-card-accent {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #bbf7d0;
}

.quick-card-accent:hover {
  border-color: var(--green);
}

.quick-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: var(--green);
}

.quick-icon-accent {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
}

.quick-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.2rem;
}

.quick-card p {
  font-size: 0.78rem;
  color: var(--gray-500);
}

/* ===== Sections ===== */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--gray-50);
}

.section-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 0.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--green);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.section-desc {
  text-align: center;
  color: var(--gray-600);
  max-width: 600px;
  margin: 1rem auto 2.5rem;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--gray-700);
  line-height: 1.8;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--green);
}

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.service-card-wide {
  grid-column: span 3;
  max-width: 400px;
  justify-self: center;
}

.service-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--green);
}

.service-icon-alert {
  background: linear-gradient(135deg, #fff5f5, #ffe3e3);
  color: var(--red);
}

.service-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.6rem;
}

.service-card ul {
  padding-left: 1.2rem;
  list-style: disc;
}

.service-card li {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

/* ===== Appointment ===== */
.appt-wrapper {
  max-width: 700px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.appt-form .form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ===== Fees ===== */
.fees-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

.fees-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.fees-table th {
  background: var(--green);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  text-align: start;
  font-size: 0.9rem;
  font-weight: 600;
}

.fees-table td {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

.fees-table tr:last-child td {
  border-bottom: none;
}

.fees-table tr:hover td {
  background: var(--gray-50);
}

.fees-table td:last-child {
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
}

.fees-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  font-style: italic;
}

.fees-payment {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* ===== Community ===== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.community-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.community-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green);
}

.community-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--green);
}

.community-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.community-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== News ===== */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.news-card {
  display: flex;
  gap: 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.news-card:hover {
  box-shadow: var(--shadow);
}

.news-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.news-day {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.news-month {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.news-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.news-content p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

.contact-item h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.2rem;
}

.contact-item p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.contact-form-wrapper {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.contact-form h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 122, 61, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* ===== Footer ===== */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
}

.footer-about h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.footer-about p {
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer-links h4 {
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.footer-links a {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-500);
  padding: 0.25rem 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    z-index: 200;
  }

  .main-nav.open {
    display: flex;
  }

  html[dir="rtl"] .main-nav {
    flex-direction: column;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero {
    padding: 4rem 0;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card-wide {
    grid-column: span 2;
  }

  .community-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 600px) {
  .top-bar-contact {
    display: none;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card-wide {
    grid-column: span 1;
    max-width: 100%;
  }

  .form-row,
  .appt-form .form-row-3 {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .news-card {
    flex-direction: column;
    gap: 1rem;
  }

  html[dir="rtl"] .news-card {
    flex-direction: column;
  }

  .news-date {
    flex-direction: row;
    gap: 0.5rem;
    min-width: auto;
    width: fit-content;
  }

  .emergency-inner {
    font-size: 0.75rem;
  }
}
