/* Core setup handled by Tailwind, custom overrides here */
body {
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  overflow-x: hidden;
}

/* Typography override: Proxima Nova / Montserrat for headings, section titles, buttons, and navigation links */
h1, h2, h3, h4, h5, h6,
.font-fancy,
button,
.btn,
.magnetic-btn,
nav a,
a[class*="nav-link"],
.mobile-nav-link {
  font-family: "Proxima Nova", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: initial;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis-stopped {
  overflow: hidden;
}

.lenis-scrolling iframe {
  pointer-events: none;
}

/* Base styles for GSAP animation targets */
.hero-title-line span {
  display: inline-block;
  will-change: transform, opacity;
}

.hero-element {
  will-change: transform, opacity;
}

.brand-strip-container {
  will-change: transform, opacity;
}

.service-card {
  will-change: transform, opacity;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 74, 28, 0.2) !important;
  box-shadow:
    0 25px 60px -15px rgba(255, 74, 28, 0.08),
    0 20px 40px -20px rgba(0, 0, 0, 0.02) !important;
}

.odoo-card {
  will-change: transform, opacity;
}

.why-card {
  will-change: transform, opacity;
}

/* Sidebar Toggle States */
#sov.op {
  opacity: 1;
  pointer-events: auto;
}

#sb.op {
  inset-inline-end: 0 !important;
}

/* Background video layout and styling */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

/* Premium dark linear gradient overlay above video — reduced for better video visibility */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(2, 6, 23, 0.52) 0%,
    rgba(2, 6, 23, 0.38) 50%,
    rgba(2, 6, 23, 0.22) 100%
  );
  z-index: 1;
}

/* Responsive adjustments for mobile visibility */
@media (max-width: 767px) {
  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(2, 6, 23, 0.45) 0%,
      rgba(2, 6, 23, 0.30) 60%,
      rgba(2, 6, 23, 0.18) 100%
    );
  }
  .hero-video {
    opacity: 0.62;
    object-position: center top;
  }
}

/* Elevated content container layout above overlays and video */
.hero-content {
  position: relative;
  z-index: 5;
}

/* Premium Noise texture */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Infinite marquee track (Seamless GPU-Accelerated translation) */
@keyframes marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.marquee-wrapper {
  direction: ltr !important;
}

.marquee-track {
  display: flex !important;
  flex-direction: row !important;
  direction: ltr !important;
  width: max-content;
  animation: marquee 30s linear infinite;
  will-change: transform;
}

.marquee-logo img {
  max-height: 3rem;
  width: auto;
  object-fit: contain;
}

/* Language visibility: show only the matching language variant */
html[lang="ar"] .lang-en {
  display: none !important;
}
html[lang="ar"] .lang-ar {
  display: inline !important;
}
html:not([lang="ar"]) .lang-en {
  display: inline !important;
}
html:not([lang="ar"]) .lang-ar {
  display: none !important;
}

/* Ensure inline/blocks behave consistently */
.lang-en,
.lang-ar {
  display: inline;
}

/* ==========================================================================
   Services Section Product Image Style (Task 1 Restored Exclusively)
   ========================================================================== */
.service-card img,
.service-card .overflow-hidden {
  background-color: #ffffff !important;
}

/* ==========================================================================
   Jobs / Careers Section Styles
   ========================================================================== */
.career-card {
  will-change: transform, opacity, box-shadow, border-color;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.career-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 74, 28, 0.3) !important;
  box-shadow:
    0 20px 40px -15px rgba(255, 74, 28, 0.06),
    0 15px 30px -20px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* Subtle animated underline on APPLY NOW link */
.career-apply-btn {
  position: relative;
}

.career-apply-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: #ff4a1c;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.career-card:hover .career-apply-btn::after {
  width: 100%;
}

