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

/* Color Variables & Saudi Desert Sand + Logo Theme Tokens */
:root {
  --bg-deep-desert: #0B0A08;
  --bg-card-glass: rgba(22, 19, 14, 0.75);
  --bg-card-hover: rgba(35, 30, 22, 0.9);
  --border-glass: rgba(212, 175, 55, 0.25);
  --border-glass-cyan: rgba(91, 193, 215, 0.3);
  --border-glass-bright: rgba(212, 175, 55, 0.6);
  
  --primary-blue: #4C64C4;
  --bright-cyan: #5BC1D7;
  --desert-gold: #D4AF37;
  --desert-sand: #E5B869;
  
  --text-white: #F5F3EF;
  --text-muted: #A8A29E;
  
  --glow-sand: 0 0 2rem rgba(212, 175, 55, 0.35);
  --glow-cyan: 0 0 2rem rgba(91, 193, 215, 0.35);
  --glow-blue: 0 0 2.5rem rgba(76, 100, 196, 0.45);
  
  --font-ar: 'Tajawal', sans-serif;
  --font-en: 'Outfit', sans-serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-deep-desert);
  color: var(--text-white);
}

body {
  font-family: var(--font-ar);
  background-color: var(--bg-deep-desert);
  color: var(--text-white);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  cursor: default;
}

/* Hide default cursor on desktop when custom cursor is active on public pages */
@media (min-width: 768px) {
  body:not(.admin-body),
  body:not(.admin-body) a,
  body:not(.admin-body) button,
  body:not(.admin-body) input,
  body:not(.admin-body) select,
  body:not(.admin-body) textarea,
  body:not(.admin-body) .glass-panel {
    cursor: none !important;
  }
}

/* Explicitly restore native cursors for Admin Dashboard */
body.admin-body,
body.admin-body * {
  cursor: auto !important;
}
body.admin-body a,
body.admin-body button,
body.admin-body select,
body.admin-body [role="button"],
body.admin-body input[type="submit"],
body.admin-body input[type="button"] {
  cursor: pointer !important;
}
body.admin-body input[type="text"],
body.admin-body input[type="email"],
body.admin-body input[type="password"],
body.admin-body input[type="number"],
body.admin-body textarea {
  cursor: text !important;
}

/* RTL / LTR Font Assignment & Dynamic Responsive Text Alignment */
html[dir="rtl"] body {
  font-family: var(--font-ar);
  text-align: right;
}

html[dir="ltr"] body {
  font-family: var(--font-en);
  text-align: left;
}

/* Alignment Helper Classes */
.text-start { text-align: start !important; }
.text-center { text-align: center !important; }
.text-end { text-align: end !important; }

/* Responsive Mobile & Tablet Alignment Engine (توسيط ومحاذاة راقية لتجربة الموبايل) */
@media (max-width: 768px) {
  .badge-glow {
    margin-left: auto;
    margin-right: auto;
  }

  /* Footer elements centering on mobile */
  footer .grid > div {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    text-align: center !important;
  }

  footer img {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  footer ul {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    text-align: center !important;
    width: 100%;
  }

  footer li {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Center cards & headings on mobile */
  .glass-panel.text-start {
    text-align: center !important;
  }

  .glass-panel.text-start .inline-flex,
  .glass-panel.text-start .pt-2,
  .glass-panel.text-start .pt-4 {
    justify-content: center !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* Section header centering */
  .section-header,
  .hero-animate {
    text-align: center !important;
    justify-content: center !important;
  }
}

/* Mobile Typography & Text Distribution Optimization (تجربة جوال نظيفة وراقية) */
@media (max-width: 640px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
  }
  
  h1, h2, h3 {
    letter-spacing: -0.01em;
    line-height: 1.35 !important;
  }

  p {
    line-height: 1.75 !important;
    font-size: 0.9375rem !important;
  }

  .glass-panel {
    padding: 1.25rem !important;
    border-radius: 1.25rem !important;
  }
}

/* 🌟 Dynamic Background Fluid Ambient Orbs (Gold, Royal Blue, Electric Cyan) */
.bg-mesh-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #0B0A08;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  will-change: transform;
}

.bg-orb-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--desert-gold) 0%, rgba(212, 175, 55, 0) 70%);
  animation: floatOrb1 20s ease-in-out infinite alternate;
}

