/*
   Boubaker Info Group
   Mobile-first, clean rewrite
*/

/* ---- VARIABLES ---- */
:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #06B6D4;
    --accent: #F43F5E;

    --text-dark: #0F172A;
    --text-mid: #475569;
    --text-light: #94A3B8;

    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border: #E2E8F0;
    --border-glass: rgba(255, 255, 255, 0.5);

    --grad-brand: linear-gradient(135deg, #4F46E5, #06B6D4);
    --grad-accent: linear-gradient(135deg, #F43F5E, #FB923C);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .08);
    --shadow-glass: 0 8px 32px rgba(79, 70, 229, .08);

    --font: 'Plus Jakarta Sans', sans-serif;
    --font-ar: 'Cairo', 'Plus Jakarta Sans', sans-serif;

    --ease: 0.3s cubic-bezier(.4, 0, .2, 1);
    --ease-fast: 0.18s ease;
}

/* ---- RESET ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Prevent any horizontal overflow at root level */
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    /* CRUCIAL: hard stop for horizontal scroll */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* ---- DECORATIVE BACKGROUND SHAPES ---- */
/* These are blurred blobs — must be clipped so they never cause scroll */
.bg-shape {
    position: fixed;
    /* fixed so they don't stretch document */
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.shape-1 {
    width: min(400px, 60vw);
    height: min(400px, 60vw);
    background: #E0E7FF;
    top: -80px;
    right: -80px;
    animation: floatBlob 20s ease-in-out infinite alternate;
}

.shape-2 {
    width: min(500px, 70vw);
    height: min(500px, 70vw);
    background: #CFFAFE;
    bottom: 10%;
    left: -100px;
    animation: floatBlob 25s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(30px, 40px) scale(1.08);
    }
}

/* ---- LAYOUT ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 760px;
}

section {
    padding: 80px 0;
    width: 100%;
}

/* ---- TYPOGRAPHY ---- */
.gradient-text {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.section-desc {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-mid);
    max-width: 560px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 50px;
    background: rgba(79, 70, 229, .1);
    color: var(--primary);
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: 20px;
    border: 1px solid rgba(79, 70, 229, .2);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 50px;
    font-weight: 600;
    font-size: .95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .4);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* ==================
   NAVBAR
=================== */
.navbar {
    position: fixed;
    inset-block-start: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 18px 0;
    transition: var(--ease);
}

.navbar.scrolled {
    padding: 12px 0;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -.05em;
    position: relative;
}

.logo-text::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    bottom: 3px;
    right: -9px;
}

/* Desktop nav */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-mid);
    font-weight: 500;
    font-size: .95rem;
    transition: var(--ease-fast);
    position: relative;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--grad-brand);
    bottom: -4px;
    left: 0;
    transition: var(--ease-fast);
    border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Language switcher */
.lang-swiper {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 9px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-mid);
    transition: var(--ease-fast);
    line-height: 1.2;
    white-space: nowrap;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Mobile toggle button */
.mobile-menu-toggle {
    display: none;
    font-size: 1.75rem;
    color: var(--text-dark);
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    border: none;
}

/* ==================
   HERO SECTION
=================== */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    position: relative;
    z-index: 1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.hero-content {
    max-width: 560px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 22px;
    letter-spacing: -.03em;
}

.hero-subtitle {
    font-size: clamp(.95rem, 2vw, 1.2rem);
    color: var(--text-mid);
    margin-bottom: 36px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Hero abstract art */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-abstract-art {
    position: relative;
    width: min(350px, 100%);
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(3px);
    opacity: .75;
}

.orb-1 {
    width: 55%;
    height: 55%;
    top: 5%;
    right: 5%;
    background: var(--grad-brand);
    animation: pulse 6s ease-in-out infinite alternate;
}

.orb-2 {
    width: 40%;
    height: 40%;
    bottom: 5%;
    left: 5%;
    background: var(--grad-accent);
    animation: pulse 8s ease-in-out infinite alternate-reverse;
}

.main-card {
    position: relative;
    z-index: 2;
    width: 55%;
    aspect-ratio: 3/4;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text-dark);
    transform: rotate(8deg);
    transition: var(--ease);
}

