@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&family=Tajawal:wght@300;400;700&family=Open+Sans:wght@300;400;600;700&family=Poppins:wght@300;400;600;700;800&display=swap');

:root {
    --primary-green: #2E7D32;
    --primary-blue: #1565C0;
    --secondary-green: #66BB6A;
    --secondary-blue: #42A5F5;
    
    --white: #FFFFFF;
    --bg-light: #F5F7FA;
    --text-gray: #555555;
    --text-dark: #1C1C1C;
    
    --transition-fast: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.1);
}

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

/* Typography Base Classes (switched by JS) */
body.font-arabic {
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--white);
    overflow-x: hidden;
}
body.font-arabic h1, body.font-arabic h2, body.font-arabic h3, body.font-arabic h4 {
    font-weight: 700;
}

body.font-latin {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}
body.font-latin h1, body.font-latin h2, body.font-latin h3, body.font-latin h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Global Styles */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

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

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

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-green);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-green);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-blue);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition-fast);
    padding: 20px 0;
    box-shadow: var(--shadow-soft);
}

header.scrolled {
    padding: 10px 0;
}

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

.logo-container a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-dark);
}

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

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

/* Language Dropdown Styles */
.lang-switcher.dropdown {
    position: relative;
    background: transparent;
    padding: 0;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: var(--bg-light);
    color: var(--primary-blue);
    font-weight: 600;
    transition: var(--transition-fast);
}

.lang-toggle:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

