 body {
    font-family: 'Inter', sans-serif;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
     overflow-x: hidden;
     background-color: #000;
 }
 
   body.lang-ar {
    font-family: 'Tajawal', sans-serif;
  }


 /* --- Font Rules for Headings --- */
h1, h2, h3 {
    font-family: 'Inter', sans-serif;
}
#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -9999; /* Use new, safer z-index */
    pointer-events: none; /* Add new, safer property */
    opacity: 0.6; /* Keep original opacity */
    /* width: 100%; is no longer needed as the new JS handles it */
}
 .matrix-green {
     color: #84C022;
 }
 
 /* IMPRESSIVE ANIMATIONS */
 .scroll-reveal {
     opacity: 0;
     transform: translateY(60px) scale(0.95);
     transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1);
 }
 .scroll-reveal.visible {
     opacity: 1;
     transform: translateY(0) scale(1);
 }
 
 /* Hero Animations */
 @keyframes hero-title-animate {
     from {
         opacity: 0;
         transform: translate3d(0, 40px, 0) scale3d(1, 1, 1) rotateX(90deg) rotateY(0) rotateZ(0deg) skew(15deg, 0);
     }
     to {
         opacity: 1;
         transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0deg) skew(0, 0);
     }
 }
 
 /* NEW: Hero Logo Animation */

 /* =========================
   LOGO SEPARATION (NAV vs HERO)
   ========================= */

/* Navbar logo – small, stable */
.navbar-logo {
  height: 32px;
  width: auto;
}

/* Hero logo – big & expressive */
.hero-logo {
  width: 4700px;
  height: auto;
  transform: scale(3.5);
  transform-origin: center;

}