.main-card:hover {
    transform: rotate(0deg) scale(1.05);
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: .75;
    }

    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ==================
   PROJECTS SECTION
=================== */
.projects {
    background: var(--bg-white);
    border-radius: 40px 40px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .03);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--ease);
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.project-img {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #E0E7FF, #CFFAFE);
    font-size: 3.5rem;
    color: var(--primary);
    transition: var(--ease);
    position: relative;
    overflow: hidden;
}

/* Real project images fill the card */
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card:hover .project-img i {
    transform: scale(1.2);
    transition: var(--ease);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-mid);
    font-size: .9rem;
    margin-bottom: 20px;
    line-height: 1.55;
}

.project-links {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    transition: var(--ease-fast);
    margin-right: auto;
}

.project-link:hover {
    background: var(--text-dark);
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-mid);
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: var(--ease-fast);
    text-decoration: none;
    font-size: 1.1rem;
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==================
   ABOUT SECTION
=================== */
.about {
    background: var(--bg);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 36px;
    box-shadow: var(--shadow-glass);
}

.glass-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.locations {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--bg-white);
    border-radius: 50px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.about-content p {
    font-size: 1.05rem;
    color: var(--text-mid);
    margin-bottom: 18px;
    line-height: 1.7;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 36px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-text {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ==================
   CONTACT SECTION
=================== */
.contact {
    background: var(--bg-white);
}

.contact-box {
    text-align: center;
    padding: clamp(30px, 5vw, 60px) clamp(16px, 4vw, 40px);
    background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(248, 250, 252, .9));
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-top: 36px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: var(--bg-white);
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--ease);
    width: 100%;
    max-width: 420px;
    /* prevent long email from blowing up width */
    overflow: hidden;
    word-break: break-all;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.icon-circle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.35rem;
}

/* ==================
   FOOTER
=================== */
.footer {
    background: var(--text-dark);
    color: #fff;
    padding: 56px 0 28px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding-bottom: 36px;
    margin-bottom: 28px;
}

.footer-brand h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-light);
}

.footer-legal p {
    color: var(--text-light);
    margin-bottom: 7px;
    font-size: .9rem;
}

.footer-legal strong {
    color: #fff;
}

/* ==================
   WHATSAPP FLOAT
=================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .4);
    z-index: 998;
    text-decoration: none;
    transition: var(--ease-fast);
}

.whatsapp-float:hover {
    background: #128C7E;
    transform: scale(1.1);
}

/* ==================
   SCROLL ANIMATIONS
=================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.5, 0, 0, 1), transform .8s cubic-bezier(.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: .12s;
}

.delay-2 {
    transition-delay: .24s;
}

/* ==================
   RTL SUPPORT
=================== */
.rtl-mode {
    font-family: var(--font-ar);
}

.rtl-mode .nav-list,
.rtl-mode .hero-buttons,
.rtl-mode .project-links {
    flex-direction: row-reverse;
}

.rtl-mode .project-link {
    margin-right: 0;
    margin-left: auto;
}

.rtl-mode .whatsapp-float {
    right: auto;
    left: 20px;
}

/* ==================
   RESPONSIVE — 992px
=================== */
@media (max-width: 992px) {

    .hero-container,
    .about-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .about-image {
        order: 2;
    }

    .glass-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* ==================
   RESPONSIVE — 768px (MOBILE)
=================== */
@media (max-width: 768px) {

    /* Show hamburger, hide full nav */
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        /* key: right:0 ensures width = screen width */
        width: 100%;
        /* don't use fixed pixel widths */
        max-width: 100vw;
        background: var(--bg-white);
        padding: 20px 16px;
        box-shadow: var(--shadow-md);
        flex-direction: column;
        align-items: center;
        gap: 20px;
        z-index: 997;
    }

    .nav-menu.active {
        display: flex;
        /* Show when toggled */
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .lang-swiper {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Contact: stack vertically, allow text to wrap */
    .contact-item {
        padding: 12px 18px;
        font-size: .9rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
        border-radius: 18px;
        word-break: break-word;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}