:root {
    --primary-color: #3b82f6;
    /* Bright Tech Blue */
    --primary-dark: #1d4ed8;
    --secondary-color: #06b6d4;
    /* Cyan */
    --accent-color: #f472b6;
    /* Soft Pink Accent */
    --dark-bg: #0f172a;
    /* Slate 900 */
    --darker-bg: #020617;
    /* Slate 950 */
    --card-bg: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --text-color: #cbd5e1;
    /* Slate 300 */
    --heading-color: #f1f5f9;
    /* Slate 100 */
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --radius: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
}

/* Background gradient mesh */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    animation: floating 10s infinite ease-in-out;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    animation: floating 10s infinite ease-in-out reverse;
}

@keyframes floating {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

/* Arabic Specifics */
body.ar {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

body.ar .hero-title,
body.ar h1,
body.ar h2,
body.ar h3 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: var(--heading-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    border-radius: 2px;
}

/* Header */
.header {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: var(--glass-border);
    height: 80px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--heading-color);
}

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

.logo:hover .logo-img {
    transform: scale(1.05);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-switch {
    background: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    color: var(--heading-color);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition);
}

.lang-switch:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--heading-color);
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 10rem 0 6rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 10;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
    background: linear-gradient(135deg, #fff 0%, var(--secondary-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-color);
    max-width: 90%;
}

.hero-points {
    margin-bottom: 3rem;
    display: grid;
    gap: 1.25rem;
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    color: var(--heading-color);
}

.hero-points li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tech-graphic {
    width: 100%;
    height: 500px;
    /* Placeholder for the generated hero image or existing one */
    background-image: url('../images/hero_bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 2rem;
    box-shadow: var(--shadow-hover);
    position: relative;
    overflow: hidden;
    animation: pulse-border 4s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(6, 182, 212, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    }
}

/* Services Section */
.services {
    padding: 8rem 0;
    position: relative;
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
}

.service-card {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    flex: 1 1 320px;
    max-width: 400px;
    /* Keep uniform size */
    width: 100%;
    /* Ensure mobile full width */
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
}

.service-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    opacity: 0.8;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
    opacity: 1;
}

.service-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--heading-color);
    min-height: 3.5rem;
    /* Ensure consistent height for titles (2 lines) */
    display: flex;
    align-items: center;
    /* Vertically center short titles */
}

.expand-btn {
    display: none;
}

.service-details {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: var(--glass-border);
    width: 100%;
}

/* Removed double border rule for .service-details ul */
.service-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-details li {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    display: flex;
    align-items: flex-start;
    /* Align bullet to top of multi-line text */
    gap: 0.75rem;
}

.service-details li::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    margin-top: 0.6em;
    /* visually align with text cap-height */
    flex-shrink: 0;
}

/* Why Us Section */
.why-us {
    padding: 8rem 0;
    background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.why-item {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(30, 41, 59, 0.4);
    border: var(--glass-border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.why-item:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-5px);
}

.why-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.why-item h3 {
    color: var(--heading-color);
    font-size: 1.25rem;
}

/* Contact Section */
.contact {
    padding: 8rem 0;
    position: relative;
    background: var(--dark-bg);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff, var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    margin-top: 2rem;
    text-decoration: none;
    display: inline-flex;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    background-color: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.contact-email {
    margin-top: 2.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-email a {
    color: var(--secondary-color);
    font-weight: 600;
}

.contact-form {
    background: rgba(30, 41, 59, 0.6);
    padding: 2.5rem;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    box-shadow: var(--shadow-hover);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    color: white;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Footer */
.footer {
    background-color: var(--darker-bg);
    color: #94a3b8;
    padding: 3rem 0;
    text-align: center;
    border-top: var(--glass-border);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav-links {
        display: none;
    }

    .lang-switch {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

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

    .logo {
        font-size: 1.2rem;
        gap: 0.5rem;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .services,
    .why-us,
    .contact {
        padding: 4rem 0;
    }

    .hero-container,
    .contact-container,
    .why-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-card {
        max-width: 100%;
    }

    .hero-content {
        text-align: center;
        order: 1;
    }

    .hero-visual {
        order: 2;
        margin-top: 2rem;
        margin-bottom: 0;
    }

    .tech-graphic {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-points {
        justify-content: center;
        text-align: left;
        display: inline-grid;
        margin: 2rem auto;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .contact-info h2 {
        font-size: 2.2rem;
    }

    .footer {
        padding: 2rem 0;
    }
}

@media (max-width: 400px) {
    .logo-text {
        display: none;
    }
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: var(--transition);
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    margin: 2rem 0;
}

.mobile-nav-links a {
    color: var(--heading-color);
    font-size: 2rem;
    font-weight: 700;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 3rem;
    cursor: pointer;
}

/* RTL Adjustments */
body.ar .hero-points li::before {
    margin-left: 1rem;
    margin-right: 0;
}

body.ar .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

body.ar .nav-links a::after {
    left: auto;
    right: 0;
}

/* Services List Layout (Zig-Zag) */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.service-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.service-row.reverse {
    direction: rtl;
    /* For visual reversing of columns order */
}

/* Reset direction for content inside reversed rows so text flows correctly */
.service-row.reverse .service-text-col,
.service-row.reverse .service-image-col {
    direction: ltr;
}

/* Arabic RTL handling for reverse rows */
body.ar .service-row.reverse {
    direction: ltr;
    /* Flip back for Arabic so it naturally reverses via grid or just stays consistent? */
    /* Actually better to use order property or grid-template-areas for robustness */
}

body.ar .service-row.reverse .service-text-col,
body.ar .service-row.reverse .service-image-col {
    direction: rtl;
}

/* Better approach for zig-zag than direction: rtl hack */
.service-row.reverse .service-image-col {
    order: 2;
}

.service-row.reverse .service-text-col {
    order: 1;
}

.img-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    height: 350px;
    border: var(--glass-border);
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-row:hover .img-wrapper img {
    transform: scale(1.05);
}

.service-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.service-text-col h3 {
    font-size: 2rem;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
}

.service-text-col p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.details-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.details-list li {
    position: relative;
    padding-left: 1.5rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.details-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Arabic RTL Support for new layout */
body.ar .details-list li {
    padding-left: 0;
    padding-right: 1.5rem;
}

body.ar .details-list li::before {
    left: auto;
    right: 0;
}

body.ar .service-header {
    flex-direction: row;
    /* Ensure icon stays next to title */
}

/* Mobile Responsiveness for ZigZag */
@media (max-width: 900px) {

    .service-row,
    .service-row.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: left;
    }

    .service-row.reverse .service-image-col {
        order: unset;
    }

    .service-row.reverse .service-text-col {
        order: unset;
    }

    .img-wrapper {
        height: 250px;
    }

    .details-list {
        grid-template-columns: 1fr;
        /* Single column list on mobile */
    }

    .service-text-col h3 {
        font-size: 1.75rem;
    }
}