/* ============================================================
   LIBO Engineering & Urban Development - Main Stylesheet
   Corporate Modern Design | RTL/LTR | Dark Mode | Responsive
   ============================================================ */

/* ----------  Design Tokens (CSS Variables)  ---------- */
:root {
  /* Brand colors */
  --navy: #0a2540;          /* أزرق داكن */
  --navy-700: #123a63;
  --navy-500: #1d4e8a;
  --silver: #c5ccd6;        /* فضي معدني */
  --silver-light: #e8ecf1;
  --gold: #c9a24b;          /* ذهبي خفيف */
  --gold-light: #e3c882;
  --white: #ffffff;

  /* Semantic (light theme defaults) */
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --text: #16263a;
  --text-muted: #5a6b7e;
  --border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 10px 30px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 20px 50px rgba(10, 37, 64, 0.15);

  /* Layout */
  --container: 1200px;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 76px;

  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}

/* Dark theme overrides */
[data-theme="dark"] {
  --bg: #0a1626;
  --bg-alt: #0f1f33;
  --surface: #122740;
  --text: #e8ecf1;
  --text-muted: #9fb0c3;
  --border: #1f3a59;
  --header-bg: rgba(10, 22, 38, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Lazy-loaded images fade in */
img.lazy { opacity: 0; transition: opacity 0.6s ease; }
img.lazy.loaded { opacity: 1; }

/* ----------  Layout helpers  ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.text-center { text-align: center; }

.section-head { max-width: 720px; margin: 0 auto 55px; text-align: center; }
.section-head .eyebrow {
  display: inline-block; color: var(--gold);
  font-weight: 700; letter-spacing: 2px; font-size: 0.82rem;
  text-transform: uppercase; margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); color: var(--text); line-height: 1.3; }
.section-head p { color: var(--text-muted); margin-top: 14px; font-size: 1.05rem; }

/* ----------  Buttons  ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 28px; border-radius: 50px;
  font-family: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(201,162,75,0.35); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy-500); transform: translateY(-3px); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  background: var(--header-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 1000;
  transition: all var(--transition);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand .logo-mark {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  background: #ffffff; overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
}
.brand .logo-mark img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-text strong { font-size: 1.05rem; color: var(--text); }
.brand .brand-text span { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.93rem; color: var(--text); transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: var(--bg-alt); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; font-size: 1.1rem; transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.lang-btn { font-weight: 800; font-size: 0.85rem; width: auto; padding: 0 14px; }

.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  color: var(--white); overflow: hidden; padding-top: var(--header-h);
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img, .hero-bg video { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, rgba(10,37,64,0.92) 0%, rgba(10,37,64,0.7) 50%, rgba(10,37,64,0.45) 100%);
}
.hero-content { max-width: 760px; }
.hero .eyebrow { color: var(--gold-light); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 0.85rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.25; margin: 18px 0; }
.hero h1 .accent { color: var(--gold); }
.hero p { font-size: 1.15rem; color: var(--silver-light); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 1.5rem; animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100%{transform:translate(-50%,0);} 50%{transform:translate(-50%,10px);} }

/* ============================================================
   STATS (animated counters)
   ============================================================ */
.stats { background: var(--navy); color: var(--white); position: relative; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.stat { text-align: center; padding: 20px; }
.stat .num { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; color: var(--gold); line-height: 1; }
.stat .num .suffix { font-size: 1.6rem; }
.stat .label { margin-top: 12px; color: var(--silver-light); font-weight: 600; }

/* ============================================================
   CARDS / GRIDS
   ============================================================ */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px; transition: all var(--transition);
  height: 100%;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.card .ic {
  width: 60px; height: 60px; border-radius: 14px; margin-bottom: 20px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: linear-gradient(135deg, var(--navy), var(--navy-500)); color: var(--gold);
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text); }
.card p { color: var(--text-muted); font-size: 0.96rem; }
.card ul { margin-top: 14px; }
.card ul li { position: relative; padding-inline-start: 22px; margin-bottom: 8px; color: var(--text-muted); font-size: 0.93rem; }
.card ul li::before { content: "\2713"; position: absolute; inset-inline-start: 0; color: var(--gold); font-weight: 800; }

/* Service tabs */
.tabs { display: flex; justify-content: center; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.tab-btn {
  padding: 11px 26px; border-radius: 50px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
}
.tab-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(15px);} to{opacity:1;transform:none;} }

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all var(--transition);
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.project-media { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.project-card:hover .project-media img { transform: scale(1.08); }
.project-badge {
  position: absolute; top: 14px; inset-inline-start: 14px;
  background: var(--gold); color: var(--navy); font-weight: 700; font-size: 0.78rem;
  padding: 5px 14px; border-radius: 50px;
}
.project-body { padding: 24px; }
.project-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.project-body .desc { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 16px; }
.project-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 0.85rem; }
.project-meta div { color: var(--text-muted); }
.project-meta strong { color: var(--text); display: block; font-size: 0.8rem; }
.progress { margin-top: 16px; }
.progress-bar { height: 8px; background: var(--bg-alt); border-radius: 50px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 50px; width: 0; transition: width 1.2s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 6px; color: var(--text-muted); }

/* Filter buttons reuse .tabs/.tab-btn */

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-hero {
  position: relative; padding: calc(var(--header-h) + 70px) 0 70px; color: var(--white);
  text-align: center; overflow: hidden;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--navy), var(--navy-700)); z-index: -1; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.page-hero p { color: var(--silver-light); margin-top: 12px; max-width: 640px; margin-inline: auto; }
