:root {
    --primary: #8330ff;
    --secondary: #3b0094;
    --light-purple: #f8f4ff;
    --text: #1a1a2e;
    --glass: rgba(255, 255, 255, 0.85);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #fff;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

.ads-section {
    padding: 60px 20px;
    background: #f8f9fa;
}

.ads-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.ad-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.ad-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    min-height: 280px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Arabic */
html[dir="rtl"] body {
    font-family: 'Alexandria', sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: 'Alexandria', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.5;
    /* add this */
}

.container {
    max-width: 4000px;
    margin: 0 auto;
    padding: 0 6%;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

}

/* HEADER & NAV */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 2000;
    transition: var(--transition);
    padding: 25px 0;
    background: var(--glass);
    background: radial-gradient(circle at 80% 20%, #c29aff 0%, #e2d4f7 100%);
}

html[dir="rtl"] header {
    background: radial-gradient(circle at 80% 20%, #e2d4f7 0%, #c29aff 100%);
}

header.scrolled {
    background: radial-gradient(circle at 80% 20%, #c29aff 0%, #e2d4f7 100%);
    backdrop-filter: blur(15px);
    padding: 15px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo img {
    height: 65px;
    width: auto;
    display: block;
    order: 1;
}

.logo-text {
    white-space: nowrap;
    direction: ltr;
    order: 2;
}

.logo-text span {
    color: var(--primary);
}

/* Arabic */
[dir="rtl"] .logo img {
    order: 2;
}

[dir="rtl"] .logo-text {
    order: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 12px;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 20px;
    border-radius: 14px;

    text-decoration: none;
    color: var(--text);

    font-size: 0.95rem;
    font-weight: 600;

    transition: all .3s ease;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    inset: 0;

    background: linear-gradient(135deg,
            rgba(131, 48, 255, .08),
            rgba(59, 0, 148, .08));

    border-radius: inherit;

    opacity: 0;
    transition: .3s ease;
}

.nav-links a:hover::before {
    opacity: 1;
}

.nav-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 20%;
    bottom: 8px;

    width: 60%;
    height: 2px;

    background: linear-gradient(90deg,
            var(--primary),
            var(--secondary));

    transform: scaleX(0);
    transition: .3s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-icon {
    color: var(--primary);
    display: flex;
    transition: var(--transition);
}

.lang-icon:hover {
    transform: rotate(15deg);
}

/* ARABIC NAV SORTING FIX */
[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-actions {
    flex-direction: row-reverse;
}

/* HERO */
.hero {
    min-height: 80vh;
    height: auto;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 80% 20%, #eadcff 0%, #ffffff 100%);
    position: relative;
    padding: 120px 0;
}

.hero-box {
    max-width: 5000px;
    z-index: 10;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 25px;

}

.hero p {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 40px;
    max-width: 1500px;
}

.s-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.s-card {
    overflow: hidden;
}

.s-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.s-title-row h3 {
    margin: 0;
}

.s-title-row .s-icon {
    margin: 0;
}

.btn-main {
    background: var(--primary);
    color: #fff;
    padding: 18px 45px;
    text-decoration: none;
    border-radius: 100px;
    display: inline-block;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 15px 35px rgba(131, 48, 255, 0.3);
    font-family: 'Alexandria', sans-serif;
}

.btn-main:hover {
    transform: translateY(-5px);
    background: var(--secondary);
    box-shadow: 0 20px 40px rgba(131, 48, 255, 0.4);
}

/* ABOUT */
.about {
    position: relative;
    padding: 100px 0;
    background-image: url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark overlay for readability */
.about::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.288);
}

.about .container {
    position: relative;
    z-index: 1;
}

.about-content h2 {
    font-size: 3rem;
    font-family: 'Alexandria', sans-serif;
    margin-bottom: 25px;
    color: #fff;
}

.about-content p {
    font-family: 'Alexandria', sans-serif;
    margin-bottom: 25px;
    color: #fff;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.sh {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
}

.about h2 {
    font-size: 3rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 25px;
    color: #fff;

}

.about-visual {
    position: relative;
    padding: 40px;
    background: var(--light-purple);
    border-radius: 40px;
}

.glass-card {
    background: #1a1a2e;
    color: #fff;
    padding: 30px;
    border-radius: 20px;
    font-family: monospace;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.code-dots span {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.code-dots span:nth-child(1) {
    background: #ff5f56;
}

.code-dots span:nth-child(2) {
    background: #ffbd2e;
}

.code-dots span:nth-child(3) {
    background: #27c93f;
}

/* SERVICES */
.services {
    padding: 120px 0;
    background: radial-gradient(circle at 80% 20%, #f3ebff 0%, #ffffff 100%);
}

.section-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 70px;
}

.s-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.s-card {
    background: #f3ebfe;
    padding: 50px 40px;
    border-radius: 30px;
    transition: var(--transition);
    border: 1px solid #dbc2fd;
}

.s-card:hover {
    transform: translateY(-15px);
    border-color: var(--primary);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.05);
}

.s-icon {
    font-size: 3rem;
    margin-bottom: 25px;
    display: block;
}

.s-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* CONTACT */
.contact {
    padding: 150px 0;
    background: #f3ebff;

}

.contact-box {
    background: #fff;
    padding: 80px;
    border-radius: 50px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
}

.f-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

input,
textarea {
    width: 100%;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 15px;
    margin-bottom: 20px;
    font-family: inherit;
    transition: 0.3s;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
}

footer {
    background: #000;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(131, 48, 255, 0.15);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 200px;
    background: radial-gradient(circle,
            rgba(131, 48, 255, 0.25) 0%,
            transparent 70%);
    pointer-events: none;
}

footer p {
    margin: 0;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

footer strong,
footer a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s ease;
}

footer a:hover {
    color: var(--primary);
}

/* MOBILE */
@media (max-width: 992px) {

    .hero {
        min-height: 100vh;
        height: auto;
        padding: 140px 0 80px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

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

    .contact-box {
        padding: 40px 20px;
    }
}

/* MOBILE */
@media (max-width: 768px) {

    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        position: relative;
        z-index: 4001;
        /* above menu */
    }

    .menu-toggle span {
        width: 30px;
        height: 3px;
        background: var(--text);
        border-radius: 5px;
        transition: .3s ease;
    }

    /* Hamburger -> X */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

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

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }


    .nav-links {
        position: fixed;
        top: 75px;
        left: 12px;
        right: 12px;

        width: auto;
        height: auto;

        padding: 16px;
        margin: 0;

        display: flex;
        flex-direction: column !important;
        gap: 10px;

        background:
            radial-gradient(circle at top right,
                rgba(131, 48, 255, 0.12),
                transparent 40%),
            linear-gradient(180deg,
                rgba(255, 255, 255, 0.98),
                rgba(250, 247, 255, 0.98));

        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);

        border: 2px solid rgba(131, 48, 255, 0.08);

        border-radius: 32px;

        box-shadow:
            0 25px 80px rgba(131, 48, 255, 0.10),
            0 10px 30px rgba(0, 0, 0, 0.08);

        opacity: 0;
        visibility: hidden;

        transform: translateY(-15px) scale(.96);

        transition: all .35s cubic-bezier(.22, .61, .36, 1);

        z-index: 4000;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        position: relative;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;

        padding: 18px 20px;

        text-decoration: none;
        color: var(--text);

        font-size: 1rem;
        font-weight: 600;

        border-radius: 20px;

        transition: all .25s ease;

        overflow: hidden;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a::before {
        content: '';

        position: absolute;
        inset: 0;

        background: linear-gradient(135deg,
                rgba(131, 48, 255, 0.12),
                rgba(59, 0, 148, 0.08));

        border-radius: inherit;

        opacity: 0;
        transition: .25s ease;
    }

    .nav-links a:hover {
        color: var(--primary);
        transform: translateY(-2px);
    }

    .nav-links a:hover::before {
        opacity: 1;
    }

    .nav-links a:active {
        transform: scale(.98);
    }

    /* Optional active menu item */
    .nav-links a.active {
        background: linear-gradient(135deg,
                var(--primary),
                var(--secondary));

        color: #fff;

        box-shadow:
            0 10px 25px rgba(131, 48, 255, .25);
    }

    .f-row {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        height: auto;
        padding: 130px 0 60px;
    }

    html[dir="rtl"] .hero h1 {
        line-height: 1.7;
    }

    html[dir="rtl"] .hero p {
        line-height: 2.1;
    }
}


/* Modal background */
.img-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

/* Modal image */
.img-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
}

/* Close button */
.img-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* hover effect */
.s-image {
    cursor: pointer;
    transition: 0.3s;
}

.s-image:hover {
    transform: scale(1.03);
}