:root {
    --primary-color: #2563eb;
    --secondary-color: #1e293b;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --font-en-primary: 'Inter', sans-serif;
    --font-en-heading: 'Outfit', sans-serif;
    --font-ar-primary: 'Tajawal', sans-serif;
    --font-ar-heading: 'Cairo', sans-serif;
    --section-spacing: 80px;
    --font-ar-heading: 'Cairo', sans-serif;
    --section-spacing: 80px;
}

/* Utilities */
.bg-brand-dark {
    background-color: var(--secondary-color) !important;
}

/* General Styling */
html,
body {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: #f1f5f9;
    /* Slate 100 - Better contrast */
}

body {
    font-family: var(--font-en-primary);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Strict Section Heights & Spacing */
section:not(#hero) {
    min-height: auto !important;
    height: auto !important;
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-en-heading);
    font-weight: 700;
}

/* RTL Support - Fonts */
[lang="ar"] body {
    font-family: var(--font-ar-primary);
}

[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] h6 {
    font-family: var(--font-ar-heading);
}

/* Navbar */
.navbar {
    background: transparent;
    padding: 1rem 0;
    transition: all 0.3s ease;
    position: fixed;
    /* Explicitly restore fixed positioning */
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483647 !important;
    /* Max integer value */
    transform: translate3d(0, 0, 0);
    /* Force hardware acceleration & new stacking context */
    -webkit-transform: translate3d(0, 0, 0);
    width: 100%;
}

.navbar.is-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Navbar Logo */
.navbar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Mobile Logo Size */
@media (max-width: 768px) {
    .navbar-logo {
        height: 30px;
    }
}

.nav-link {
    font-weight: 500;
    color: var(--secondary-color) !important;
    transition: all 0.3s ease;
    position: relative;
}

/* Navbar Hover & Active State - Underline Effect */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    background: transparent;
    /* Light theme: No image, no dark gradient */
    color: var(--text-dark);
    /* Dark text for readability */
    padding-top: 140px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 0;
    background-attachment: scroll;
}

/* Text colors for light hero */
#hero h1,
#hero p {
    color: var(--text-dark) !important;
    text-shadow: none;
    /* No shadow needed on light background */
}

#hero .btn-outline-dark {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#hero .btn-outline-dark:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Subtle Animated Overlay */
#hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    top: 0;
    left: 0;
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Readable Max-Width for Hero Text */
#hero .container div[data-aos] {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Cards (Services & Projects) */
.service-card,
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
}

.project-img-wrapper {
    height: 220px;
    /* Fixed height for uniformity */
    background-color: #f8fafc;
    /* Placeholder color */
}

.project-img-wrapper img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.service-card:hover,
.project-card:hover {
    transform: translateY(-10px) rotate(-1deg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.icon-box {
    width: 70px;
    height: 70px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

.service-card:hover .icon-box {
    background: var(--primary-color);
    color: white !important;
}

/* Project Images */
.project-img-wrapper img {
    transition: transform 0.5s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.05);
}

/* Filters */
.filter-btn {
    border: 2px solid #e2e8f0;
    background: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 0.25rem;
    cursor: pointer;
}

.filter-btn:hover {
    background: #f1f5f9;
    transform: translateY(-2px) scale(1.02);
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

/* Category-Specific Active Colors */
.filter-btn[data-filter="client"].active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.filter-btn[data-filter="portfolio"].active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.filter-btn[data-filter="business"].active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.filter-btn[data-filter="store"].active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.filter-btn[data-filter="dashboard"].active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Live Badge Pulse Effect */
.live-badge {
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Process Steps */
.process-step {
    position: relative;
}

/* Testimonial Slider */
.carousel-item {
    min-height: 200px;
}

/* Footer specific */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Back to Top */
#backToTop {
    width: 45px;
    height: 45px;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;

    /* Position moved from inline styles */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

#backToTop:hover {
    transform: translateY(-5px);
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    left: 20px;
    /* Default left for LTR */
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: fadeInBottom 1s ease-out, pulse 2s infinite 1s;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: white;
    transform: scale(1.1) rotate(10deg);
}

[dir="rtl"] .whatsapp-float {
    left: auto;
    right: 20px;
}

/* Ensure BackToTop doesn't overlap in RTL/LTR */
[dir="rtl"] #backToTop {
    right: auto;
    left: 20px;
}

/* Actually, let's keep WhatsApp on Left and BackToTop on Right for LTR to match typical patterns, 
   but user image showed it on right. 
   Most common: WhatsApp on bottom-left or bottom-right. 
   Let's put WhatsApp Bottom-Left to avoid conflict with BackToTop (Bottom-Right).
   Wait, user image shows Bottom-Right usually. 
   Let's put WhatsApp Bottom-Left so they don't stack awkwardly.
*/

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 30px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes fadeInBottom {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* FAQ Accordion Polish */
.accordion-item {
    border: none;
    border-radius: 0.5rem !important;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.accordion-button {
    font-weight: 600;
    padding: 1.25rem;
    background-color: white;
    box-shadow: none !important;
    /* Remove blue glow on focus */
}

/* Active State Background */
.accordion-button:not(.collapsed) {
    background-color: rgba(37, 99, 235, 0.05);
    /* Light primary tint */
    color: var(--primary-color);
}

/* Contact Form Polish */
#contactForm {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

#contactForm .form-label {
    margin-bottom: 0.35rem;
    /* Tighter spacing */
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
    /* Slightly smaller label */
}

#contactForm .form-control,
#contactForm .form-select {
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    min-height: 3rem;
    /* ~48px - More compact but accessible */
    box-shadow: none;
    font-size: 0.95rem;
}

#contactForm .form-control:focus,
#contactForm .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

#contactForm textarea.form-control {
    min-height: 100px;
    /* Compact height */
}

#contactForm label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Contact Section Polish */
.icon-circle {
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    /* subtle gradient */
}

.icon-circle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.4);
}

.hover-scale {
    transition: transform 0.2s;
}

.hover-scale:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(22, 163, 74, 0.4) !important;
    /* Green shadow for WhatsApp */
}

/* Contact Info Cards */
.contact-info-card {
    background: white;
    border-radius: 1rem;
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.contact-info-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 24px -5px rgba(37, 99, 235, 0.15);
}

.contact-icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.contact-info-card:hover .contact-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 20px -4px rgba(37, 99, 235, 0.4);
}

.contact-info-card p {
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* Mobile: Stack cards vertically */
@media (max-width: 768px) {
    .contact-info-card {
        margin-bottom: 1rem;
    }
}

/* About Section Polish */
@keyframes floatY {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.about-visual i {
    animation: floatY 6s ease-in-out infinite;
    text-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.about-visual {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Clean, layered shadow for floating effect */
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
}

.about-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.about-feature {
    padding: 1rem;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

.about-feature:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.about-content-card {
    background: #fff;
    border-radius: var(--bs-border-radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.05);
    /* Matching clean shadow */
    height: 100%;
}

/* RTL Specific Overrides */
[dir="rtl"] .f-icon {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Fix for icons spacing in RTL if not handled by Bootstrap logical props */
[dir="rtl"] .me-1 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* RTL Accordion Fix */
[dir="rtl"] .accordion-button::after {
    margin-right: auto;
    margin-left: 0;
}

/* RTL Form Input Fix */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
    text-align: right;
}

[dir="rtl"] .form-select {
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
    /* Ensure text doesn't overlap arrow */
    padding-right: 1rem;
}

[dir="rtl"] label {
    text-align: right;
    width: 100%;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    html,
    body,
    * {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}