@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0057a8;
    --secondary-color: #004080;
    --accent-color: #4da1a9;
    --turquoise: #4da1a9;
    --light-bg: #f0f8f9;
    --lighter-bg: #e6f4f5;
    --white: #ffffff;
    --text-dark: #1a2332;
    --text-medium: #3d5a80;
    --text-light: #5a7d9a;
    --border-light: rgba(77, 161, 169, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 57, 107, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 57, 107, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 57, 107, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 57, 107, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Cairo', 'Poppins', sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[dir="ltr"] body {
    font-family: 'Poppins', 'Cairo', sans-serif;
}

/* ===========================
   HEADER / NAVBAR
   =========================== */
header {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition);
    height: 70px;
    display: flex;
    align-items: center;
}

header.sticky {
    height: 60px;
    box-shadow: 0 2px 20px rgba(0, 57, 107, 0.12);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    height: 100%;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    transition: all var(--transition);
}

.logo a::after {
    display: none;
}

.logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: all var(--transition);
}

header.sticky .logo img {
    height: 40px;
}

.logo a:hover img {
    transform: scale(1.03);
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.main-nav ul li a {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition);
    border-radius: 1px;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
}

.main-nav ul li a:hover::after {
    width: 60%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
    white-space: nowrap;
}

.demo-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

/* Language Switch */
.lang-switch {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(0, 87, 168, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.lang-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.lang-switch:hover::before {
    left: 100%;
}

.lang-switch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 87, 168, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--primary-color);
    transition: all var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
    padding: 80px 0 70px;
    position: relative;
    overflow: hidden;
    background: var(--light-bg);
    min-height: 520px;
    display: flex;
    align-items: center;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(230, 244, 245, 0.88) 0%,
        rgba(240, 248, 249, 0.90) 50%,
        rgba(230, 244, 245, 0.88) 100%
    );
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(77, 161, 169, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 87, 168, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, 20px) rotate(3deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.hero h1 {
    font-size: 42px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    animation: slideDown 0.8s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 650px;
    margin: 0 auto 35px;
    line-height: 1.8;
    font-weight: 400;
    animation: slideUp 0.8s ease 0.15s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 14px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 87, 168, 0.2);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease 0.3s both;
    letter-spacing: 0.01em;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 87, 168, 0.3);
}

/* ===========================
   STATS SECTION
   =========================== */
.stats {
    background: var(--white);
    padding: 50px 0;
    border-top: 1px solid var(--border-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 20px;
    transition: transform var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 40px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 600;
}

/* ===========================
   SECTION COMMON STYLES
   =========================== */
.services {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--white) 100%);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.section-description {
    font-size: 16px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Service Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--white);
    padding: 36px 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 0;
}

.service-card:hover::before {
    opacity: 0.02;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(77, 161, 169, 0.3);
}

.service-card > * {
    position: relative;
    z-index: 1;
}

.service-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(3deg);
}

.service-card h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.service-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
}

.svc-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 7px 16px;
    background: rgba(0,87,168,0.08);
    color: #0057a8;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
    align-self: flex-start;
}
.svc-home-link:hover {
    background: linear-gradient(135deg, #0057a8, #4da1a9);
    color: #fff;
}

/* ===========================
   FEATURES SECTION
   =========================== */
.features {
    padding: 70px 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.feature-item {
    padding: 28px 24px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--turquoise);
    transition: all var(--transition);
}

.feature-item:hover {
    background: var(--white);
    border-left-color: var(--primary-color);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .feature-item {
    border-left: none;
    border-right: 4px solid var(--turquoise);
}

[dir="rtl"] .feature-item:hover {
    transform: translateX(4px);
    border-right-color: var(--primary-color);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 14px;
}

.feature-item h4 {
    font-size: 17px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.feature-item p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
}

/* ===========================
   CLIENTS SECTION
   =========================== */
.clients {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--lighter-bg) 0%, var(--light-bg) 100%);
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.client-card {
    background: var(--white);
    padding: 36px 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--turquoise));
    transform: scaleX(0);
    transition: transform var(--transition);
}

.client-card:hover::before {
    transform: scaleX(1);
}

.client-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.client-icon {
    font-size: 48px;
    margin-bottom: 18px;
}

.client-card h4 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.client-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
}

/* ===========================
   TECH STACK SECTION
   =========================== */
.tech-stack {
    padding: 70px 0;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.tech-stack::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(77, 161, 169, 0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.tech-items {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.tech-item {
    text-align: center;
    padding: 36px 28px;
    background: linear-gradient(135deg, var(--light-bg), var(--white));
    border-radius: var(--radius-xl);
    transition: all var(--transition);
    border: 1px solid transparent;
    min-width: 220px;
    max-width: 280px;
}

.tech-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--turquoise);
}

.tech-item-icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: grayscale(20%);
    transition: filter var(--transition);
}

.tech-item:hover .tech-item-icon {
    filter: grayscale(0%);
}

.tech-item h4 {
    font-size: 22px;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 6px;
}

.tech-item p {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* ===========================
   CTA SECTION
   =========================== */
.cta-section {
    padding: 90px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 60%, #002850 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.cta-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(77, 161, 169, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.cta-content {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    font-size: 36px;
    color: var(--white);
    margin-bottom: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cta-section p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-button-white {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 15px 44px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.cta-button-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(0,0,0,0.25);
    background: #f0f8ff;
}

/* ===========================
   FOOTER
   =========================== */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 50px 0 20px;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.7;
    max-width: 350px;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

/* ===========================
   SCROLL ANIMATION
   =========================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   BACK TO TOP
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 87, 168, 0.25);
    transition: all var(--transition);
    z-index: 999;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 25px;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 87, 168, 0.35);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    header {
        height: 64px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }

    .section-title {
        font-size: 28px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    header {
        height: 60px;
    }

    .logo img {
        height: 38px;
    }

    .main-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        box-shadow: 0 8px 24px rgba(0, 57, 107, 0.1);
        transform: translateY(-150%);
        transition: transform var(--transition);
    }

    .main-nav.active {
        transform: translateY(0);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 4px;
    }

    .main-nav ul li a {
        display: block;
        padding: 10px 16px;
        font-size: 15px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-actions {
        display: none;
    }

    .hero {
        padding: 50px 0 40px;
        min-height: 400px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .section-title {
        font-size: 26px;
    }

    .services,
    .features,
    .clients,
    .tech-stack {
        padding: 50px 0;
    }

    .cta-section {
        padding: 65px 0;
    }

    .section-header {
        margin-bottom: 35px;
    }

    .service-grid,
    .clients-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tech-items {
        gap: 20px;
    }

    .tech-item {
        min-width: 160px;
        padding: 24px 20px;
    }

    .stat-number {
        font-size: 32px;
    }

    .stat-label {
        font-size: 13px;
    }

    .cta-section h2 {
        font-size: 26px;
    }

    .cta-section p {
        font-size: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 40px 0 35px;
        min-height: 350px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 14px;
    }

    .section-title {
        font-size: 22px;
    }

    .cta-button,
    .cta-button-white {
        padding: 12px 30px;
        font-size: 14px;
    }

    .service-card,
    .client-card {
        padding: 28px 20px;
    }

    .service-icon,
    .client-icon {
        font-size: 40px;
    }

    .service-card h3,
    .client-card h4 {
        font-size: 18px;
    }

    .tech-item-icon {
        font-size: 44px;
    }

    .tech-item h4 {
        font-size: 18px;
    }
}