.breadcrumb { margin-top: 16px; font-size: 0.88rem; color: var(--silver); }
.breadcrumb a:hover { color: var(--gold); }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--text-muted); }
.form-success { background: #e7f7ed; color: #1c7a3f; padding: 14px 18px; border-radius: var(--radius-sm); margin-top: 16px; display: none; }
[data-theme="dark"] .form-success { background: #0f3522; color: #6fe0a0; }

/* Contact info cards */
.contact-info { display: grid; gap: 18px; }
.info-item { display: flex; gap: 16px; align-items: flex-start; }
.info-item .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-alt); color: var(--gold); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.info-item h4 { font-size: 1rem; }
.info-item p { color: var(--text-muted); font-size: 0.92rem; }

.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map-embed iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* ============================================================
   NEWS
   ============================================================ */
.news-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all var(--transition); }
.news-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.news-media { aspect-ratio: 16/9; overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.news-card:hover .news-media img { transform: scale(1.07); }
.news-body { padding: 22px; }
.news-date { color: var(--gold); font-size: 0.82rem; font-weight: 700; }
.news-body h3 { font-size: 1.12rem; margin: 8px 0; }
.news-body p { color: var(--text-muted); font-size: 0.92rem; }
.read-more { color: var(--gold); font-weight: 700; font-size: 0.9rem; margin-top: 12px; display: inline-block; }

/* ============================================================
   JOBS
   ============================================================ */
.job-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; display: flex; justify-content: space-between; align-items: center;
  gap: 20px; transition: all var(--transition); flex-wrap: wrap;
}
.job-item:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.job-item h3 { font-size: 1.15rem; }
.job-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.job-tags span { font-size: 0.78rem; background: var(--bg-alt); color: var(--text-muted); padding: 4px 12px; border-radius: 50px; }

/* ============================================================
   EMPTY STATE / COMING SOON
   ============================================================ */
.empty-state {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 60px 36px; box-shadow: var(--shadow);
}
.empty-state .es-icon {
  width: 92px; height: 92px; margin: 0 auto 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.6rem; color: var(--gold);
  background: linear-gradient(135deg, var(--navy), var(--navy-500));
  border: 2px solid var(--gold);
}
.empty-state h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 14px; }
.empty-state .badge-soon {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-weight: 800; letter-spacing: 1px; padding: 7px 22px; border-radius: 50px;
  font-size: 0.9rem; margin-bottom: 20px;
}
.empty-state p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 26px; }
.empty-state .es-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FEATURE / SPLIT SECTIONS
   ============================================================ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 16px; }
