/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1A1D24;
}

::-webkit-scrollbar-thumb {
    background: #D9232D;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c25;
}

/* Typing Cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-start infinite;
    color: #D9232D;
    display: inline-block;
    margin-left: 4px;
    margin-right: 4px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar Glassmorphism */
.nav-scrolled {
    background-color: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* --- MARQUEE ANIMATION (Gap Style) --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

/* Client Logo Styling */
.client-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.4s ease;
    height: 4rem;
    width: auto;
    margin: 0 2.5rem;
    cursor: pointer;
}

.client-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .client-logo {
        height: 2.5rem;
        margin: 0 1.5rem;
    }
}

/* About Image Styling */
.about-image-container {
    position: relative;
    z-index: 10;
}

.about-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: perspective(1000px) rotateY(-2deg);
    transition: all 0.5s ease;
    border: 4px solid rgba(255, 255, 255, 0.5);
}

.about-image-wrapper:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(217, 35, 45, 0.15);
}

.about-image-wrapper img {
    transition: transform 0.7s ease;
}

.about-image-wrapper:hover img {
    transform: scale(1.05);
}

.decorative-blob-1 {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 120px;
    height: 120px;
    background-color: rgba(217, 35, 45, 0.1);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-slow 4s infinite alternate;
}

.decorative-blob-2 {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background-color: rgba(15, 17, 21, 0.05);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: -1;
    animation: pulse-slow 5s infinite alternate-reverse;
}

@keyframes pulse-slow {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* Project Cards */
.project-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card:hover .overlay-details {
    transform: translateY(0);
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.1);
}

/* Filter Buttons */
.filter-btn.active {
    background-color: #D9232D;
    color: white;
    border-color: #D9232D;
}

/* Modals */
#project-modal,
#contact-modal {
    transition: opacity 0.3s ease;
}

#project-modal.hidden,
#contact-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#project-modal:not(.hidden),
#contact-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* RTL Support for Body */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Hide Scrollbar for filter overflow */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Menu Full Screen */
#mobile-menu {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: circle(0% at 100% 0%);
}

#mobile-menu.active {
    clip-path: circle(150% at 100% 0%);
}

.mobile-link {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
}

#mobile-menu.active .mobile-link {
    opacity: 1;
    transform: translateX(0);
}

body.menu-open {
    overflow: hidden;
}

/* Hamburger Animation */
#mobile-menu-btn span {
    transition: all 0.3s ease;
}

#mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* RTL Adjustments for Mobile Menu */
html[lang="ar"] .mobile-link {
    transform: translateX(-20px);
}

html[lang="ar"] #mobile-menu.active .mobile-link {
    transform: translateX(0);
}

/* Testimonial Slider Transitions */
.slide-enter {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Services Page Styles --- */
/* Hover Effects */
.hover-card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

/* Scroll Offset for Fixed Navbar */
section[id] {
    scroll-margin-top: 150px;
}

/* Number background for lists */
.list-counter {
    counter-reset: section;
}

.list-item-custom::before {
    counter-increment: section;
    content: "0" counter(section);
    position: absolute;
    left: -1rem;
    top: -1.5rem;
    font-size: 3rem;
    font-weight: 800;
    color: rgba(217, 35, 45, 0.05);
    font-family: 'Montserrat', sans-serif;
    z-index: 0;
}

/* --- About Page Styles --- */
/* Hover Cards */
.value-card {
    transition: all 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
    border-color: #D9232D;
}

/* Leader Image */
.leader-img-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0F1115 10%, transparent);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.group:hover .leader-img-container::after {
    opacity: 0.4;
}

/* Org Chart Tree Layout */
.tree-node {
    position: relative;
    padding-top: 20px;
}

.tree-node::before,
.tree-node::after {
    content: '';
    position: absolute;
    top: 0;
    height: 20px;
    width: 50%;
    border-top: 2px solid #9CA3AF;
}

.tree-node::before {
    left: 0;
    border-right: 1px solid #9CA3AF;
}

.tree-node::after {
    right: 0;
    border-left: 1px solid #9CA3AF;
}

/* First child: remove left connector */
.tree-node:first-child::before {
    border: 0 none;
}

.tree-node:first-child::after {
    border-left: 2px solid #9CA3AF;
}

/* Last child: remove right connector */
.tree-node:last-child::after {
    border: 0 none;
}

