/* --- إعدادات الخط المحلي --- */
@font-face {
    font-family: 'Nahdi Black';
    src: url('fonts/Nahdi-Black.woff2') format('woff2'),
         url('fonts/Nahdi-Black.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* --- الإعدادات العامة والـ Variables الاحترافية --- */
:root {
    --bg-color: #0A0A0B;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --accent-color: #00aaff;
    --accent-glow: rgba(0, 170, 255, 0.5);
    --card-bg: rgba(26, 26, 30, 0.3);
    --glass-border: 1px solid rgba(255, 255, 255, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

/* تعديل: الخلفية السائلة المتحركة */
body {
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    font-family: 'Nahdi Black', 'Poppins', sans-serif;
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}
body::before, body::after {
    content: '';
    position: fixed;
    left: 50%;
    top: 50%;
    width: 1000px;
    height: 1000px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    opacity: 0.25;
}
body::before {
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    animation: liquid-flow-1 25s infinite linear;
}
body::after {
    background: radial-gradient(circle, #4f46e5, transparent 70%);
    animation: liquid-flow-2 30s infinite linear reverse;
}
@keyframes liquid-flow-1 { 0% { transform: translate(-40%, -60%) rotate(0deg) scale(1); } 50% { transform: translate(-60%, -40%) rotate(180deg) scale(1.3); } 100% { transform: translate(-40%, -60%) rotate(360deg) scale(1); } }
@keyframes liquid-flow-2 { 0% { transform: translate(-50%, -50%) rotate(0deg) scale(1.2); } 50% { transform: translate(-40%, -55%) rotate(-180deg) scale(1); } 100% { transform: translate(-50%, -50%) rotate(-360deg) scale(1.2); } }


/* تنسيقات خاصة باللغة الإنجليزية */
html[dir="ltr"] body { font-family: 'Poppins', sans-serif; }
html[dir="ltr"] .about-text, html[dir="ltr"] .offer-features, html[dir="ltr"] .project-text { text-align: center; }
html[dir="ltr"] .skill-level { transform-origin: left; }
html[dir="ltr"] .btn-primary i { margin-right: 0; margin-left: 8px; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; overflow-x: hidden; }
section { padding: 100px 0; border-bottom: var(--glass-border); }
.section-title { text-align: center; font-size: 2.8rem; margin-bottom: 50px; font-weight: 700; color: #fff; }
.section-subtitle { text-align: center; max-width: 600px; margin: -30px auto 40px auto; color: var(--secondary-text-color); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- قائمة التنقل (Navbar) --- */
.main-header { position: fixed; top: 0; width: 100%; z-index: 1000; background-color: rgba(10, 10, 11, 0.5); backdrop-filter: blur(15px); border-bottom: var(--glass-border); }
.navbar { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 5px 20px; }
.nav-start { display: flex; align-items: center; gap: 12px; }
.nav-end { display: flex; align-items: center; gap: 20px; }
.nav-logo { font-size: 1.1rem; font-weight: 700; color: #fff; text-decoration: none; }
.lang-switcher { background: transparent; border: 1px solid var(--secondary-text-color); color: var(--secondary-text-color); padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: all 0.3s; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 0.85rem; }
.lang-switcher:hover { color: #fff; border-color: #fff; }
.nav-menu { display: flex; list-style: none; gap: 35px; }
.nav-link { color: var(--primary-text-color); text-decoration: none; font-size: 1rem; position: relative; padding-bottom: 5px; transition: color 0.3s; }
.nav-link:hover { color: var(--accent-color); }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; right: 0; background-color: var(--accent-color); transition: width 0.3s ease-out; }
html[dir="ltr"] .nav-link::after { right: auto; left: 0; }
.nav-link:hover::after { width: 100%; }
.whatsapp-header-icon { color: #25D366; font-size: 1.8rem; text-decoration: none; transition: transform 0.3s; }
.whatsapp-header-icon:hover { transform: scale(1.1); }
.back-btn { padding: 0; width: 45px; height: 45px; font-size: 1.2rem; display: flex; justify-content: center; align-items: center; background-image: none; background-color: transparent; color: var(--accent-color); }
.back-btn:hover { background-color: var(--accent-color); color: var(--bg-color); }


/* --- قسم الهيرو --- */
.hero-section { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; border: none; }
.hero-content h1 { font-size: 3rem; margin-bottom: 20px; color: #fff; white-space: nowrap; animation: fadeIn 1s ease-out; }
.hero-content h1 .brand-name { font-weight: normal; color: #fff; }
.hero-content p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 40px auto; animation: fadeIn 1s ease-out 0.3s backwards; line-height: 1.8; }
.btn-primary { display: inline-block; padding: 12px 30px; border-radius: 50px; font-size: 1rem; font-weight: 700; transition: all 0.3s ease; text-decoration: none; cursor: pointer; border: 1px solid var(--accent-color); background-image: linear-gradient(45deg, var(--accent-color), #0077b3); color: #fff; box-shadow: 0 0 20px rgba(0, 170, 255, 0.3); }
.btn-primary:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 170, 255, 0.5); }

/* --- قسم من أنا --- */
.about-content { display: flex; align-items: center; gap: 50px; flex-wrap: wrap; justify-content: center; }
.about-image { flex: 0 0 450px; width: 450px; height: 450px; border-radius: 25px; overflow: hidden; position: relative; box-shadow: 0 0 20px rgba(0, 170, 255, 0.2); }
.about-personal-image { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.5s ease-out; }
.about-image:hover .about-personal-image { transform: scale(1.05); }
.about-text { flex: 1; }
.about-text h3 { font-size: 1.8rem; margin-bottom: 15px; color: #fff; }
.about-text p { margin-bottom: 15px; }

/* --- قسم ليه تختارني؟ --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.feature-card { background-color: var(--card-bg); border: var(--glass-border); backdrop-filter: blur(15px); border-radius: 15px; padding: 30px; text-align: center; transition: transform 0.3s, box-shadow 0.3s; }
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 15px var(--accent-glow); }
.feature-icon { width: 60px; height: 60px; line-height: 60px; border-radius: 50%; background-color: rgba(0, 170, 255, 0.1); color: var(--accent-color); font-size: 1.8rem; margin: 0 auto 20px auto; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: 10px; color: #fff; }

/* --- قسم المهارات --- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.skill-card { display: flex; align-items: center; gap: 20px; background-color: var(--card-bg); border: var(--glass-border); backdrop-filter: blur(15px); border-radius: 15px; padding: 20px; }
.skill-icon { font-size: 2.5rem; color: var(--accent-color); }
.skill-details { flex-grow: 1; }
.skill-details h3 { margin: 0 0 10px 0; font-size: 1.1rem; color: #fff; font-family: 'Poppins', sans-serif; }
.skill-bar { width: 100%; height: 8px; background-color: rgba(255, 255, 255, 0.1); border-radius: 5px; overflow: hidden; }
.skill-level { height: 100%; background-color: var(--accent-color); border-radius: 5px; width: 0; transform-origin: right; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.skill-card.visible .skill-level { width: var(--skill-percent); }
.skill-percent { font-size: 1rem; font-weight: 700; color: var(--accent-color); font-family: 'Poppins', sans-serif; }

/* --- تعديل: قسم العروض --- */
.offer-card { background: linear-gradient(45deg, rgba(0, 170, 255, 0.15), rgba(0, 170, 255, 0.05)); border: 1px solid var(--accent-color); border-radius: 20px; padding: 40px; text-align: center; position: relative; overflow: hidden; backdrop-filter: blur(15px); }
.offer-badge { position: absolute; top: -1px; right: 20px; background-color: var(--accent-color); color: var(--bg-color); padding: 5px 15px; border-radius: 0 0 10px 10px; font-weight: 700; }
html[dir="ltr"] .offer-badge { right: auto; left: 20px; }
.offer-card h3 { font-size: 1.8rem; margin-bottom: 15px; }
.offer-card p { max-width: 600px; margin: 0 auto 25px auto; }
.offer-price { margin-bottom: 30px; }
.new-price { font-size: 2.5rem; font-weight: 700; color: #fff; margin-left: 15px; }
.old-price { font-size: 1.5rem; color: var(--secondary-text-color); text-decoration: line-through; }
.offer-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 800px; margin: 30px auto; }
.offer-feature-item { background-color: var(--card-bg); border-radius: 10px; padding: 20px; text-align: center; }
.offer-feature-item i { font-size: 2rem; color: var(--accent-color); margin-bottom: 10px; }
.offer-feature-item span { display: block; font-size: 1rem; }

/* --- قسم المشاريع (الرئيسية) - Carousel Design --- */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    perspective: 1500px;
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-carousel-item {
    position: absolute;
    width: 350px;
    height: 450px;
    background: rgba(26, 26, 30, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

/* البطاقة في المنتصف */
.project-carousel-item.active {
    transform: translateX(0) scale(1) translateZ(0);
    z-index: 3;
    opacity: 1;
    filter: brightness(1);
}

/* البطاقة على اليمين */
.project-carousel-item.next {
    transform: translateX(280px) scale(0.85) translateZ(-100px);
    z-index: 2;
    opacity: 0.6;
    filter: brightness(0.7);
}

/* البطاقة على اليسار */
.project-carousel-item.prev {
    transform: translateX(-280px) scale(0.85) translateZ(-100px);
    z-index: 2;
    opacity: 0.6;
    filter: brightness(0.7);
}

/* البطاقات المخفية */
.project-carousel-item.hidden {
    transform: translateX(0) scale(0.5);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.project-carousel-item:hover.active {
    transform: translateX(0) scale(1.02) translateZ(0);
    box-shadow: 0 12px 40px rgba(0, 170, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-carousel-item .project-image {
    width: 100%;
    max-width: 180px;
    margin-bottom: 25px;
}

.project-carousel-item .project-image img {
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
}

.project-carousel-item .project-text {
    width: 100%;
}

.project-carousel-item .project-text h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Arial', sans-serif;
    letter-spacing: 1px;
}

.project-carousel-item .project-text .btn-primary {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 170, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.4);
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(0, 170, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.carousel-prev {
    right: 10px;
}

.carousel-next {
    left: 10px;
}

html[dir="ltr"] .carousel-prev {
    right: auto;
    left: 10px;
}

html[dir="ltr"] .carousel-next {
    left: auto;
    right: 10px;
}

.all-projects-btn { 
    display: table; 
    margin: 40px auto 0 auto; 
}

.projects-section {
    overflow-x: hidden;
}

/* تصميم المشاريع المفصل في صفحة projects.html */
.projects-page-section {
    padding-top: 100px;
    border-bottom: none;
}
.projects-page-section .section-title {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}
.projects-list { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 40px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.projects-list .project-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between;
    text-align: center; 
    background-color: var(--card-bg); 
    border: var(--glass-border); 
    border-radius: 25px; 
    padding: 25px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    backdrop-filter: blur(15px);
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    position: relative;
    margin-bottom: 0;
}
.projects-list .project-item:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 25px var(--accent-glow); 
}

.project-image { 
    width: 100%; 
    max-width: 100px; 
    margin-bottom: 15px; 
    flex-shrink: 0; 
}
.project-image img { 
    width: 100%; 
    height: auto; 
    display: block; 
    border-radius: 0;
    box-shadow: none;
}
.project-text { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    gap: 10px;
}
.project-text h3 { 
    font-size: 1.3rem; 
    color: #fff; 
    margin: 0;
}
.project-title-en { 
    font-family: 'Arial', sans-serif; 
    letter-spacing: 1px; 
}
.project-desc { 
    color: var(--secondary-text-color); 
    font-size: 0.85rem; 
    line-height: 1.4; 
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.projects-list .project-item .project-text .btn-primary { 
    position: static;
    transform: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-top: auto;
}
.project-text .btn-primary i { 
    margin-right: 8px; 
}

/* --- قسم تواصل معي --- */
.contact-section { border-bottom: none; min-height: 50vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.contact-section .section-subtitle {
    margin-bottom: 20px;
}
.social-links { margin-top: 30px; display: flex; gap: 40px; align-items: center; }
.social-links a { color: var(--accent-color); font-size: 2.5rem; transition: color 0.3s, transform 0.3s, text-shadow 0.3s; display: inline-block; text-decoration: none; text-shadow: 0 0 8px rgba(0, 170, 255, 0.5); }
.social-links a:hover { color: #fff; transform: translateY(-8px) scale(1.1); text-shadow: 0 0 15px #fff, 0 0 25px #fff; }



/* --- الفوتر (Footer) --- */
.main-footer { text-align: center; padding: 30px; margin-top: 40px; border-top: var(--glass-border); color: var(--secondary-text-color); }

/* --- Responsive Design (للهواتف) --- */
@media (max-width: 768px) {
    .container { padding: 10px; }
    section { padding: 30px 0; }
    .navbar { padding: 5px 10px; }
    .nav-menu { display: none; }
    .nav-start { order: 1; }
    .nav-end { order: 2; }
    html[dir="ltr"] .nav-start { order: 2; }
    html[dir="ltr"] .nav-end { order: 1; }

    .hero-content h1 { font-size: clamp(1.5rem, 7vw, 2rem); white-space: normal; line-height: 1.3; }
    .hero-content p { font-size: 0.9rem; }
    .btn-primary { padding: 10px 25px; font-size: 0.9rem; }

    .section-title { font-size: 1.5rem; margin-bottom: 20px; }
    p { font-size: 0.9rem; }

    .about-content { gap: 30px; }
    .about-image { height: auto; max-width: 90%; flex-basis: auto; }
    .about-text { text-align: center; }
    .about-text h3 { font-size: 1.5rem; }

    .projects-grid { 
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 0 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .projects-grid::-webkit-scrollbar { 
        display: none; /* Safari and Chrome */
    }
    .project-card { 
        aspect-ratio: 1 / 1; 
    }

    /* تصميم صفحة المشاريع للهواتف */
    .projects-list { 
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .projects-list .project-item { 
        padding: 10px;
        min-height: auto;
        max-height: none;
        border-radius: 10px;
        aspect-ratio: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: visible;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-bottom: 0;
    }
    .project-image { 
        max-width: 55px;
        margin-bottom: 5px;
        width: 100%;
        flex-shrink: 0;
    }
    .project-image img {
        border-radius: 6px;
        width: 100%;
        height: auto;
    }
    .project-text {
        gap: 3px;
        width: 100%;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    .project-text h3 {
        font-size: 0.75rem;
        line-height: 1.1;
        word-wrap: break-word;
        margin-bottom: 3px;
    }
    .project-desc {
        font-size: 0.55rem;
        line-height: 1.1;
        word-wrap: break-word;
        margin-bottom: 5px;
        flex-grow: 0;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        max-height: 1.2em;
    }
    .projects-list .project-item {
        margin-bottom: 0;
    }

    .projects-list .project-item .project-text .btn-primary {
        position: static;
        transform: none;
        padding: 4px 8px;
        font-size: 0.55rem;
        white-space: nowrap;
        display: inline-block;
        width: fit-content;
        margin-top: 5px;
    }
    
    .skills-grid, .features-grid { grid-template-columns: 1fr; }
    
    /* تصغير بطاقة العرض على الهواتف */
    .offer-card { 
        padding: 20px; 
        margin: 0 10px;
    }
    .offer-card h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    .offer-card p {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    .offer-features-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 20px auto;
    }
    .offer-feature-item {
        padding: 12px;
    }
    .offer-feature-item i {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    .offer-feature-item span {
        font-size: 0.8rem;
    }
    .offer-price {
        margin-bottom: 20px;
    }
    .new-price {
        font-size: 1.8rem;
        margin-left: 10px;
    }
    .old-price {
        font-size: 1.1rem;
    }
    .offer-badge {
        font-size: 0.8rem;
        padding: 4px 12px;
    }
    
    .contact-section .section-subtitle {
        margin-bottom: 30px;
    }
    
    .social-links { gap: 30px; }
    .social-links a { font-size: 2rem; }

    /* تصميم Carousel للهواتف */
    .carousel-container {
        padding: 40px 10px;
        max-width: 100%;
        overflow: hidden;
    }

    .carousel-wrapper {
        height: 400px;
        overflow: hidden;
    }

    .project-carousel-item {
        width: 240px;
        height: 360px;
        padding: 20px;
    }

    .project-carousel-item.next {
        transform: translateX(150px) scale(0.75) translateZ(-80px);
    }

    .project-carousel-item.prev {
        transform: translateX(-150px) scale(0.75) translateZ(-80px);
    }

    .project-carousel-item .project-image {
        max-width: 140px;
        margin-bottom: 20px;
    }

    .project-carousel-item .project-text h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .project-carousel-item .project-text .btn-primary {
        position: static;
        transform: none;
    }

    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
        background: rgba(0, 170, 255, 0.3);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 170, 255, 0.5);
        color: var(--accent-color);
        z-index: 100;
    }

    .carousel-btn:hover {
        background: rgba(0, 170, 255, 0.5);
    }

    .carousel-prev {
        right: 5px;
    }

    .carousel-next {
        left: 5px;
    }
}

/* --- CSS للأنيميشن عند التمرير (Scroll) --- */
.about-content, .skill-card, .offer-card, .social-links, .section-title, .projects-grid, .project-item, .feature-card { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.about-content.visible, .skill-card.visible, .offer-card.visible, .social-links.visible, .section-title.visible, .projects-grid.visible, .project-item.visible, .feature-card.visible { opacity: 1; transform: translateY(0); }
.skill-card:nth-child(1), .project-card:nth-child(1), .feature-card:nth-child(1) { transition-delay: 0.1s; }
.skill-card:nth-child(2), .project-card:nth-child(2), .feature-card:nth-child(2) { transition-delay: 0.2s; }
.skill-card:nth-child(3), .project-card:nth-child(3), .feature-card:nth-child(3) { transition-delay: 0.3s; }
.skill-card:nth-child(4), .feature-card:nth-child(4) { transition-delay: 0.4s; }
.projects-list .project-item:nth-child(1) { transition-delay: 0.1s; }
.projects-list .project-item:nth-child(2) { transition-delay: 0.2s; }
.projects-list .project-item:nth-child(3) { transition-delay: 0.3s; }