/* Base Styles & Sci-Fi Look */
body {
    background-color: #0A0A0A;
    color: #F0F0F0;
    overflow-x: hidden;
    cursor: crosshair; /* Detailed Interaction */
}

/* Terminal Glass Effect for Headers/Nav */
.terminal-panel {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 4px 30px rgba(0, 255, 65, 0.05);
}

/* Neon Glow Effect */
.text-neon {
    text-shadow: 0 0 5px #00FF41, 0 0 10px #00FF41;
}

/* 3D Canvas Container */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* Process Line Animation */
.process-line-fill {
    height: 0%;
    background: #00FF41; /* Solid green stream */
    transition: height 0.1s linear; 
}

/* Mobile timeline positioning */
@media (max-width: 1023px) {
    #process-steps::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: rgba(51, 51, 51, 0.5);
        z-index: 0;
    }
    
    [dir="rtl"] #process-steps::before {
        left: auto;
        right: 12px;
    }
    
    /* Hide desktop timeline on mobile */
    #process-steps > div > div.absolute.left-1\/2 {
        display: none;
    }
}

/* Glitch Border Effect (Initial State) */
.data-block-card {
    border: 1px solid #333333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Cursor */
a, button {
    cursor: pointer;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0A0A0A;
}
::-webkit-scrollbar-thumb {
    background: #00FF41;
    border-radius: 0; /* Sharp corners */
}
::-webkit-scrollbar-thumb:hover {
    background: #00FFFF;
}

/* Language Specific Directions */
[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

/* Flip icons in RTL */
[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
}

/* Fixed readability issues - enhance contrast */
.text-terminal-gray {
    color: #999999 !important; /* Lighter gray for better readability */
}

/* Better contrast for subtitle and secondary text */
.text-gray-readable {
    color: #CCCCCC;
}

/* Ensure proper RTL alignment */
[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* RTL flex reversals */
[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

/* RTL padding/margin adjustments */
[dir="rtl"] .px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Ensure better text contrast on dark backgrounds */
.enhanced-text {
    color: #E5E5E5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Hide reCAPTCHA badge while keeping script active; disclosure text is shown near the form */
.grecaptcha-badge {
    visibility: hidden;
}

/* Mobile menu improvements */
@media (max-width: 768px) {
    #mobile-menu {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease-in-out;
        position: fixed !important;
        z-index: 9999 !important;
    }
    
    #mobile-menu:not(.hidden) {
        opacity: 1;
        pointer-events: auto;
    }
    
    #mobile-menu a {
        font-size: 1.25rem;
        font-weight: 600;
        transition: color 0.2s ease;
    }
    
    /* Prevent scrolling when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* Topbar scroll state */
.topbar-inner {
    transition: background-color 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease;
}

.topbar-scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(0, 255, 65, 0.35);
}

/* Industry marquee improvements */
.marquee-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
}

.hero_badge-txt{
    font-size: 14px !important;
    font-weight: bold;
}

.marquee-container {
    display: flex;
    overflow: hidden;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    line-height: 0 !important;
    flex-shrink: 0;
}

.marquee-content span {
    line-height: 1.75 !important;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* RTL marquee */
[dir="rtl"] .marquee-content {
    animation: marquee-rtl 30s linear infinite;
}

@keyframes marquee-rtl {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Industry Item Interactivity */
.industry-item {
    position: relative;
    border-radius: 0.25rem;
}

.industry-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.industry-item:hover::before {
    opacity: 1;
}

#industry-tooltip {
    font-family: 'Cairo', sans-serif;
}

/* Scan line animation */
.scan-line {
    animation: scan 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes scan {
    0%, 100% {
        top: 0;
        opacity: 0;
    }
    50% {
        top: 100%;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .industry-item,
    .industry-item i,
    .industry-item span {
        transition: none !important;
    }
    
    .scan-line {
        animation: none !important;
        display: none;
    }
}

/* Ensure loader is properly positioned */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-bar-bg {
    position: relative;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 0%;
}

/* Spotlight overlay */
.spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: none;
}

.hero_cta_txt{
    color: #0A0A0A !important;
}

/* Better text contrast improvements */
p, span:not(.text-neon):not(.text-matrix-green) {
    color: #CCCCCC;
}

h1, h2, h3, h4, h5, h6 {
    color: #FFFFFF;
}

h1 {
    line-height: 1.5 !important;
}

h1 span {
    display: block;
    margin-bottom: 1rem;
}

/* Service cards improved text */
.data-block-card p {
    color: #AAAAAA;
    line-height: 1.6;
}

.data-block-card h3 {
    color: #FFFFFF;
}

/* Process step text improvements */
.process-desc-text {
    color: #AAAAAA !important;
    line-height: 1.6;
}

.process-title-text {
    color: #00FF41 !important;
}

/* Project card text improvements */
.project-card p {
    color: #AAAAAA;
    line-height: 1.5;
}

/* Footer text improvements */
footer p, footer li, footer span {
    color: #AAAAAA;
}

/* Why us section text */
.why-item span {
    color: #E5E5E5 !important;
    line-height: 1.6;
}

/* Blog card text */
article h3 {
    color: #FFFFFF;
}

article p, article span:not(.text-matrix-green) {
    color: #AAAAAA;
}

/* Form labels and inputs */
label {
    color: #00FF41;
}

input, textarea, select {
    color: #FFFFFF !important;
    background-color: rgba(10, 10, 10, 0.8) !important;
}

input::placeholder, textarea::placeholder {
    color: #666666;
}

/* Better contrast for stats */
.hero-anim span {
    color: #E5E5E5;
}

/* About 3D Core Container */
.about-3d-container {
    position: relative;
    background: #050505;
}

.about-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

/* Core interaction hint */
.about-core-hint {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 11px;
    font-family: 'Cairo', sans-serif;
    color: #00FF41;
    opacity: 0.4;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

[dir="ltr"] .about-core-hint {
    font-family: 'IBM Plex Mono', monospace;
    right: auto;
    left: 16px;
}

.about-core-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .about-3d-container {
        min-height: 340px !important;
        height: auto;
    }
    
    .about-core-hint {
        font-size: 9px;
        bottom: 12px;
        right: 12px;
    }
    
    [dir="ltr"] .about-core-hint {
        left: 12px;
        right: auto;
    }
}

/* ================================
   CLIENTS SHOWCASE - PREMIUM MARQUEE
   ================================ */

/* Grid animation */
@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Marquee Container */
.clients-marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Marquee Row */
.clients-marquee-row {
    display: flex;
    overflow: hidden;
    width: 100%;
}

/* Marquee Track - The moving element */
.clients-marquee-track {
    display: flex;
    gap: 2rem;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

/* RTL Support - Reverse direction for RTL */
[dir="rtl"] .clients-marquee-track {
    animation: marqueeScrollRTL 30s linear infinite;
}

/* Reverse row animation */
.clients-marquee-track.clients-marquee-reverse {
    animation: marqueeScrollReverse 35s linear infinite;
}

[dir="rtl"] .clients-marquee-track.clients-marquee-reverse {
    animation: marqueeScrollReverseRTL 35s linear infinite;
}

/* Keyframes for LTR */
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeScrollReverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Keyframes for RTL */
@keyframes marqueeScrollRTL {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

@keyframes marqueeScrollReverseRTL {
    0% { transform: translateX(50%); }
    100% { transform: translateX(0); }
}

/* Pause on hover */
.clients-marquee-container:hover .clients-marquee-track {
    animation-play-state: paused;
}

/* Client Logo Item */
.client-logo-item {
    flex-shrink: 0;
    width: 160px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(51, 51, 51, 0.2) 0%, rgba(20, 20, 20, 0.4) 100%);
    border: 1px solid rgba(0, 255, 65, 0.1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover glow effect */
.client-logo-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 65, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.client-logo-item:hover::before {
    opacity: 1;
}

/* Corner accents */
.client-logo-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.3), transparent 50%, transparent 50%, rgba(0, 255, 255, 0.2)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.client-logo-item:hover::after {
    opacity: 1;
}

.client-logo-item:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(0, 255, 65, 0.3);
    box-shadow: 
        0 10px 40px rgba(0, 255, 65, 0.15),
        0 0 0 1px rgba(0, 255, 65, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Logo image */
.client-logo-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) brightness(1.5) contrast(0.8);
    opacity: 0.6;
    transition: all 0.4s ease;
}

.client-logo-item:hover img {
    filter: grayscale(0%) brightness(1) contrast(1);
    opacity: 1;
}

/* Client name tooltip */
.client-logo-item .client-name {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 65, 0.9);
    color: #0A0A0A;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.client-logo-item:hover .client-name {
    bottom: -35px;
    opacity: 1;
}

/* Tablet */
@media (max-width: 1024px) {
    .client-logo-item {
        width: 140px;
        height: 80px;
        padding: 0.75rem 1.25rem;
    }
    
    .clients-marquee-track {
        gap: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .client-logo-item {
        width: 120px;
        height: 70px;
        padding: 0.5rem 1rem;
        border-radius: 6px;
    }
    
    .clients-marquee-track {
        gap: 1rem;
        animation-duration: 20s;
    }
    
    .clients-marquee-track.clients-marquee-reverse {
        animation-duration: 25s;
    }
    
    .client-logo-item .client-name {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .clients-marquee-track,
    .clients-marquee-track.clients-marquee-reverse {
        animation: none;
    }
    
    .clients-marquee-row {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .client-logo-item {
        scroll-snap-align: start;
    }
}
