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

:root {
    --primary: #001A41;
    --accent: #0070F3;
    --accent-light: #E1EFFF;
    --bg: #FFFFFF;
    --bg-alt: #F7F9FC;
    --text: #1A1F36;
    --text-muted: #4F566B;
    --border: #E3E8EE;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Dynamic Typography */
    --fs-h1: clamp(2.5rem, 8vw, 4.5rem);
    --fs-h2: clamp(1.8rem, 5vw, 3rem);
    --fs-h3: clamp(1.4rem, 4vw, 2rem);
    --fs-h4: clamp(1.1rem, 3vw, 1.3rem);
    --fs-body: clamp(1rem, 2vw, 1.1rem);
    --fs-lead: clamp(1.1rem, 3vw, 1.4rem);
}

[lang="ar"] {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4 {
    font-family: 'Cairo', sans-serif;
    letter-spacing: normal;
}

[lang="ar"] .nav-links {
    flex-direction: row-reverse;
    align-items: center;
}

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

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    line-height: 1.1;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

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

ul {
    list-style: none;
}

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

/* Typography Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 1rem auto 4rem;
    text-align: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}

[dir="rtl"] select.form-control {
    background-position: left 1rem center;
}

[dir="rtl"] .form-group {
    text-align: right;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 112, 243, 0.39);
}

.btn-primary:hover {
    background-color: #0060df;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 112, 243, 0.23);
}

.btn-secondary {
    background-color: var(--accent-light);
    color: var(--accent);
}

.btn-secondary:hover {
    background-color: #d0e7ff;
    transform: translateY(-2px);
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

/* Navigation */
nav {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

nav.scrolled {
    padding: 1rem 0;
    border-color: var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 70px;
    width: auto;
    transition: var(--transition);
    display: block;
}

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

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

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

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
}

/* Layout Sections */
section {
    padding: 8rem 0;
}

.hero {
    padding: 12rem 0 8rem;
    background: radial-gradient(circle at 10% 20%, var(--accent-light) 0%, transparent 40%);
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-p {
    font-size: var(--fs-lead);
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Grids */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stats-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stats-label {
    font-weight: 600;
    color: var(--primary);
}

/* Case Studies */
.case-study-list {
    display: grid;
    gap: clamp(4rem, 10vw, 8rem);
}

.case-study-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    grid-template-areas: "img card";
}

.case-study-item:nth-child(even) {
    grid-template-areas: "card img";
}

.case-study-card {
    grid-area: card;
    background: var(--bg-alt);
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.case-study-img {
    grid-area: img;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.case-study-img:hover {
    transform: scale(1.02);
}

.case-study-img img {
    width: 100%;
    display: block;
}

@media (max-width: 992px) {
    .case-study-item, .case-study-item:nth-child(even) {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "img"
            "card";
        gap: 2rem;
    }
}

/* RTL Specific Overrides for Case Studies to keep literal "Left" and "Right" */
[lang="ar"] .case-study-item {
    grid-template-areas: "card img";
}

[lang="ar"] .case-study-item:nth-child(even) {
    grid-template-areas: "img card";
}

/* Why Choose Me */
.why-me-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.why-me-list {
    display: grid;
    gap: 2rem;
}

/* Process */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.process-step {
    text-align: center;
}

.process-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: -1.5rem;
}

/* Contact Form */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: white;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
    .case-study-item {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

@media (max-width: 768px) {
    section {
        padding: 5rem 0;
    }

    .hero {
        padding: 10rem 0 6rem;
    }

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

/* Project Detail Styles */
.project-hero {
    padding: 12rem 0 6rem;
    background: linear-gradient(to bottom, var(--bg-alt) 0%, var(--bg) 100%);
    text-align: left;
}

.project-hero h1 {
    font-size: 4rem;
    margin: 1rem 0;
    letter-spacing: -0.02em;
}

.project-tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.project-meta {
    display: flex;
    justify-content: flex-start;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin-top: 2.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.project-content {
    padding: 2rem 0 8rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.project-detail-card {
    background: white;
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius);
    height: 100%;
}

.project-detail-card h3 {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.project-image-container {
    margin: 4rem 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px -12px rgba(50,50,93,0.25), 0 18px 36px -18px rgba(0,0,0,0.3);
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
}

.project-image-container img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.project-image-container:hover img {
    transform: scale(1.02);
}

.bg-alt {
    background-color: var(--bg-alt);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: var(--bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
}

.cta-box {
    margin-top: 8rem;
    text-align: center;
    background: var(--bg-alt);
    padding: clamp(2rem, 8vw, 5rem);
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }
    
    .cta-box {
        margin-top: 4rem;
    }
}

/* Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.6);
    color: white;
}

/* Footer Redesign */
.site-footer {
    background: #0f172a;
    color: white;
    padding: 6rem 0 3rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 1.5rem;
    display: block;
}

.footer-brand p {
    color: #94a3b8;
    max-width: 300px;
    line-height: 1.6;
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-links {
    list-style: none;
    display: grid;
    gap: 0.8rem;
}

.footer-links a {
    color: #94a3b8;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: #64748b;
    transition: all 0.2s ease;
}

.footer-social a:hover {
    color: white;
    transform: translateY(-3px);
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Arabic Redesign Refinements */
[lang="ar"] {
    line-height: 1.8;
}

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 {
    line-height: 1.4;
    font-weight: 700;
}

[lang="ar"] .hero {
    background-image: radial-gradient(circle at 80% 20%, var(--accent-light) 0%, transparent 40%),
                      url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230070f3' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

[lang="ar"] .card {
    border-right: 4px solid transparent;
    transition: var(--transition);
}

[lang="ar"] .card:hover {
    border-right-color: var(--accent);
}

[lang="ar"] .nav-links {
    gap: 2.5rem;
}

[lang="ar"] .section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

[lang="ar"] .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