/* Careers CTA Banner */
.careers-cta {
  will-change: transform, opacity;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Videos Section Styles
   ========================================================================== */
.video-card {
  will-change: transform, opacity;
}

/* Modal states */
#video-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#video-modal.active .video-modal-inner {
  transform: scale(1);
}

/* ==========================================================================
   Articles & Contact Styles
   ========================================================================== */
.blog-card {
  will-change: transform, opacity, box-shadow, border-color;
}

.contact-details > div {
  will-change: transform, border-color;
}

/* Fix Odoo card hover glitch by preventing children from capturing pointer events */
.odoo-card > * {
  pointer-events: none;
}

/* ==========================================================================
   Mobile Navigation (Full-Screen Drawer)
   ========================================================================== */
#mobile-menu.open {
  transform: translateX(0);
}

[dir="rtl"] #mobile-menu {
  transform: translateX(-100%);
}

[dir="rtl"] #mobile-menu.open {
  transform: translateX(0);
}

#mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

body.menu-open {
  overflow: hidden;
}

/* ==========================================================================
   Odoo Modules Mobile Accordion
   ========================================================================== */
@media (max-width: 767px) {
  #solutions-grid.modules-expanded .odoo-card.mobile-hidden {
    display: flex !important;
  }

  #toggle-modules-arrow.rotated {
    transform: rotate(180deg);
  }

  #careers-grid.careers-expanded .career-card.mobile-hidden {
    display: flex !important;
  }

  #toggle-careers-arrow.rotated {
    transform: rotate(180deg);
  }
}

/* ==========================================================================
   Sidebar RTL (logical positioning)
   ========================================================================== */
#sb.op {
  inset-inline-end: 0 !important;
}

[dir="rtl"] #sb {
  inset-inline-end: auto;
  inset-inline-start: -100%;
  border-inline-start: 1px solid #f3f4f6;
}

[dir="rtl"] #sb.op {
  inset-inline-start: 0 !important;
  inset-inline-end: auto !important;
}

/* ==========================================================================
   AI Chatbot Widget
   ========================================================================== */
#chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[dir="rtl"] #chatbot-window {
  transform-origin: bottom left;
}

.chat-fab-pulse {
  animation: chat-pulse 2.5s ease-out infinite;
}

@keyframes chat-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-bot {
  align-items: flex-start;
}
.chat-msg-user {
  align-items: flex-end;
}

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.chat-bubble-bot {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  color: #0d1117;
  border-end-start-radius: 4px;
}

.chat-bubble-user {
  background: #ff4a1c;
  color: #fff;
  border-end-end-radius: 4px;
}

.chat-time {
  font-size: 10px;
  color: #9ca3af;
}

.chat-quick {
  padding: 6px 13px;
  border-radius: 100px;
  border: 1.5px solid #ff4a1c;
  color: #ff4a1c;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.chat-quick:hover {
  background: #ff4a1c;
  color: #fff;
}

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  border-end-start-radius: 4px;
  width: fit-content;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: chat-typing-bounce 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chat-typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* Form status */
#form-status.ok {
  display: block;
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

#form-status.er {
  display: block;
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

/* Arabic typography — Unified Tajawal stack */
html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] a,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] label,
html[dir="rtl"] .font-fancy,
html[dir="rtl"] .font-mono {
  font-family: "Tajawal", sans-serif !important;
}

/* RTL: flip arrow SVGs horizontally in Arabic */
html[dir="rtl"] .arrow-icon {
  transform: scaleX(-1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.arrow-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

/* RTL: reverse the hover slide direction so arrows animate toward reading direction */
html[dir="rtl"] .group:hover .arrow-icon,
html[dir="rtl"] a:hover .arrow-icon,
html[dir="rtl"] button:hover .arrow-icon {
  transform: scaleX(-1) translateX(4px);
}

/* Scroll reveal: visible by default; GSAP enhances on scroll */
.scroll-reveal {
  opacity: 1;
  transform: translateY(0);
}

html.js-anim .scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
}

.scroll-reveal.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