.lang-menu {
    position: absolute;
    top: 100%;
    left: 0; /* LTR */
    background-color: var(--white);
    min-width: 150px;
    box-shadow: var(--shadow-soft);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

html[dir="rtl"] .lang-menu {
    right: 0;
    left: auto;
}

.lang-switcher.dropdown:hover .lang-menu,
.lang-switcher.dropdown:focus-within .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu .lang-btn {
    padding: 10px 20px;
    border-radius: 0;
    background: transparent;
    color: var(--text-dark);
    text-align: left; /* default LTR */
    display: block;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

html[dir="rtl"] .lang-menu .lang-btn {
    text-align: right;
}

.lang-menu .lang-btn:hover {
    background-color: var(--bg-light);
    color: var(--primary-green);
}

.lang-menu .lang-btn.active {
    background-color: var(--primary-blue);
    color: var(--white);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: url('../img/hero-bg.jpg') center/cover no-axis-view;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.8) 0%, rgba(28, 28, 28, 0.7) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* About Section */
.about {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-content {
    flex: 1;
}

.about-content h2 {
    font-size: 2.2rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.about-content .uni-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 10px 20px;
    border-radius: 50px;
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.about-content p {
    color: var(--text-gray);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.about-image::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    right: 20px;
    top: 20px;
    border: 3px solid var(--secondary-green);
    border-radius: 10px;
    z-index: -1;
}

html[dir="rtl"] .about-image::before {
    left: 20px;
    right: -20px;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-slow);
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-bottom-color: var(--primary-green);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-blue);
    font-size: 2rem;
    transition: var(--transition-fast);
}

.service-card:hover .service-icon {
    background: var(--primary-blue);
    color: var(--white);
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Why Us Section */
.why-us-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.why-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.why-icon {
    font-size: 2rem;
    color: var(--secondary-green);
}

.why-text h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.why-text p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Methodology Section */
.methodology-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 20px;
}

/* The line behind nodes */
.methodology-timeline::before {
    content: '';
    position: absolute;
    top: 50px; /* Aligns with icon center */
    left: 40px;
    right: 40px;
    height: 4px;
    background: var(--bg-light);
    z-index: 1;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 10px;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--white);
    border: 3px solid var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: bold;
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: var(--transition-fast);
}

.step:hover .step-icon {
    background: var(--primary-blue);
    color: var(--white);
    transform: scale(1.1);
}

.step h4 {
    font-size: 1rem;
    color: var(--text-dark);
}

/* Case Studies Cards */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.case-card {
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.case-img {
    height: 200px;
    background-color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.case-content {
    padding: 25px;
}

.case-content h3 {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.case-prob {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 10px;
}

.case-sol {
    font-size: 0.95rem;
    color: var(--text-gray);
}

/* Contact Section */
.contact-wrapper {
    display: flex;
    gap: 40px;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.contact-form {
    flex: 1;
    padding: 50px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

html[dir="rtl"] .contact-form input,
html[dir="rtl"] .contact-form textarea {
    text-align: right;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-blue);
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

.contact-map {
    flex: 1;
    min-height: 400px;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-info {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--white);
    padding: 10px;
    border-radius: 5px;
    width: fit-content;
}

.footer-logo img {
    height: 40px;
}

.footer-info p {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--secondary-green);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul a {
    color: #bbb;
}

.footer-links ul a:hover {
    color: var(--white);
    padding-right: 5px; /* LTR */
}

html[dir="rtl"] .footer-links ul a:hover {
    padding-left: 5px;
    padding-right: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #888;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .methodology-timeline {
        flex-direction: column;
        gap: 30px;
        padding-left: 20px;
    }
    
    html[dir="rtl"] .methodology-timeline {
        padding-right: 20px;
        padding-left: 0;
    }
    
    .methodology-timeline::before {
        top: 0;
        bottom: 0;
        left: 50px;
        width: 4px;
        height: auto;
    }
    
    html[dir="rtl"] .methodology-timeline::before {
        right: 50px;
        left: auto;
    }
    
    .step {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 20px;
    }
    
    html[dir="rtl"] .step {
        text-align: right;
    }
    
    .step-icon {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition-fast);
        padding: 40px;
    }
    
    html[dir="rtl"] .nav-menu {
        right: -100%;
        left: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    html[dir="rtl"] .nav-menu.active {
        right: 0;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        width: 100%;
        margin-bottom: 40px;
    }
    
    .nav-actions {
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .about {
        flex-direction: column;
    }
    
    .why-us-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 40px;
    }
}

@media (max-width: 500px) {
    .services-grid, .cases-grid {
        grid-template-columns: 1fr;
    }
    
}

/* Technology & Interactive Visual Effects */

/* Page Transition Overlay */
.tech-transition-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    z-index: 99999;
    pointer-events: none;
    transform: translateX(0);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Default LTR (French, English) */
.tech-transition-overlay.loaded {
    transform: translateX(100%);
}

.tech-transition-overlay.navigating {
    transition: none;
    transform: translateX(-100%);
}

.tech-transition-overlay.navigating.active {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateX(0);
}

/* RTL (Arabic) Support */
html[dir="rtl"] .tech-transition-overlay.loaded {
    transform: translateX(-100%);
}

html[dir="rtl"] .tech-transition-overlay.navigating {
    transition: none;
    transform: translateX(100%);
}

html[dir="rtl"] .tech-transition-overlay.navigating.active {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateX(0);
}

/* Service Card & Icons Tech Effects */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%;
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-25deg);
    transition: 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1;
}

.service-card:hover::before {
    left: 150%;
}

.service-icon {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
}

.service-card:hover .service-icon {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-8px) scale(1.15) rotateY(180deg);
    box-shadow: 0 10px 25px rgba(21, 101, 192, 0.5), 0 0 15px rgba(46, 125, 50, 0.4);
}

.service-icon i {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-card:hover .service-icon i {
    transform: rotateY(-180deg); /* Keeps icon facing correctly */
}

/* Methodology Step Icons Pulse Glow */
.step-icon {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.step:hover .step-icon {
    background: var(--primary-blue);
    color: var(--white);
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(21, 101, 192, 0.7);
}

.step-icon::after {
    content: '';
    position: absolute;
    top: -6px; 
    left: -6px; 
    right: -6px; 
    bottom: -6px;
    border: 2px dashed var(--primary-blue);
    border-radius: 50%;
    animation: dashRotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.step:hover .step-icon::after {
    opacity: 1;
}

@keyframes dashRotate {
    100% { transform: rotate(360deg); }
}

/* Button Interactive Effects */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.5), 0 0 15px rgba(21, 101, 192, 0.4);
}

/* Nav Link Hover Technology Line */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--primary-blue);
}

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

html[dir="rtl"] .nav-links a::after {
    right: 0;
    left: auto;
}
