/* --- Variables & Reset --- */
:root {
    --bg-dark: #0f1014;       /* لون الخلفية الرئيسي الداكن */
    --bg-card: #16171b;       /* لون الكروت */
    --text-white: #ffffff;
    --text-grey: #b0b0b0;
    --accent: #8a2be2;        /* اللون البنفسجي */
    --accent-pink: #ff007f;
    --cyan: #32C0D6;
    --border-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- Utility Classes --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding { padding: 80px 0; }

.btn-box {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid var(--text-white);
    color: var(--text-white);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    cursor: pointer;
}

.btn-box:hover {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-dark);
}

.btn-box.small {
    padding: 8px 20px;
    font-size: 0.8rem;
}

.section-decor {
    color: var(--accent);
    letter-spacing: 5px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* --- Header --- */
header {
    background-color: #101015;
    padding: 25px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #222;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}
header.active {
    visibility: visible;
    opacity: 1;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;

}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 200px;
}
.logo img { width: 100%; }

nav ul { display: flex; gap: 30px; }
nav a { font-size: 1rem; color: #fff; }
nav a:hover, nav a.active { color: var(--cyan); }

.btn-outline {
    border: 1px solid var(--cyan);
    padding: 15px 36px;
    font-size: 0.8rem;
    letter-spacing: 2px;
}
.btn-outline:hover {
    background: var(--cyan);
    color: var(--bg-dark);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    padding: 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background : url(imgs/hero-bg.webp) no-repeat center center fixed;
    background-size: cover;
}

.social-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.social-sidebar i { color: var(--text-white); font-size: 1.2rem; }

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 30px;
}

.hero-image img {
    max-width: 100%;
    width: 500px;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* --- Services --- */
.services-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: -50px; /* Overlap effect */
    position: relative;
    z-index: 2;
}

.service-card {
    text-align: center;
    width: 300px;
}
.service-card img {
    width: 100%;
    border-radius: 5px;
    opacity: 0.7;
    transition: 0.3s;
}
.service-card h3 {
    margin-top: -30px;
    background: #000;
    display: inline-block;
    padding: 5px 15px;
    position: relative;
    font-size: 0.9rem;
    border: 1px solid #333;
}

/* --- About Sections --- */
.row {
    display: flex;
    align-items: center;
    gap: 50px;
}
.col-text, .col-img { flex: 1; }
.col-img img { width: 100%; border-radius: 8px; opacity: 0.8; }

.about-company h2, .about-me h2 { font-size: 2.2rem; margin-bottom: 20px; }
.about-company p, .about-me p { color: var(--text-grey); margin-bottom: 30px; }

/* Skills */
@keyframes fillProgress {
    from {
        width: 0 !important;
    }
    to {
        width: var(--progress-width) !important;
    }
}

.skill-item { margin-bottom: 20px; }
.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}
.progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}
.progress { height: 100%; border-radius: 3px; width: 0; transition: width 1.2s ease-out; }
.progress.animate { animation: fillProgress 1.2s ease-out forwards; }

/* --- Projects --- */
.section-header.center { text-align: center; margin-bottom: 50px; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid #222;
    &:hover {
        img {
            transform: scale(1.1);
        }
        h3 {
            color: var(--cyan);
        }
    }
}
.p-img {
    overflow: hidden;
}
.p-img img { width: 100%; display: block; transition: .7s; }
.p-content {
    padding: 20px;
}
.p-content span { color: var(--text-grey); font-size: 0.8rem; }
.p-content h3 { margin: 10px 0 20px; font-size: 1.2rem; transition: 1s;}

/* --- Contact --- */
.contact {
    background-color: #202024;
}
.contact-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-box {
    flex: 1;
    min-width: 250px;
    padding: 40px 20px;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: .7s;
}


.contact-box .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-white);
    transition: .7s;
}

.contact-box:hover {
    border-color: var(--cyan);
}
.contact-box:hover .icon {
    color: var(--cyan);
}

.contact-box h3 { margin-bottom: 10px; }
.contact-box p { color: var(--text-grey); margin-bottom: 20px; font-size: 0.9rem; }

/* --- Footer --- */
footer {
    background: #101015;
    padding-top: 60px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 30px;
    padding-bottom: 40px;
}

footer h4 { margin-bottom: 20px; font-size: 1.1rem; }
footer ul li { margin-bottom: 10px; }
footer ul li a { color: var(--text-grey); font-size: 0.9rem; transition: .3s;}
footer ul li a:hover { color: var(--cyan); text-decoration: underline; }
footer p { color: var(--text-grey); font-size: 0.9rem; margin-top: 10px; }

.copyright {
    text-align: center;
    padding: 20px 10px;
    border-top: 1px solid #222;
    font-size: 0.8rem;
    color: #666;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-container nav { display: none; } /* يمكن إضافة كود جافاسكريبت لقائمة الجوال */
    .hero-content { flex-direction: column-reverse; text-align: center; }
    .hero-text h1 { font-size: 2rem; }
    .row { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-sidebar { display: none; }
}

section.content {
    color: #eee;
    padding: 100px;
    background-color: #202024;
    text-align: center;
    h3 {
        font-size: 2.5em;
        margin-bottom: 30px;
    }
    p {
        font-size: 1.9em;
        line-height: 1.7;
    }
}

/* RTL / Arabic localization styles */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

[dir="rtl"] nav ul { display: flex; gap: 30px; justify-content: flex-start; }

[dir="rtl"] .social-sidebar {
    left: auto;
    right: 20px;
}

[dir="rtl"] .hero { background-position: center right; }
[dir="rtl"] .hero-content {    justify-content: end;}
[dir="rtl"] .row { direction: rtl; }
[dir="rtl"] .reverse-mobile { flex-direction: row-reverse; }

[dir="rtl"] .service-card, [dir="rtl"] .project-card {
    text-align: right;
}

[dir="rtl"] .section-decor { letter-spacing: 4px; }

[dir="rtl"] .footer-grid { text-align: right; }

[dir="rtl"] .social-sidebar a { margin-left: 0; margin-right: 0; }

@media (max-width: 768px) {
    [dir="rtl"] .footer-grid { text-align: center; }
}


select.lang {
    padding: 10px;
    border-radius: 5px;
    background: transparent;
    color: #fff;
}
select.lang option {
    color: #333;
}