.bg-orb-2 {
  bottom: -15%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, var(--primary-blue) 0%, rgba(76, 100, 196, 0) 70%);
  animation: floatOrb2 25s ease-in-out infinite alternate;
}

.bg-orb-3 {
  top: 40%;
  left: 30%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--bright-cyan) 0%, rgba(91, 193, 215, 0) 70%);
  animation: floatOrb3 22s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15vw, 12vh) scale(1.15); }
  100% { transform: translate(-8vw, 20vh) scale(0.9); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-18vw, -15vh) scale(1.2); }
  100% { transform: translate(10vw, -10vh) scale(0.95); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-12vw, 15vh) scale(1.25); }
  100% { transform: translate(15vw, -12vh) scale(0.85); }
}

/* 🖱️ Custom Interactive Glowing Animated Cursor */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--bright-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--bright-cyan);
  transition: transform 0.05s ease, background 0.2s ease;
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--desert-gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.custom-cursor-ring.cursor-hover {
  width: 65px;
  height: 65px;
  border-color: var(--bright-cyan);
  background: rgba(91, 193, 215, 0.12);
  box-shadow: 0 0 25px rgba(91, 193, 215, 0.6);
}

/* Sizing via rem and vw for Zero Overlapping Responsive Artistry */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02vw;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 3.0rem); }
h3 { font-size: clamp(1.4rem, 2.2vw, 2.0rem); }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.4rem); }
p  { font-size: clamp(0.95rem, 1.15vw, 1.15rem); color: var(--text-muted); }

/* Glassmorphism Components */
.glass-panel {
  position: relative;
  z-index: 10;
  background: var(--bg-card-glass);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  border: 1px solid var(--border-glass);
  border-radius: 1.25rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.7);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-bright);
  box-shadow: var(--glow-sand);
  transform: translateY(-0.3rem);
}

.glass-header {
  background: rgba(11, 10, 8, 0.88);
  backdrop-filter: blur(1.5rem);
  -webkit-backdrop-filter: blur(1.5rem);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.glass-nav-item {
  position: relative;
  color: var(--text-white);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.glass-nav-item:hover, .glass-nav-item.active {
  color: var(--desert-sand);
}

.glass-nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--desert-gold), var(--bright-cyan));
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.glass-nav-item:hover::after, .glass-nav-item.active::after {
  width: 80%;
}

/* Gradient Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--bright-cyan) 50%, var(--desert-gold) 100%);
  color: #FFFFFF;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  transition: all 0.35s ease;
}

.btn-primary:hover {
  transform: scale(1.04);
  box-shadow: 0 0 3rem rgba(212, 175, 55, 0.7);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-white);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(0.8rem);
  transition: all 0.35s ease;
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--desert-gold);
  color: var(--desert-sand);
}

/* Badge Styling */
.badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(91, 193, 215, 0.15));
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--desert-sand);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* Horizontal Infinite Marquee Carousel */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 1.5rem 0;
}

.marquee-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: marquee 35s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

html[dir="rtl"] .marquee-track {
  animation-direction: reverse;
}

/* Fast Mobile Marquee Carousel for Clients - Seamless Zero-Gap Infinite Loop */
.client-fast-marquee-track {
  display: flex;
  gap: 0.85rem;
  width: max-content;
  animation: clientMarqueeSmooth 16s linear infinite !important;
  will-change: transform;
}

.client-fast-marquee-track-reverse {
  display: flex;
  gap: 0.85rem;
  width: max-content;
  animation: clientMarqueeReverseSmooth 16s linear infinite !important;
  will-change: transform;
}