.tree-node:last-child::before {
    border-right: 2px solid #9CA3AF;
}

/* Single Child */
.tree-node:only-child::after,
.tree-node:only-child::before {
    display: none;
}

.tree-node:only-child {
    padding-top: 0;
}

/* RTL Support for Org Chart */
html[lang="ar"] .tree-node::before {
    left: auto;
    right: 0;
    border-right: 0;
    border-left: 1px solid #9CA3AF;
}

html[lang="ar"] .tree-node::after {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid #9CA3AF;
}

/* Fix First/Last child in RTL */
/* Fix First/Last child in RTL */
/* First child (Visually Right) should hide its Right connector (::before) */
html[lang="ar"] .tree-node:first-child::before {
    border: 0 none;
}

html[lang="ar"] .tree-node:first-child::after {
    border-right: 2px solid #9CA3AF;
    /* Restore Inner Border */
}

/* Last child (Visually Left) should hide its Left connector (::after) */
html[lang="ar"] .tree-node:last-child::after {
    border: 0 none;
}

html[lang="ar"] .tree-node:last-child::before {
    border-left: 2px solid #9CA3AF;
    /* Restore Inner Border */
}

/* --- Cinematic 3D Project Gallery --- */
.gallery-perspective {
    perspective: 2000px;
    overflow: hidden;
}

.gallery-transform-box {
    transform: rotateX(20deg) rotateZ(-15deg) skewX(20deg) scale(0.9);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Marquee Animations */
@keyframes marquee-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marquee-right {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.animate-marquee {
    display: flex;
    width: max-content;
    animation: marquee 35s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

.animate-marquee-left {
    display: flex;
    width: max-content;
    animation: marquee-left 60s linear infinite;
}

.animate-marquee-right {
    display: flex;
    width: max-content;
    animation: marquee-right 70s linear infinite;
}

.animate-marquee-left:hover,
.animate-marquee-right:hover {
    animation-play-state: paused;
}

/* Card Styling */
.gallery-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.8) grayscale(20%);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-card:hover {
    transform: scale(1.1) translateY(-15px) rotateX(-5deg);
    filter: brightness(1.2) grayscale(0%);
    z-index: 50;
    border-color: rgba(217, 35, 45, 0.5);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 30px -5px rgba(217, 35, 45, 0.3);
    /* Brand Red Glow */
}

/* --- Vision 2030 Beam Effect --- */
@keyframes beam-sweep {
    0% {
        left: -100%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

@keyframes ambient-beam {
    0% {
        transform: translate(-100%, -100%) rotate(35deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(200%, 200%) rotate(35deg);
        opacity: 0;
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 50px);
    }
}

@keyframes float-slower {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-30px, 40px);
    }
}

.animate-ambient-beam {
    animation: ambient-beam 10s linear infinite;
}

.animate-float-slow {
    animation: float-slow 15s ease-in-out infinite;
}

.animate-float-slower {
    animation: float-slower 20s ease-in-out infinite;
}


.vision-beam-effect {
    overflow: hidden;
    /* Contains the beam */
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.2),
        /* Static glow */
        0 0 60px rgba(34, 197, 94, 0.1);
    transition: box-shadow 0.3s ease;
}

.vision-outer-glow {
    position: relative;
    z-index: 10;
    box-shadow:
        0 -30px 100px -20px rgba(74, 222, 128, 0.5),
        0 30px 100px -20px rgba(74, 222, 128, 0.5);
}


.vision-beam-effect:hover {
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.4),
        /* Intense glow on hover */
        0 0 80px rgba(34, 197, 94, 0.2);
}

/* The Beam */
.vision-beam-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    /* Beam width */
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(74, 222, 128, 0.2),
            /* Light Green (Emerald-400) */
            rgba(34, 197, 94, 0.4),
            /* Mid Green (Emerald-500) - The core beam */
            rgba(74, 222, 128, 0.2),
            transparent);
    transform: skewX(-25deg);
    pointer-events: none;
    /* Click-through */
    z-index: 1;
    /* Was 20. Kept low to stay compatible with internal content if needed */
    opacity: 0;
    transition: opacity 0.3s;
}

/* Animate on Hover */
.vision-beam-effect:hover::after {
    animation: beam-sweep 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    opacity: 1;
}