/* Responsive hero logo */
@media (max-width: 768px) {
  .hero-logo {
    height: 160px;
  }
}

 @keyframes hero-logo-animate {
     from {
         opacity: 0;
         transform: scale(0.8) translateY(20px);
     }
     to {
         opacity: 1;
         transform: scale(1) translateY(0);
     }
 }
 .hero-logo-animated {
     opacity: 0;
     animation: hero-logo-animate 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
 }

 .hero-title-animated {
     opacity: 0;
     transform-style: preserve-3d;
     animation: hero-title-animate 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s forwards;
 }
 
 .hero-grid-animated {
     transform-style: preserve-3d;
     opacity: 0;
     transform: translate3d(0, 50px, 0) scale3d(0.95, 0.95, 1) rotateX(30deg) rotateY(0) rotateZ(0deg) skew(5deg, 0);
     animation: grid-animate 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) 0.8s forwards;
 }
 @keyframes grid-animate {
      to {
         opacity: 1;
         transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0deg) skew(0, 0);
     }
 }
 
 .hero-cards-holder { perspective: 1500px; }
 .hero-cards-grid { transition: transform 0.4s ease-out; }
 .hero-card { transition: transform 0.3s ease; }
 .hero-card:hover { transform: translateY(-15px) scale(1.05); }

 .feature-container {
     background-color: rgba(8, 8, 8, 0.8);
     backdrop-filter: blur(5px);
     -webkit-backdrop-filter: blur(5px);
     border: 1px solid rgba(132, 192, 34, 0.1);
     border-radius: 1.5rem;
     overflow: hidden;
     transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
     display: flex;
     flex-direction: column;
 }
 .feature-container:hover {
     transform: translateY(-10px);
     box-shadow: 0 15px 40px rgba(0,0,0,0.6);
 }
 /* Keep vertical padding for text content in feature containers */
 .feature-container .p-8 {
      flex-grow: 1;
      padding-top: 2rem; /* Ensure consistent padding */
      padding-bottom: 2rem;
 }

 /* Styling for story images specifically */
 .story-image-container {
      border-radius: 1.5rem;
      overflow: visible; /* Allows logo to stick out */
      transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
      background-color: #080808; /* Dark background behind image */
      border: 1px solid rgba(132, 192, 34, 0.1);
      position: relative; /* Ensure it's a positioning context */
 }
 .story-image-container:hover {
     transform: translateY(-10px) scale(1.02);
     box-shadow: 0 15px 40px rgba(0,0,0,0.6);
 }
 
 /* New Cascading Animations */
 .card-image-wrapper { 
     overflow: hidden; /* Keep this hidden for main image rounded corners */
     border-radius: 1.5rem; /* Apply radius here */
     position: relative; /* Positioning context for the logo IF moved inside */
  } 
 .card-image {
     transform: scale(1.3);
     transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
     display: block; /* Fix potential bottom space */
 }
 .scroll-reveal.visible .card-image {
     transform: scale(1);
 }
 .story-image-container:hover .card-image { /* Apply hover scale to image inside story container */
     transform: scale(1.05);
 }
 
 /* UPDATED: Text Animation to respect original colors */
 .stagger-reveal {
     opacity: 0;
     transform: translateY(10px);
     transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                 transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
 }
 
 .scroll-reveal.visible .stagger-reveal,
 .hero-subtitle-animated.visible .stagger-reveal {
     opacity: 1;
     transform: translateY(0);
 }

 /* Keep the cascade effect for cards */
 /* Adjusted delays for alternating layout */
 .scroll-reveal.visible .story-text-container h3.stagger-reveal {
     transition-delay: 0.4s;
 }
 .scroll-reveal.visible .story-text-container p.stagger-reveal {
     transition-delay: 0.5s;
 }
 /* ADDED: Delay for the new gallery button */
 .scroll-reveal.visible .story-text-container .story-gallery-button.stagger-reveal {
      transition-delay: 0.6s;
 }
 .scroll-reveal.visible .feature-container .details-button.stagger-reveal {
     transition-delay: 0.6s;
 }


 /* Slow Color Shift for 'NEW' in headline */
 .color-shift-new .green-new {
     color: #84C022; /* Initial color */
     display: inline-block;
     animation: color-shift-new-anim 4s ease-in-out infinite alternate;
 }

 @keyframes color-shift-new-anim {
     from {
         color: white;
     }
     to {
         color: #84C022;
     }
 }

 /* Carousel Styles - Keep for potential future use, but functionality removed */
 .carousel-container {
     position: relative;
 }
 .carousel-slide {
     display: none; /* Hide non-active slides */
 }
 /* Style for the single visible image */
 #story-bentley .card-image-wrapper img {
      display: block; /* Ensure the single image displays */
 }
 .carousel-dots {
     position: absolute;
     bottom: 1rem;
     left: 50%;
     transform: translateX(-50%);
     display: flex;
     gap: 0.5rem;
 }
 .carousel-dot {
     width: 8px;
     height: 8px;
     border-radius: 50%;
     background-color: rgba(255, 255, 255, 0.5);
     cursor: pointer;
     transition: background-color 0.3s;
 }
 .carousel-dot.active {
     background-color: #84C022;
 }

 .logo-fix-tall {
   max-height: none !important;
   width: 130% !important; /* Increased from 90% to make the logo larger */
   object-fit: contain;
 }
 
 /* Modal Styles (Shared) */
 .modal-backdrop {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background-color: rgba(0, 0, 0, 0.8);
     backdrop-filter: blur(10px);
     -webkit-backdrop-filter: blur(10px);
     z-index: 100;
     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0;
     transition: opacity 0.3s ease;
      padding: 1rem; /* Add padding for smaller screens */
 }
 .modal-backdrop.visible {
     opacity: 1;
 }
 .modal-base-container { /* Base styles for modal popups */
     border-radius: 1.5rem;
     width: 90%;
     max-height: 90vh;
     overflow-y: auto; 
     transform: scale(0.95);
     transition: transform 0.3s ease;
     position: relative;
 }
  .modal-backdrop.visible .modal-base-container {
     transform: scale(1);
 }
 .modal-close-btn {
     position: absolute;
     top: 1rem;
     right: 1.5rem;
     background: rgba(0,0,0,0.5); /* Slightly darker */
     color: #fff;
     width: 36px; /* Slightly larger */
     height: 36px;
     border-radius: 50%;
     border: 1px solid rgba(255,255,255,0.2);
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     transition: background-color 0.3s, transform 0.3s;
     z-index: 110; 
 }
 html[dir="rtl"] .modal-close-btn {
     right: auto;
     left: 1.5rem;
 }
 .modal-close-btn:hover {
     background-color: #84C022;
     transform: rotate(90deg);
 }
 /* Prevent body scroll when modal is open */
 body.modal-open {
      overflow: hidden;
 }

