/* =========================================
   GLOBAL STYLE — used on every page (EN + AR)
   ========================================= */

/* --- Variables & Reset --- */
:root {
    --primary-color: #2cb7c8;
    --secondary-color: #2d4a5c;
    --text-color: #333333;
    --light-bg: #f4f8f9;
    --white: #ffffff;
    --font-main: 'Poppins', sans-serif;
    --font-arabic: 'Cairo', 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #ffffff;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

/* --- Icons --- */
.icon-sm {
    width: 16px; height: 16px; display: inline-block;
    vertical-align: middle; margin-right: 5px;
}

/* --- Buttons --- */
.btn {
    display: inline-block; padding: 12px 30px; border-radius: 5px;
    font-weight: 600; transition: all 0.3s ease; cursor: pointer;
    border: none; font-size: 16px;
}
.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: #239aa8; }
.btn-secondary { background-color: var(--secondary-color); color: var(--white); }
.btn-secondary:hover { background-color: #1e3340; }
.btn-dark { background-color: var(--secondary-color); color: var(--white); }

/* --- Top Bar --- */
.top-bar {
    background-color: var(--primary-color); color: var(--white);
    font-size: 14px; padding: 8px 0;
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; }
.top-info span { margin-right: 20px; }

/* --- Header --- */
.main-header {
    background-color: transparent;
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    align-items: center;
    position: relative;
}

.header-logo { margin-left: 100px; }

.header-logo img {
    height: 80px;
    width: auto;
    display: block;
}

.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-weight: 500;
    color: var(--white);
    transition: color 0.3s;
    font-size: 16px;
}

.main-nav a:hover, .main-nav a.active { color: var(--primary-color); }

.lang-switch { position: static; }

.lang-switch a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--white);
    background-color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 14px;
}
.lang-switch a:hover { background-color: #239aa8; }

/* --- Sticky Header --- */
.main-header.scrolled {
    position: fixed;
    top: 0;
    background-color: var(--secondary-color);
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* --- Mobile Toggle --- */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- Section Title (shared) --- */
.section-title {
    font-size: 32px; color: var(--secondary-color);
    text-align: center; margin-bottom: 50px; font-weight: 700;
}

/* --- Footer --- */
.main-footer {
    background-color: #0f1a24;
    color: #cbd5e1;
    padding: 60px 0 20px;
    font-size: 14px;
}

/* =========================================
   FOOTER GRID (Base - English LTR)
   ========================================= */
.footer-grid {
    display: grid;
    /* In English (LTR), the Logo is first, so it gets the 2fr space on the left */
    grid-template-columns: 2fr 1fr 1fr 1fr; 
    gap: 40px;
    margin-bottom: 40px;
}

/* =========================================
   FOOTER GRID (Arabic RTL Override)
   ========================================= */
html[dir="rtl"] .footer-grid {
    /* In Arabic (RTL), the Logo is last, so it gets the 2fr space on the left */
    grid-template-columns: 1fr 1fr 1fr 2fr; 

}.footer-col h4 {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col ul li { margin-bottom: 10px; }

.footer-col ul li a {
    color: #94a3b8;
    transition: color 0.3s;
}

.footer-col ul li a:hover { color: var(--primary-color); }

.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 15px;
}

.footer-col p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #94a3b8;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-contact span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}

.footer-social { display: flex; gap: 10px; }

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: background-color 0.3s;
    color: var(--white);
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
}

.footer-social a:hover { background-color: var(--primary-color); }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
    font-size: 13px;
}

/* =========================================
   GLOBAL RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    .main-header {
        position: static;
        background-color: var(--secondary-color);
        padding: 15px 0;
    }

    .header-container {
        flex-direction: column;
        justify-content: center;
        gap: 15px;
        padding: 0 15px;
    }

    .header-logo { margin: 0 auto; }
    .header-logo img { height: 70px; width: auto; }

    .header-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }

    .lang-switch { position: static; transform: none; }
    .lang-switch a { padding: 6px 15px; font-size: 14px; }

    .mobile-toggle {
        display: flex;
        position: static;
        transform: none;
        margin: 0;
    }

    .main-nav {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--secondary-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .main-nav.active { max-height: 400px; }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }

    .main-nav li { border-bottom: 1px solid rgba(255,255,255,0.1); }

    .main-nav a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        color: var(--white);
    }

    .main-nav a:hover, .main-nav a.active {
        background-color: rgba(255,255,255,0.1);
        color: var(--primary-color);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
        text-align: center;
        padding: 5px 0;
    }

    .top-info span {
        display: block;
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 12px;
    }

    .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================
   RTL SUPPORT — Arabic pages only
   (activates only when <html dir="rtl">)
   ========================================= */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic);
}

html[dir="rtl"] .header-logo {
    margin-left: 0;
    margin-right: 100px;
}

html[dir="rtl"] .main-nav ul {
    flex-direction: row-reverse;
}

html[dir="rtl"] .top-info span {
    margin-right: 0;
    margin-left: 20px;
}

html[dir="rtl"] .icon-sm {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="rtl"] .footer-contact span,
html[dir="rtl"] .lang-switch a {
    flex-direction: row-reverse;
}

/* Keep buttons and hero readable */
html[dir="rtl"] .hero,
html[dir="rtl"] .section-title {
    text-align: center;
}

/* Mobile RTL overrides */
@media (max-width: 991px) {
    html[dir="rtl"] .header-logo {
        margin: 0 auto;
    }
    html[dir="rtl"] .main-nav a {
        text-align: right;
    }
    html[dir="rtl"] .main-nav ul {
        flex-direction: column;
    }
}
/* =========================================
   ARABIC MARQUEE FIX (RTL)
   ========================================= */
html[dir="rtl"] .marquee-track {
    /* In RTL, we need to animate to the right (positive X) 
       and reverse the animation direction */
    animation: marquee-rtl 20s linear infinite;
}

@keyframes marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); } 
}