/* =========================
   إعدادات عامة + متغيّرات
   ========================= */
@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap");

/* ألوان الهوية */
:root {
  --blue-color: #1D2D50;
  --purple-color: #6A4C93;
  --yellow-color: #FFD166;
  --gray-color: #CBD3DC;
  --white-color: #f9fafb;
}

/* الخط الأساسي + ألوان الخلفية حسب الثيم */
body {
  font-family: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* وضع اللايت – يستخدم ألوان الهوية */
body.theme-light {
  --bg-page: var(--white-color);
  --bg-section-alt: #eef2f7;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;

  --primary: var(--blue-color);   /* العناوين + الأزرار */
  --primary-soft: #e3e7f2;
  --accent: var(--yellow-color);  /* النجوم/الهايلايت */

  --border-subtle: var(--gray-color);
  --nav-bg: rgba(249, 250, 251, 0.92);
  --nav-border: var(--gray-color);
  --nav-text: #111827;
  --footer-bg: #111827;
  --footer-text: #e5e7eb;
}

/* وضع الدارك – فضائي أكثر */
body.theme-dark {
  --bg-page: #020617;
  --bg-section-alt: #020617;
  --bg-card: #0b1120;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;

  --primary: var(--purple-color); /* البنفسجي للأزرار والعناوين */
  --primary-soft: #111827;
  --accent: var(--yellow-color);

  --border-subtle: #1f2937;
  --nav-bg: rgba(7, 12, 24, 0.95);
  --nav-border: #1f2937;
  --nav-text: #e5e7eb;
  --footer-bg: #020617;
  --footer-text: #9ca3af;
}

/* نصوص خافتة */
.text-muted {
  color: var(--text-muted) !important;
}

/* =========================
   Navbar
   ========================= */

.main-navbar {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.main-navbar .navbar-brand,
.main-navbar .nav-link,
.main-navbar .btn {
  color: var(--nav-text) !important;
}

.navbar-brand span {
  font-size: 0.9rem;  /* أصغر من الافتراضي */
  font-weight: 500;
}

.main-navbar .navbar-collapse {
  align-items: center;
}

.main-navbar .navbar-nav {
  margin-inline: auto; /* تضمن تمركز القائمة بين اللوغو والأزرار */
}

.main-navbar .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
}

.main-navbar .nav-link:hover {
  color: var(--primary) !important;
}

.main-navbar .navbar-toggler {
  border-color: var(--nav-text);
}

.navbar-toggler-icon {
  width: 1.3rem;
  height: 1.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(229,231,235,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* حجم اللوجو */
.brand-logo {
  height: 44px;
  width: auto;
}

/* افتراضياً: نظهر لوقو اللايت ونخفي لوقو الدارك */
.logo-light {
  display: inline-block;
}
.logo-dark {
  display: none;
}

/* في وضع الدارك: نخفي لوقو اللايت ونظهر الأبيض */
body.theme-dark .logo-light {
  display: none;
}
body.theme-dark .logo-dark {
  display: inline-block;
}

/* زرّي اللغة والثيم */
#langToggleBtn,
#themeToggleBtn {
  border-color: var(--nav-text) !important;
  color: var(--nav-text) !important;
}

#langToggleBtn:hover,
#themeToggleBtn:hover {
  background-color: var(--primary-soft) !important;
  color: var(--primary) !important;
}

/* =========================
   Hero Section
   ========================= */

#hero {
  position: relative;
  padding-top: 6rem;
  padding-bottom: 5rem;
  overflow: hidden;
}

/* خلفية الهيرو في وضع اللايت – ناعمة بأبيض + رمادي الهوية */
body.theme-light #hero {
  background: linear-gradient(
    135deg,
    var(--white-color) 0%,
    #e4ebf5 40%,
    var(--gray-color) 100%
  );
}

/* خلفية الهيرو في وضع الدارك – فضاء بأزرق + بنفسجي + أصفر + نجوم */
body.theme-dark #hero {
  background:
    radial-gradient(circle at 10% 20%, rgba(106, 76, 147, 0.35) 0, transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(29, 45, 80, 0.55) 0, transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(255, 209, 102, 0.18) 0, transparent 60%),
    #020617;
}