/* Service Modal Specific */
.service-modal-container {
     max-width: 900px; /* Specific max-width */
     display: grid; /* This stacks the two views for fading */
}

/* Compact layout for short-height screens (laptops with zoom, etc.) */
@media (max-height: 900px) {
    /* Make the service modal a bit shorter than normal */
    

    /* Limit the image height so it doesn't eat too much vertical space */
    #modal-img {
        max-height: 260px;
        object-fit: cover;
    }

    /* Reduce padding in the text column (the right side) */
    #service-details-view > div:last-child {
        padding: 1.5rem !important;
    }

    /* Slightly smaller title in the modal */
    #service-modal-title {
        font-size: 1.5rem;   /* around Tailwind text-2xl */
        line-height: 1.2;
    }

    /* Slightly smaller body text */
    #modal-desc {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }

    /* Key capabilities list a bit tighter */
    #modal-capabilities {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Give the Get Quotation button a bit less vertical “weight” */
    #open-quotation-form-btn {
        margin-top: 1.25rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
}


 /* Story Gallery Modal Specific */
 .story-gallery-modal-container {
      max-width: 1000px; /* Wider for gallery images */
      background-color: #0c0c0c; /* Add dark background */
      border: 1px solid rgba(132, 192, 34, 0.2);
      display: flex;
      flex-direction: column;
 }
 .story-gallery-image-container {
     position: relative; /* For positioning arrows */
     background-color: #000; /* Black bg behind image */
     flex-grow: 1; /* Allow image to take available height */
      min-height: 300px; /* Ensure minimum height */
 }
 .story-gallery-image {
      width: 100%;
      height: 100%;
      max-height: 70vh; /* Limit image height */
      object-fit: contain; /* Ensure image fits without cropping */
      display: block;
 }
  .story-gallery-nav-btn {
     position: absolute;
     top: 50%;
     transform: translateY(-50%);
     background-color: rgba(0,0,0,0.4);
     color: white;
     border: 1px solid rgba(255,255,255,0.3);
     border-radius: 50%;
     width: 44px;
     height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     transition: background-color 0.3s;
     z-index: 120;
 }
 .story-gallery-nav-btn:hover {
     background-color: rgba(132, 192, 34, 0.8); /* Matrix green on hover */
 }
  .story-gallery-nav-btn.prev {
     left: 1rem;
 }
 .story-gallery-nav-btn.next {
     right: 1rem;
 }
  .story-gallery-nav-btn:disabled {
     opacity: 0.3;
     cursor: not-allowed;
     background-color: rgba(0,0,0,0.4);
 }
 .story-gallery-title {
      padding: 1rem 1.5rem;
      text-align: center;
      font-size: 1.25rem;
      font-weight: 600;
      color: white;
      border-top: 1px solid rgba(132, 192, 34, 0.2);
 }

 /* *MODIFIED: Project Carousel Styles* *Removed background, border, padding from container* .project-carousel-outer-container {
      margin-bottom: 4rem;  *Add space before footer* }
  *Slide styling* .project-carousel-slide {
       *min-height: 300px; REMOVED min-height* padding: 0; *REMOVED default padding, control internally if needed* }
  *Image styling* .project-carousel-image {
     max-height: 300px;  *Keep reduced height* border-radius: 1rem; 
     width: 100%;  *Ensure image takes full width in its column 
     object-fit: cover;  *Cover ensures it fills the space* }
  *Control Bar styling* .project-carousel-control-bar {
     padding: 0 1rem;  *Add some horizontal padding* margin-top: 1rem;  *Space between slides and controls* }
  *Nav button styling (shared)* .project-carousel-nav-btn {
      background-color: rgba(0,0,0,0.4);
      color: white;
      border: 1px solid rgba(255,255,255,0.3);
      border-radius: 50%;
      width: 40px;  *Slightly smaller* height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background-color 0.3s;
      z-index: 10;
      flex-shrink: 0;  *Prevent buttons from shrinking* }
 .project-carousel-nav-btn:hover {
      background-color: rgba(132, 192, 34, 0.8);  *Matrix green* }
  .project-carousel-nav-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
      background-color: rgba(0,0,0,0.4);  *Ensure disabled state is clear* }
   *Dots container* .project-carousel-dots {
      display: flex;
      justify-content: center;
      align-items: center;  *Vertically center dots* gap: 0.75rem; 
      margin: 0 1rem; *Space between dots and arrows* flex-grow: 1;  *Allow dots to take up space* *margin-top: 1rem; REMOVED, now part of control bar* }
  .project-carousel-dot {
     width: 10px; 
     height: 10px;
     border-radius: 50%;
     background-color: rgba(255, 255, 255, 0.3); 
     cursor: pointer;
     transition: background-color 0.3s;
  }
  .project-carousel-dot.active {
      background-color: #84C022; 
  } */


 /* NEW: CSS rule to force LTR direction */
