/* ============================================================
   ARDA Design System — Custom CSS Variables & Components
   Built with Mobile-First Fluid Responsive Architecture
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Custom Properties ───────────────────────────────── */
:root {
  /* Primary Colors (from ARDA logo) */
  --color-primary:        #1A5C2E;
  --color-primary-light:  #2D8A4E;
  --color-primary-dark:   #114020;
  --color-primary-50:     #f0f9f4;
  --color-primary-100:    #dcf1e4;

  /* Gold Accent */
  --color-gold:           #C49A1A;
  --color-gold-light:     #E8C547;
  --color-gold-dark:      #9A7A14;
  --color-gold-50:        #fefdf0;
  --color-gold-100:       #fdf5cc;

  /* Neutral */
  --color-dark:           #111827;
  --color-body:           #374151;
  --color-muted:          #6B7280;
  --color-border:         #E5E7EB;
  --color-bg:             #F9FAFB;
  --color-white:          #FFFFFF;

  /* Typography */
  --font-ar:  'Cairo', sans-serif;
  --font-en:  'Inter', sans-serif;
  --font-base: var(--font-ar);

  /* Responsive Spacing Tokens */
  --section-py:   3rem;
  --container-px: 1rem;

  /* Border Radius */
  --radius-sm:    0.375rem;
  --radius-md:    0.75rem;
  --radius-lg:    1rem;
  --radius-xl:    1.5rem;
  --radius-full:  9999px;

  /* Shadows */
  --shadow-sm:    0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:    0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg:    0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl:    0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-green: 0 4px 20px rgb(26 92 46 / 0.2);
  --shadow-gold:  0 4px 20px rgb(196 154 26 / 0.25);

  /* Transitions */
  --transition-base: 0.2s ease;
  --transition-slow: 0.4s ease;
}

@media (min-width: 640px) {
  :root {
    --section-py:   4rem;
    --container-px: 1.5rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --section-py:   5rem;
    --container-px: 2rem;
  }
}

/* ─── Base Reset & Responsive Foundations ─────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  max-width: 100%;
}

p, h1, h2, h3, h4, h5, h6, span, a, li, blockquote, figcaption {
  overflow-wrap: break-word;
}

/* Arabic RTL */
[lang="ar"] body,
[dir="rtl"] body {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* English / French LTR */
[lang="en"] body,
[lang="fr"] body,
[dir="ltr"] body {
  font-family: var(--font-en);
  direction: ltr;
  text-align: left;
}

body {
  color: var(--color-body);
  background: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

main.admin-content {
  width: calc(100% - 280px);
  max-width: calc(100% - 280px);
  margin-inline-start: 280px;
  overflow-x: hidden;
}

@media (max-width: 1023.98px) {
  main.admin-content {
    width: 100%;
    max-width: 100%;
    margin-inline-start: 0;
  }
}

/* ─── Container System ────────────────────────────────────── */
.container-arda {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.section-py {
  padding-block: var(--section-py);
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  min-height: 2.75rem;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
}

@media (min-width: 640px) {
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Primary Button */
.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-green);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgb(26 92 46 / 0.3);
}

/* Gold/Secondary Button */
.btn-gold {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
  background: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  color: white;
  transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* Ghost / White */
.btn-white {
  background: white;
  color: var(--color-primary);
  border-color: white;
}
.btn-white:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-50);
  color: var(--color-primary-dark);
}

/* Button Sizes */
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  min-height: 2.125rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  min-height: 3rem;
}
@media (min-width: 640px) {
  .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
  }
}
.btn-icon {
  padding: 0.625rem;
  min-height: 2.5rem;
  min-width: 2.5rem;
  border-radius: var(--radius-full);
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.card-body {
  padding: 1.25rem;
}
@media (min-width: 640px) {
  .card-body {
    padding: 1.5rem;
  }
}

/* News Card */
.news-card .card-category {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.news-card .card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-dark);
  margin-bottom: 0.75rem;
}
.news-card .card-date {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

/* Project Card */
.project-card .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-ongoing   { background: #dcfce7; color: #166534; }
.status-completed { background: #dbeafe; color: #1e40af; }
.status-upcoming,
.status-planned   { background: #fef9c3; color: #854d0e; }

/* Work Area Card */
.work-area-card {
  border-radius: var(--radius-xl);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px) {
  .work-area-card {
    padding: 2rem 1.5rem;
  }
}
.work-area-card .icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .work-area-card .icon-wrapper {
    width: 4rem;
    height: 4rem;
  }
}

/* Partner Card */
.partner-logo {
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
  background: white;
}
@media (min-width: 640px) {
  .partner-logo {
    padding: 1.5rem;
  }
}
.partner-logo:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-100);
}
.partner-logo img {
  max-height: 50px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.3);
  transition: filter var(--transition-base);
}
@media (min-width: 640px) {
  .partner-logo img {
    max-height: 60px;
  }
}
.partner-logo:hover img {
  filter: grayscale(0);
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary   { background: var(--color-primary-100); color: var(--color-primary); }
.badge-gold      { background: var(--color-gold-100);    color: var(--color-gold-dark); }
.badge-gray      { background: #f3f4f6;                  color: var(--color-muted); }

/* ─── Section Heading ─────────────────────────────────────── */
.section-heading {
  text-align: center;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .section-heading {
    margin-bottom: 3rem;
  }
}
.section-heading .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
@media (min-width: 640px) {
  .section-heading .eyebrow {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }
}
.section-heading .eyebrow::before,
.section-heading .eyebrow::after {
  content: '';
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--color-gold);
}
@media (min-width: 640px) {
  .section-heading .eyebrow::before,
  .section-heading .eyebrow::after {
    width: 2rem;
  }
}
.section-heading h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.section-heading p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  max-width: 600px;
  margin-inline: auto;
  line-height: 1.7;
}
@media (min-width: 640px) {
  .section-heading p {
    font-size: 1.0625rem;
  }
}