body.theme-dark #hero::before,
body.theme-dark #hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* نجوم أكثر */
body.theme-dark #hero::before {
  background-image:
    radial-gradient(circle at 5% 15%, rgba(255, 255, 255, 0.7) 0, transparent 2px),
    radial-gradient(circle at 20% 40%, rgba(255, 255, 255, 0.6) 0, transparent 2px),
    radial-gradient(circle at 35% 10%, rgba(255, 255, 255, 0.5) 0, transparent 2px),
    radial-gradient(circle at 60% 25%, rgba(255, 255, 255, 0.5) 0, transparent 2px),
    radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.55) 0, transparent 2px),
    radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0.45) 0, transparent 2px),
    radial-gradient(circle at 45% 90%, rgba(255, 255, 255, 0.5) 0, transparent 2px),
    radial-gradient(circle at 90% 85%, rgba(255, 255, 255, 0.5) 0, transparent 2px);
  opacity: 0.45;
}

/* هالات لونية خفيفة */
body.theme-dark #hero::after {
  background:
    radial-gradient(circle at 80% 10%, rgba(106, 76, 147, 0.4) 0, transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(34, 211, 238, 0.25) 0, transparent 55%);
  opacity: 0.8;
}

/* عنوان الهيرو (لو استخدمتي h1 بدون كلاس) */
#hero h1 {
  font-size: 2.1rem;
  line-height: 1.4;
}

@media (min-width: 992px) {
  #hero h1 {
    font-size: 2.6rem;
  }
}

/* ===== تحسين الهيرو (النص) ===== */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background-color: var(--primary-soft);
  color: var(--text-main);
  font-size: 0.8rem;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--accent);
}

.hero-title {
  font-size: 2.1rem;
  line-height: 1.4;
}

@media (min-width: 992px) {
  .hero-title {
    font-size: 2.8rem;
  }
}

.hero-subtitle {
  color: var(--text-muted);
}

/* معلومات صغيرة تحت الأزرار */
.hero-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta-item {
  position: relative;
  padding-inline-start: 1.25rem;
}

.hero-meta-item::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  inset-inline-start: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: var(--accent);
}

/* الأزرار في الهيرو */
#hero .btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

#hero .btn-primary:hover {
  background-color: #4338ca;
  border-color: #4338ca;
}

#hero .btn-outline-secondary {
  border-color: var(--primary);
  color: var(--primary);
}

#hero .btn-outline-secondary:hover {
  background-color: var(--primary-soft);
  color: var(--primary);
}

/* ===== العناصر الفضائية في الهيرو ===== */

.hero-visual {
  position: relative;
  width: min(520px, 100%);  /* أكبر */
  height: 380px;
  margin: 0 auto;
  overflow: visible;
}

/* في الشاشات الصغيرة نخفي الصورة تماماً */
@media (max-width: 767.98px) {
  .hero-visual {
    display: none;
  }

  #hero {
    padding-bottom: 3.5rem;
  }
}

/* ===== المدارات والكواكب في الهيرو ===== */

/* نفس hero-visual اللي عندك حالياً يبقى كما هو */

/* المدارات (دوائر ثابتة) */
.hero-orbit {
  position: absolute;
  border-radius: 50%;
}

/* المدار الكبير الأبيض */
.hero-orbit-lg {
  width: 260px;
  height: 260px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(203, 213, 220, 0.8);
}

/* المدار الأصغر (أصفر دائمًا في اللايت والدارك) */
.hero-orbit-sm {
  width: 170px;
  height: 170px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--yellow-color);
}