/* NEW: CSS rule to force LTR layout even when page is RTL */
html[dir="rtl"] .force-ltr {
    direction: ltr;
    text-align: left;
}

/* Link style for "View Project Gallery" (Style 03) */
.link-gallery-03 {
    position: relative;
    display: inline-block;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.8rem;       /* tweak if you want smaller/bigger */
    color: #84C022;          /* Matrix green */
    padding-bottom: 0.35rem; /* space above underline */
}

/* Grey base line */
.link-gallery-03::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: rgba(148, 163, 184, 0.5); /* subtle grey */
}

/* Green “overlay” line that animates on hover */
.link-gallery-03::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: #84C022;
    transition: width 0.25s ease-out;
}

/* Hover state */
.link-gallery-03:hover::before {
    width: 100%;
}

 /* --- NEW: Quotation Form Styles --- */
.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #040404; /* Very dark background */
    border: 1px solid rgba(132, 192, 34, 0.2); /* Faint green border */
    color: #e5e7eb; /* Light grey text */
    border-radius: 0.75rem; /* 12px */
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-input:focus {
    outline: none;
    border-color: #84C022; /* Matrix green border on focus */
    box-shadow: 0 0 0 3px rgba(132, 192, 34, 0.3); /* Green glow */
}
textarea.form-input {
    min-height: 100px;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background-color: #84C022; /* Matrix green */
    color: #000; /* Black text */
    font-weight: 600;
    border-radius: 99px; /* Full pill shape */
    transition: background-color 0.3s, transform 0.3s;
}
.submit-btn:hover {
    background-color: #a3e635; /* Lighter green */
    transform: scale(1.05);
}
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- MODIFIED: Service Modal View-Switching (with Fade) --- */

/*
  By default, hide both views...
*/
#service-details-view,
#service-form-view {
    /* ...by placing them in the same grid cell (1st row, 1st col) */
    grid-area: 1 / 1; 

    /* ...and making them transparent & non-interactive */
    opacity: 0;
    visibility: hidden;

    /* ...and set up the transition for the fade effect */
    transition: opacity 0.3s ease-in-out, visibility 0.3s; 
}

/* When a view has the "view-active" class...
*/
#service-details-view.view-active,
#service-form-view.view-active {
    /* ...make it visible and fade it in */
    opacity: 1;
    visibility: visible;
}