/* ─── Statistics Counter ──────────────────────────────────── */
.stat-card {
  text-align: center;
  padding: 1.5rem 0.75rem;
}
@media (min-width: 640px) {
  .stat-card {
    padding: 2rem 1rem;
  }
}
.stat-number {
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 500;
}
@media (min-width: 640px) {
  .stat-label {
    font-size: 1rem;
  }
}

/* ─── Forms & Touch Targets ──────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-dark);
  margin-bottom: 0.375rem;
}
@media (min-width: 640px) {
  .form-label {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
  }
}
.form-label .required {
  color: #ef4444;
  margin-inline-start: 0.25rem;
}
.form-control {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem; /* 16px to prevent iOS zoom */
  color: var(--color-dark);
  background: white;
  transition: all var(--transition-base);
  outline: none;
}
@media (min-width: 640px) {
  .form-control {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
  }
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(26 92 46 / 0.1);
}
.form-control.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}
.form-error {
  font-size: 0.8125rem;
  color: #ef4444;
  margin-top: 0.375rem;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: end 1rem center;
  padding-inline-end: 2.5rem;
}

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

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border-inline-start: 4px solid transparent;
}
@media (min-width: 640px) {
  .alert {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
  }
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #22c55e; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }

/* ─── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--color-muted);
}
@media (min-width: 640px) {
  .breadcrumb {
    gap: 0.5rem;
    font-size: 0.875rem;
  }
}
.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}
.breadcrumb a:hover {
  color: var(--color-primary-dark);
}
.breadcrumb-sep {
  color: var(--color-border);
  display: inline-flex;
  align-items: center;
}
[dir="rtl"] .breadcrumb-sep {
  transform: scaleX(-1);
}

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding-inline: 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-body);
  border: 1.5px solid var(--color-border);
  transition: all var(--transition-base);
}
@media (min-width: 640px) {
  .page-item {
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: 0.75rem;
    font-size: 0.9375rem;
  }
}
.page-item:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.page-item.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.page-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Main Home Hero ──────────────────────────────────────── */
.hero-section {
  position: relative;
  overflow: hidden;
}
@media (max-width: 639.98px) {
  .hero-section {
    min-height: auto !important;
  }
  .hero-section .hero-title {
    font-size: 1.625rem;
    line-height: 1.25;
  }
  .hero-section .hero-desc {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* ─── Page Hero / Intro ───────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding-block: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px) {
  .page-hero {
    padding-block: 3.5rem 2.5rem;
  }
}
@media (min-width: 1024px) {
  .page-hero {
    padding-block: 4rem 3rem;
  }
}
.page-hero::before {
  content: '';
  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.04'%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");
  pointer-events: none;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.page-hero .breadcrumb {
  color: rgba(255,255,255,0.75);
  margin-top: 0.75rem;
}
.page-hero .breadcrumb a {
  color: rgba(255,255,255,0.9);
}

/* ─── Table Responsive Container ─────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: inherit;
}
.table-responsive table {
  min-width: 600px;
}

/* ─── Loading Skeleton ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}
@media (min-width: 640px) {
  .empty-state {
    padding: 4rem 2rem;
  }
}
.empty-state svg {
  width: 3.5rem;
  height: 3.5rem;
  margin-inline: auto;
  margin-bottom: 1rem;
  color: var(--color-border);
}
.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dark); }

/* ─── Selection ───────────────────────────────────────────── */
::selection {
  background: var(--color-primary);
  color: white;
}

/* ─── Focus Styles (Accessibility) ───────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ─── Print Styles ────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { font-size: 12pt; background: white; color: black; }
  .container-arda { max-width: 100% !important; padding: 0 !important; }
}

/* ─── Safe Area Offsets for Mobile (iPhone notch/home bar) ── */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

