:root {
    --primary-color: #f47f20;
    --secondary-color: #abc252;
    --dark-color: #3f3c3c;
    --light-color: #e7e7e7;
    --text-color: #333;
}

html {
    scroll-padding-top: 95px;
}

html[lang="ar"] {
    font-family: "Beiruti", sans-serif !important;
    direction: rtl;
}

html[lang="ar"] body {
    font-family: "Beiruti", sans-serif !important;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
    font-family: "Beiruti", sans-serif !important;
}

html[lang="ar"] p,
html[lang="ar"] a,
html[lang="ar"] button,
html[lang="ar"] span,
html[lang="ar"] li,
html[lang="ar"] label,
html[lang="ar"] input,
html[lang="ar"] textarea {
    font-family: "Beiruti", sans-serif !important;
}

html[lang="ar"] .cards .title,
html[lang="ar"] .projects .title,
html[lang="ar"] .main-title,
html[lang="ar"] .main-subtitle,
html[lang="ar"] .main-tagline,
html[lang="ar"] .main-btn,
html[lang="ar"] .navigation a,
html[lang="ar"] .cards .card .info h3,
html[lang="ar"] .cards .card .info p,
html[lang="ar"] .projects .project-card .about-text {
    font-family: "Beiruti", sans-serif !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', Arial, sans-serif; /* الخط الافتراضي للغة الإنجليزية */
}

body {
    line-height: 1.6;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* تنسيق الهيدر الجديد */
header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 10%;
    background-color: var(--light-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 999;
    transition: all 0.3s ease;
}

/* تعديلات للغة العربية */
html[lang="ar"] header {
    flex-direction: row-reverse;
}

.logo {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 80px;
    width: auto;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 30px;
}

.navigation a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navigation a:hover {
    color: var(--primary-color);
}

#language-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* القسم الرئيسي */
.main {
    width: 100%;
    min-height: 100vh;
    padding: 200px 10% 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    text-align: center;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}

html[lang="ar"] .main-container {
    flex-direction: column;
}

.content-section {
    padding: 20px;
}

.main-title {
    font-size: 3.25em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.main-subtitle {
    display: block;
    font-size: 1.69em;
    color: var(--secondary-color);
    margin: 10px 0 20px;
    font-weight: 500;
}

.main-tagline {
    font-size: 1.82em;
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-weight: 400;
}

.main-btn {
    display: inline-block;
    padding: 18px 45px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-size: 1.21em;
    font-weight: 600;
    border-radius: 30px;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.main-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(244,127,32,0.3);
}

.social-icons {
    margin-top: 45px;
    display: flex;
    justify-content: center;
    gap: 22.5px;
}

.social-icons a {
    color: var(--primary-color);
    font-size: 1.95em;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--secondary-color);
    transform: translateY(-5px);
}

/* تنسيق قسم الكاردز */
.cards {
    padding: 60px 5%;
    text-align: center; /* لتوسيط العنوان والمحتوى بشكل افتراضي */
}

.cards .title {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

.cards .content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* لتوسيط البطاقات أفقياً */
    gap: 20px;
    margin-top: 30px;
}

.cards .card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
    flex-basis: calc(33.33% - 20px); /* لثلاث بطاقات في الصف مع مسافة بينها */
    margin-bottom: 20px;
    transition: transform 0.3s ease-in-out;
}

.cards .card:hover {
    transform: translateY(-5px);
}

.cards .card .icon {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.cards .card .info h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.cards .card .info p {
    color: var(--text-color);
    font-size: 1em;
}

/* تنسيق قسم نبذة عننى */
.projects {
    padding: 60px 5%;
    text-align: center; /* لتوسيط العنوان */
}

.projects .title {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.projects .content {
    text-align: center; /* لتوسيط النص */
}

.projects .project-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
    margin: 20px auto; /* لتوسيط الكارد أفقياً */
    max-width: 600px; /* تحديد عرض أقصى للكارد */
}

.projects .project-card .about-text {
    color: var(--secondary-color);
    font-size: 1.3em;
    line-height: 1.8;
    margin-top: 0;
}

/* استجابة للهواتف */
@media (max-width: 768px) {
    header {
        padding: 15px 5%;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    html[lang="ar"] header {
        align-items: center;
        text-align: center;
    }

    .logo {
        margin-bottom: 15px;
    }

    .navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }

    .main {
        padding: 120px 5% 50px;
        min-height: 100vh;
    }

    .main-container {
        flex-direction: column;
    }

    html[lang="ar"] .main-container {
        flex-direction: column;
    }

    .logo-section {
        margin-bottom: 30px;
        text-align: center;
    }

    .company-logo {
        max-width: 200px;
    }

    .content-section {
        text-align: center;
    }

    .social-icons {
        justify-content: center;
        gap: 15px;
    }

    .social-icons a {
        font-size: 1.5em;
    }

    .main-title {
        font-size: 2.5em;
    }

    .main-subtitle {
        font-size: 1.3em;
    }

    .main-tagline {
        font-size: 1.4em;
    }

    .main-btn {
        padding: 12px 30px;
        font-size: 1.1em;
    }

    section {
        padding: 60px 5%;
    }

    .card {
        width: 100%;
    }

    .cards .content {
        flex-direction: column;
        align-items: center;
    }

    .cards .card {
        flex-basis: 100%;
    }
}

/* استجابة للشاشات الصغيرة جدًا */
@media (max-width: 480px) {
    .main-title {
        font-size: 2em;
    }

    .card {
        padding: 15px;
    }

    .main {
        padding: 100px 5% 50px;
    }

    .social-icons a {
        font-size: 1.2em;
    }

    .main-title {
        font-size: 2.2em;
    }

    .main-subtitle {
        font-size: 1.2em;
    }

    .main-tagline {
        font-size: 1.3em;
    }

    .main-btn {
        padding: 10px 25px;
        font-size: 1em;
    }
}