@keyframes clientMarqueeSmooth {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes clientMarqueeReverseSmooth {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

html[dir="rtl"] .client-fast-marquee-track {
  animation: clientMarqueeSmoothRTL 16s linear infinite !important;
}

html[dir="rtl"] .client-fast-marquee-track-reverse {
  animation: clientMarqueeReverseSmoothRTL 16s linear infinite !important;
}

@keyframes clientMarqueeSmoothRTL {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(50%, 0, 0); }
}

@keyframes clientMarqueeReverseSmoothRTL {
  0% { transform: translate3d(50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.logo-card-frame-mobile {
  width: 8rem;
  height: 4.8rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 0.9rem;
  box-shadow: 0 0.3rem 1.2rem rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-card-frame-mobile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.25rem;
}


/* High-Contrast Adaptive Client Logo Frame */
.logo-card-frame {
  width: 11.5rem;
  height: 6.8rem;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 1.15rem;
  transition: all 0.35s ease;
  box-shadow: 0 0.5rem 1.8rem rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.logo-card-frame:hover {
  border-color: var(--bright-cyan);
  box-shadow: 0 0 2rem rgba(91, 193, 215, 0.5);
  transform: translateY(-0.25rem) scale(1.05);
}

.logo-card-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  transition: transform 0.35s ease;
}

.logo-card-frame:hover img {
  transform: scale(1.06);
}

/* Partner Logo Card Frame (High Contrast White & Desert Gold Accent) */
.partner-logo-frame {
  width: 13.5rem;
  height: 7.8rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 2.5px solid var(--desert-gold);
  border-radius: 1.25rem;
  transition: all 0.35s ease;
  box-shadow: 0 0.6rem 2.2rem rgba(0, 0, 0, 0.7), var(--glow-sand);
  overflow: hidden;
}

.partner-logo-frame:hover {
  border-color: var(--bright-cyan);
  box-shadow: 0 0 2.5rem rgba(91, 193, 215, 0.6);
  transform: translateY(-0.3rem) scale(1.06);
}

.partner-logo-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* Mobile Fullscreen Glass Overlay & Hamburger */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(11, 10, 8, 0.96);
  backdrop-filter: blur(2rem);
  -webkit-backdrop-filter: blur(2rem);
  display: flex;
  flex-direction: column;
  padding: 6rem 2rem 3rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Accordion Transition */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.accordion-content.open {
  max-height: 25rem;
  transition: max-height 0.4s ease-in-out;
}

/* Sticky Floating Action Bar for Mobile */
.mobile-floating-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(5rem);
  z-index: 90;
  width: 90%;
  max-width: 28rem;
  padding: 0.75rem 1.5rem;
  background: rgba(22, 19, 14, 0.95);
  backdrop-filter: blur(1.5rem);
  border: 1px solid var(--border-glass-bright);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.8), var(--glow-sand);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-floating-bar.visible {
  transform: translateX(-50%) translateY(0);
}

/* Fast Moving Transparent News Ticker (شريط الأخبار المتحرك بسرعة بدون إطار) */
.hero-ticker-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: transparent;
  padding: 1.25rem 0;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.hero-ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  gap: 3.5rem;
  will-change: transform;
  animation: heroTickerSlide 18s linear infinite;
}

.hero-ticker-track:hover {
  animation-play-state: paused;
}

@keyframes heroTickerSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

html[dir="rtl"] .hero-ticker-track {
  animation: heroTickerSlideRtl 18s linear infinite;
}

@keyframes heroTickerSlideRtl {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

.hero-ticker-item {
  font-size: 1.2rem;
  font-weight: 800;
  color: #D4AF37;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.hero-ticker-item:hover {
  color: #FFFFFF;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

@media (min-width: 640px) {
  .hero-ticker-item {
    font-size: 1.5rem;
  }
}

/* Desktop Services Dropdown Hover & Explicit Show State */
#desktop-services-dropdown:hover #desktop-services-menu,
#desktop-services-dropdown:focus-within #desktop-services-menu,
#desktop-services-menu:hover,
#desktop-services-menu.is-open {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

#desktop-services-dropdown:hover #desktop-services-chevron {
  transform: rotate(180deg) !important;
}