/* We still need to define the flex display for each view's *internal* layout.
  This rule MUST come AFTER the base rule above.
*/
#service-details-view {
    display: flex; 
    flex-direction: column; /* Stack on mobile */
}
@media (min-width: 768px) { /* On medium screens and up... */
    #service-details-view {
        flex-direction: row; /* ...go side-by-side */
    }
}

/* --- MODIFIED: Merged and corrected form view styles --- */
#service-form-view {
    display: flex; /* This was missing */
    padding: 2rem 2.5rem; 
    border: 1px solid rgba(132, 192, 34, 0.2);
    border-radius: 1.5rem; 
    flex-direction: column;
    align-items: center; 
    
    /* --- NEW ANIMATED GRADIENT BACKGROUND --- */
    background-size: 400% 400%; /* Make the gradient huge */
    background-image: linear-gradient(
        -45deg, 
        rgba(132, 192, 34, 0.2), /* 20% opaque Matrix Green */
        rgba(0, 0, 0, 0.6),      /* 60% opaque Black */
        rgba(132, 192, 34, 0.2)  /* 20% opaque Matrix Green */
    );
    animation: gradient-vibe 15s ease-in-out infinite;

    /* This blurs the MAIN WEBSITE behind our semi-transparent gradient */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.quotation-form-logo {
    height: 4rem; /* 64px tall */
    width: auto;
    margin-bottom: 2rem; /* Space below logo */
}

#quotation-form {
    width: 100%;
    max-width: 450px; /* Constrain form width for readability */
    position: relative; /* Added for z-index context */
    z-index: 2; /* Added to sit above pseudo-elements */
}

/* --- NEW: Animated Submit Button Styles --- */

/* Make the button's position relative to place the spinner */
.submit-btn {
    position: relative;
    /* ... all your other .submit-btn styles ... */
}

/* Create the spinner element */
.submit-btn .spinner {
    display: none; /* Hide spinner by default */
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    margin-left: -0.75rem; /* Half of width to center */
    margin-top: -0.75rem; /* Half of height to center */
    border: 3px solid rgba(0, 0, 0, 0.3); /* Light part of the circle */
    border-top-color: #000; /* Dark part of the circle */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* The 'is-loading' state */
.submit-btn.is-loading {
    color: transparent; /* Hide the "Submit" text */
    cursor: wait; /* Show a waiting cursor */
}

.submit-btn.is-loading .spinner {
    display: block; /* Show the spinner */
}

/* The animation keyframes for spinning */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- NEW: Animation for the form gradient --- */
@keyframes gradient-vibe {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* --- Mobile tweaks for Service Details modal (no desktop changes) --- */
@media (max-width: 768px) {
  /* Keep modal inside the viewport a bit more tightly */
  #service-modal .modal-base-container {
    max-height: 88vh;
  }

  /* Make the top image shorter on mobile */
  #modal-img {
    max-height: 220px;
    width: 100%;
    object-fit: cover;
  }

  /* Slightly tighten padding on the text column */
  #service-details-view .p-8 {
    padding: 1.25rem 1.5rem;
  }

  /* Smaller title and less margin */
  #service-modal-title {
    font-size: 1.5rem;       /* ~ text-2xl */
    margin-bottom: 0.75rem;
  }

  /* Smaller body text with less vertical spacing */
  #modal-desc {
    font-size: 0.875rem;     /* text-sm */
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  /* Capabilities list also a bit smaller */
  #modal-capabilities {
    font-size: 0.875rem;     /* text-sm */
  }

  #modal-capabilities li {
    line-height: 1.4;
  }
}

/* --- Mobile navigation dropdown --- */
#mobile-menu {
  transform-origin: top;
  transform: scaleY(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* When menu is open */
#mobile-menu.open {
  transform: scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

/* Lock page scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

.partner-logo {
    transition: opacity 0.65s ease;
}
.partner-logo.is-hidden {
    opacity: 0;
}