/* الحاويات التي تدور حول المركز وتحمل الكواكب */
.hero-orbit-track {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

/* المسار الخاص بالكوكب الكبير (على المدار الأبيض) */
.hero-orbit-track-lg {
  width: 260px;
  height: 260px;
  animation: orbit-lg 28s linear infinite;
}

/* المسار الخاص بالكوكب الصغير (على المدار الأصفر) */
.hero-orbit-track-sm {
  width: 170px;
  height: 170px;
  animation: orbit-sm 18s linear infinite reverse;
}

/* الكوكب الكبير الأصفر – على حافة المسار الكبير */
.hero-planet {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffffff 0, var(--yellow-color) 40%, #f97316 100%);
  top: 50%;
  left: 100%;                     /* على الحافة اليمنى للدائرة */
  transform: translate(-50%, -50%);
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.7);
}

/* الكوكب الصغير الرمادي – على حافة المسار الأصغر */
.hero-planet-small {
  width: 26px;
  height: 26px;
  background: radial-gradient(circle at 30% 20%, #ffffff 0, #9ca3af 40%, #4b5563 100%);
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.7);
}

/* حركات الدوران – الكواكب تلف داخل المدارات الخاصة بها */
@keyframes orbit-lg {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbit-sm {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}


/* نص الكود تحت المدار – مخفي تماماً الآن */
.hero-code-card {
  display: none;
}

/* =========================
   Sections عامة
   ========================= */

section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* خلفية بديلة لبعض الأقسام لو حبيتي */
.section-alt {
  background-color: var(--bg-section-alt);
}

/* عناوين الأقسام */
section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-family: "Courier Prime", "Tajawal", system-ui, -apple-system, BlinkMacSystemFont,
  "Segoe UI", sans-serif;
}

.hero-badge,
.about-tag,
.service-tag,
.portfolio-tag {
  font-family: "Courier Prime", "Tajawal", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
}

/* =========================
   Cards (الخدمات + الأعمال)
   ========================= */

.card {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.3s ease,
    border-color 0.3s ease, color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.card-title {
  font-weight: 600;
}

/* تأكيد لون النص في الدارك */
body.theme-dark .card,
body.theme-dark .card-title,
body.theme-dark .card-text {
  color: var(--text-main);
}

/* =========================
   Contact Section
   ========================= */

#contact .form-control,
#contact .form-select {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

body.theme-dark #contact .form-control,
body.theme-dark #contact .form-select {
  background-color: #020617;
}

#contact .form-control:focus,
#contact .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* زر الإرسال */
#contact button[type="submit"] {
  background-color: var(--primary);
  border-color: var(--primary);
}

#contact button[type="submit"]:hover {
  background-color: #4338ca;
  border-color: #4338ca;
}

/* =========================
   Footer
   ========================= */

footer {
  background-color: var(--footer-bg) !important;
  color: var(--footer-text) !important;
  border-top: 1px solid var(--nav-border);
}

.footer-brand {
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--footer-text);
  opacity: 0.9;
}

/* روابط الفوتر */
.footer-nav {
  justify-content: center;
}

.footer-link {
  font-size: 0.85rem;
  color: var(--footer-text);
  opacity: 0.8;
}

.footer-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* الحقوق */
.footer-meta {
  font-size: 0.8rem;
  color: var(--footer-text);
  opacity: 0.8;
}

/* في الشاشات الصغيرة نخلي كل شيء في المنتصف */
@media (max-width: 767.98px) {
  footer {
    text-align: center;
  }

  .footer-nav {
    justify-content: center;
  }

  .footer-meta {
    margin-top: 0.5rem;
  }
}

/* =========================
   لغة + اتجاه
   ========================= */

/* العناصر الإنجليزية محاذية لليسار عندما تظهر */
.lang-en {
  direction: ltr;
  unicode-bidi: bidi-override;
}

/* حركات بسيطة للروابط */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================
   About Section
   ========================= */
