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

:root {
    --bg-dark: #FFFFFF;
    --bg-card: #F8F9FA;
    --accent-primary: #A32938;
    --accent-crimson: #A32938;
    --accent-grey: #7A7A7A;
    --accent-white: #FFFFFF;
    --accent-gold: #A32938; /* Alias for compatibility */
    --accent-blue: #7A7A7A; /* Alias for compatibility */
    --accent-green: #E0E0E0; /* Alias for compatibility */
    --text-primary: #333333;
    --text-secondary: #555555;
    --glass: rgba(0, 0, 0, 0.03);
    --border-primary: rgba(163, 41, 56, 0.15);
    --border-gold: rgba(163, 41, 56, 0.1);
    --border-blue: rgba(122, 122, 122, 0.1);
    --border-green: rgba(224, 224, 224, 0.1);
    --light-grey: #F0F0F0;
    --transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* Fluid Typography */
    --h1-size: clamp(2.5rem, 8vw, 4.8rem);
    --h2-size: clamp(2rem, 5vw, 3.2rem);
    --p-size: clamp(1rem, 2vw, 1.15rem);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Inter', sans-serif;
}

/* Background Blobs */
.blob {
    position: fixed;
    width: 500px;
    height: 500px;
    filter: blur(100px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.15;
    animation: blobFloat 20s infinite alternate;
}

.blob-blue { background: var(--accent-gold); top: -10%; left: -10%; }
.blob-green { background: var(--accent-green); bottom: -10%; right: -10%; animation-delay: -5s; }
.blob-gold { background: var(--accent-gold); top: 40%; left: 30%; animation-delay: -10s; }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    direction: rtl; /* Arabic priority */
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 123, 255, 0.03) 0%, transparent 50%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 10px;
}

/* Typography */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gold-text {
    color: var(--accent-crimson);
    background: linear-gradient(45deg, #A32938, #C13748, #7A7A7A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

section {
    padding: 100px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: transparent;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-gold);
}

.nav-content {
    display: flex;
    flex-direction: row !important; /* Keep layout consistent across AR/FR/EN */
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    direction: ltr !important; /* Force items to stay in place */
}

.logo {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 900;
    color: var(--accent-gold);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    z-index: 1001;
    flex: 1;
    display: flex;
    justify-content: center;
    direction: rtl; /* Keep text inside logo correct for Arabic */
}

.lang-switcher {
    display: flex;
    justify-content: flex-start;
    z-index: 1001;
    flex: 1;
}

.menu-toggle {
    display: flex;
    font-size: 1.8rem;
    color: var(--accent-gold);
    cursor: pointer;
    justify-content: flex-end;
    z-index: 1001;
    flex: 1;
}

.nav-links {
    display: none; /* Hidden on desktop to follow centered logo style */
}

@media (max-width: 768px) {
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%; /* Full screen drawer */
        height: 100vh;
        background: #050505 !important;
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 9999;
        list-style: none;
        gap: 40px;
        padding: 40px;
        padding-top: 150px;
    }

    .nav-links.active {
        right: 0;
    }

    .drawer-header {
        position: absolute;
        top: 30px;
        left: 30px;
        font-size: 2rem;
        color: var(--accent-gold);
        cursor: pointer;
    }

    .nav-links a {
        font-size: 2rem !important;
        font-weight: 900 !important;
        text-transform: uppercase;
        color: #FFFFFF !important;
    }
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-crimson);
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 20px;
    transition: var(--transition);
    background: rgba(163, 41, 56, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(163, 41, 56, 0.3);
}

.back-btn:hover {
    transform: translateX(10px);
    background: var(--accent-crimson);
    color: #fff;
}

#lang-btn {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--accent-gold);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: var(--transition);
}

#lang-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

.nav-links a {
    text-decoration: none;
    color: #FFFFFF;
    font-weight: 400;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

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

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

.nav-links a:hover {
    color: var(--accent-gold);
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, rgba(5, 7, 10, 0.8) 0%, rgba(5, 7, 10, 0.4) 100%), url('assets/hero_v2.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 1;
    transform: none;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.hero-content {
    max-width: 900px;
    padding-top: 100px;
}

.hero h1 {
    font-size: var(--h1-size);
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero p {
    font-size: var(--p-size);
    color: #CCCCCC;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    padding: 15px 40px;
    background: var(--accent-gold);
    color: #000;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: var(--transition);
    display: inline-block;
}

.cta-button:hover {
    background: var(--accent-grey);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(163, 41, 56, 0.4);
}

/* Legacy Section */
.legacy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.legacy-text h2 {
    font-size: var(--h2-size);
    margin-bottom: 25px;
}

.legacy-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: var(--bg-card);
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-green));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--accent-blue);
}

.service-card:nth-child(2n):hover {
    border-color: var(--accent-green);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    display: block;
}

/* Stats Section */
.stats-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    padding: 80px 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    border-top: 1px solid var(--border-blue);
    border-bottom: 1px solid var(--border-green);
    margin: 50px 0;
}

.stat-item h3 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.stat-item p {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Projects */
.projects-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-item {
    aspect-ratio: 1;
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: var(--transition);
}

.project-item:hover .project-overlay {
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .legacy-grid { grid-template-columns: 1fr; gap: 40px; }
    .stats-container { grid-template-columns: repeat(2, 1fr); gap: 40px; }
    .projects-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    
    .logo {
        font-size: 1.2rem;
    }

    .lang-switcher {
        margin-left: 0;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-dark);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s ease-in-out;
        z-index: 999;
        border-left: 1px solid var(--border-gold);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-button {
        width: 100%;
        margin-right: 0 !important;
    }

    .stats-container {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

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

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