.split p { color: var(--text-muted); margin-bottom: 14px; }
.feature-list li { position: relative; padding-inline-start: 30px; margin-bottom: 12px; color: var(--text-muted); }
.feature-list li::before { content: "\2713"; position: absolute; inset-inline-start: 0; width: 20px; height: 20px; background: var(--gold); color: var(--navy); border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--navy), var(--navy-500)); color: var(--white); text-align: center; }
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 14px; }
.cta-band p { color: var(--silver-light); max-width: 600px; margin: 0 auto 26px; }

/* Value/why cards small */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #061a2e; color: var(--silver); padding-top: 70px; }
[data-theme="dark"] .site-footer { background: #050f1c; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 50px; }
.site-footer h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 20px; }
.site-footer p { font-size: 0.92rem; line-height: 1.8; }
.footer-links li { margin-bottom: 11px; }
.footer-links a { font-size: 0.92rem; transition: all var(--transition); }
.footer-links a:hover { color: var(--gold); padding-inline-start: 6px; }
.footer-contact li { display: flex; gap: 10px; margin-bottom: 12px; font-size: 0.9rem; align-items: flex-start; }
.footer-contact .ic { color: var(--gold); }
.social { display: flex; gap: 12px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.08); display: grid; place-items: center; color: var(--silver); transition: all var(--transition); }
.social a:hover { background: var(--gold); color: var(--navy); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 22px 0; text-align: center; font-size: 0.85rem; }

/* ============================================================
   FLOATING WIDGETS
   ============================================================ */
.whatsapp-fab {
  position: fixed; bottom: 24px; inset-inline-end: 24px; width: 56px; height: 56px;
  background: #25d366; color: #fff; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; box-shadow: 0 8px 24px rgba(37,211,102,0.45); z-index: 900;
  transition: transform var(--transition); animation: pulse 2.5s infinite;
}
.whatsapp-fab:hover { transform: scale(1.1); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(37,211,102,0.5);} 70%{box-shadow:0 0 0 16px rgba(37,211,102,0);} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0);} }

.game-fab {
  position: fixed; bottom: 92px; inset-inline-end: 24px; width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--navy), var(--navy-500)); color: var(--gold);
  border: 2px solid var(--gold); border-radius: 50%; display: grid; place-items: center;
  font-size: 1.5rem; box-shadow: 0 8px 24px rgba(201,162,75,0.4); z-index: 900;
  transition: transform var(--transition);
}
.game-fab:hover { transform: scale(1.1) rotate(-8deg); background: var(--gold); }

.back-top {
  position: fixed; bottom: 160px; inset-inline-end: 24px; width: 48px; height: 48px;
  background: var(--navy); color: var(--white); border: 1px solid var(--gold); border-radius: 12px;
  display: grid; place-items: center; font-size: 1.2rem; cursor: pointer; z-index: 900;
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: all var(--transition);
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--gold); color: var(--navy); }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .split { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px;
    gap: 4px; transform: translateY(-150%); transition: transform var(--transition);
    box-shadow: var(--shadow); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav-links.open { transform: none; }
  .nav-links a { width: 100%; padding: 12px 14px; }
  .nav-toggle { display: grid; }
  .nav-actions .btn-primary { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 88vh; }
  .hero p { font-size: 1.02rem; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
  .empty-state { padding: 44px 22px; }
  .map-embed iframe { height: 300px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .brand .brand-text span { display: none; }
  .brand .logo-mark { width: 40px; height: 40px; }
  .icon-btn { width: 38px; height: 38px; }
  .whatsapp-fab { width: 50px; height: 50px; bottom: 18px; inset-inline-end: 18px; }
  .game-fab { width: 50px; height: 50px; bottom: 80px; inset-inline-end: 18px; }
  .back-top { bottom: 142px; inset-inline-end: 18px; width: 42px; height: 42px; }
  .section-head { margin-bottom: 36px; }
  .es-actions .btn { flex: 1 1 100%; justify-content: center; }
  .job-item { flex-direction: column; align-items: flex-start; }
  .footer-grid { gap: 26px; }
}