.about-text {
  font-size: 0.98rem;
  line-height: 1.9;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.about-text-small {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* اللوحة الجانبية (البطاقات) */
.about-panel {
  background-color: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

/* شريط صغير عنوان داخلي */
.about-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background-color: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 500;
}

.about-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: var(--accent);
}

/* قائمة النقاط */
.about-list {
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
}

.about-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.about-dot {
  margin-top: 0.4rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: var(--accent);
}

/* في الشاشات الصغيرة نخلي البانل تحت النص بمحاذاة كاملة */
@media (max-width: 991.98px) {
  .about-panel {
    margin-top: 0.5rem;
  }
}

/* =========================
   Services Section
   ========================= */

.services-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* كرت الخدمة */
.service-card {
  position: relative;
  overflow: hidden;
}

/* أيقونة دائرية أعلى الكرت */
.service-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  background: radial-gradient(circle at 30% 20%, #ffffff 0, var(--accent) 60%, #f97316 100%);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.35);
}

/* شارة صغيرة فوق العنوان */
.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background-color: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.service-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: var(--accent);
}

/* قائمة نقاط داخل الكرت */
.service-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.service-list li + li {
  margin-top: 0.2rem;
}

/* تحسين بسيط للحالة الداكنة */
body.theme-dark .service-card {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.65);
}

/* =========================
   Portfolio Section
   ========================= */

.portfolio-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* الكرت */
.portfolio-card {
  position: relative;
}

/* صورة مصغّرة وهمية (Placeholder) */
.portfolio-thumb {
  position: relative;
  height: 160px;
  border-radius: 14px;
  margin: 0.85rem 0.85rem 1.1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 209, 102, 0.15) 0, transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(106, 76, 147, 0.35) 0, transparent 55%),
    linear-gradient(135deg, var(--blue-color), #020617);
}

/* صورة العمل داخل الكرت */
.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* في وضع اللايت نخليها أفتح شوي */
body.theme-light .portfolio-thumb {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 209, 102, 0.2) 0, transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(106, 76, 147, 0.35) 0, transparent 55%),
    linear-gradient(135deg, #1e293b, var(--blue-color));
}

/* شارة صغيرة على الزاوية */
.portfolio-tag {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 0.75rem;
  backdrop-filter: blur(6px);
}

/* نص فوق الصورة عند الحافة السفلية */
.portfolio-thumb-overlay {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #e5e7eb;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.8), transparent);
}

/* معلومات صغيرة تحت الوصف */
.portfolio-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* =========================
   Contact Section (layout)
   ========================= */

.contact-wrapper {
  align-items: stretch;
}

.contact-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 0.6rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  color: var(--text-main);
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.contact-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: var(--accent);
  margin-top: 0.45rem;
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.contact-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
}

.contact-channel i {
  font-size: 1.1rem;
}

.contact-channel:hover {
  text-decoration: underline;
}

/* كرت النموذج */
.contact-card {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.contact-small-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* على الشاشات الصغيرة النموذج يأخذ عرض كامل وتروح المسافات الإضافية */
@media (max-width: 991.98px) {
  .contact-wrapper {
    row-gap: 2rem;
  }
}

/* =========================
   تحسين عرض الجوال – الهيرو
   ========================= */

@media (max-width: 991.98px) {
  /* نص الهيرو في المنتصف لما تختفي الصورة */
  #hero .col-md-6:first-child {
    text-align: center;
  }

  .hero-badge {
    margin-inline: auto;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    max-width: 32rem;
    margin-inline: auto;
  }

  /* الأزرار في الهيرو في المنتصف */
  #hero .d-flex.flex-wrap.gap-2 {
    justify-content: center;
  }

  .hero-meta {
    text-align: center;
    margin-top: 0.75rem;
  }
}

/* =========================
   تحسين نموذج التواصل في الجوال
   ========================= */

@media (max-width: 575.98px) {
  /* نخلي صف الزر + الملاحظة عمودي بدل أفقي */
  .contact-card .d-flex.justify-content-between.align-items-center {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #contact button[type="submit"] {
    width: 100%;
  }

  .contact-small-note {
    text-align: center;
  }
}

/* =========================
   لمسات عامة للجوال
   ========================= */

@media (max-width: 575.98px) {
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .card {
    border-radius: 12px;
  }

  .portfolio-thumb {
    height: 140px;
  }
}
