:root {
    --primary-color: #0d233a;
    --secondary-color: #d4af37;
    --accent-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --animation-curve: cubic-bezier(0.25, 1, 0.5, 1);
    --animation-duration: 0.9s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--white);
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }

.container {
    width: 90%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 15px;
}

.section-padding {
    padding-block: 100px;
}

/* ==========================================================================
   محرك التحريكات المودرن المطور (تم تأخير استجابته لمنتصف الشاشة ليصبح أوضح)
   ========================================================================== */
.anim-fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity var(--animation-duration) var(--animation-curve), 
                transform var(--animation-duration) var(--animation-curve);
}

.anim-fade-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity var(--animation-duration) var(--animation-curve), 
                transform var(--animation-duration) var(--animation-curve);
}

.anim-fade-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity var(--animation-duration) var(--animation-curve), 
                transform var(--animation-duration) var(--animation-curve);
}

.anim-zoom-in {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: opacity var(--animation-duration) var(--animation-curve), 
                transform var(--animation-duration) var(--animation-curve);
}

.anim-fade-up.is-visible,
.anim-fade-left.is-visible,
.anim-fade-right.is-visible {
    opacity: 1;
    transform: translate(0);
}

.anim-zoom-in.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* التتابع الزمني التلقائي لبطاقات الخدمات والسابقة */
.services-grid .service-card:nth-child(2) { transition-delay: 0.15s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.3s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.45s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.6s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.75s; }

.section-title {
    text-align: center;
    margin-bottom: 60px;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    margin-block-start: 12px;
    margin-inline: auto;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn:hover {
    transform: translateY(-3px);
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    box-shadow: none;
}

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

header {
    background-color: rgba(13, 35, 58, 0.96);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: 18px;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.logo-main span { color: var(--secondary-color); }
.logo-sub { font-size: 0.7rem; color: #94a3b8; letter-spacing: 1.5px; }

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links { display: flex; }
.nav-links li a {
    color: #e2e8f0;
    padding-block: 8px;
    padding-inline: 15px;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.nav-links li a:hover, .nav-links li a.active { color: var(--secondary-color); }

.lang-toggle-btn {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.lang-toggle-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.menu-btn {
    display: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
}

/* الهيرو */
.hero {
    height: 100vh;
    background: url('images/hero.webp') no-repeat center center/cover;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
    position: relative;
}

.hero-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 35, 58, 0.96), rgba(13, 35, 58, 0.75));
    z-index: 1;
}

.hero-content { max-width: 850px; margin-inline: auto; position: relative; z-index: 2; }
.hero-content h1 {
    font-size: 3.5rem; margin-bottom: 25px; font-weight: 700;
    animation: fadeDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-content p {
    font-size: 1.3rem; margin-bottom: 40px; color: #cbd5e1;
    animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s;
    opacity: 0;
}
.hero-buttons { animation: zoomInFast 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.6s; opacity: 0; }
.hero-buttons .btn { margin-inline: 10px; }

@keyframes fadeDown { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes zoomInFast { to { opacity: 1; transform: scale(1); } }

/* من نحن */
.about-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}
.about-text h3 { font-size: 2rem; color: var(--primary-color); margin-bottom: 20px; }
.about-text p { margin-bottom: 25px; font-size: 1.1rem; text-align: justify; }
.v-box { background-color: var(--light-bg); padding: 30px; border-inline-start: 5px solid var(--secondary-color); border-radius: 8px; }
.v-box h4 { color: var(--primary-color); margin-bottom: 12px; font-size: 1.3rem; }
.v-box h4 i { color: var(--secondary-color); margin-inline-end: 8px; }
.about-img img { border-radius: 12px; box-shadow: 0 20px 40px rgba(13,35,58,0.12); }

/* الخدمات */
.services { background-color: var(--light-bg); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.service-card {
    background-color: var(--white); padding: 45px 30px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); transition: var(--transition-smooth);
    border-bottom: 4px solid transparent; text-align: center;
}
.service-card:hover { transform: translateY(-10px); border-bottom-color: var(--secondary-color); box-shadow: 0 20px 40px rgba(13,35,58,0.06); }
.service-card i { font-size: 3rem; color: var(--primary-color); margin-bottom: 25px; }
.service-card h3 { font-size: 1.35rem; margin-bottom: 15px; color: var(--primary-color); }

/* الإحصائيات */
.stats { background-color: var(--primary-color); color: var(--white); text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; }
.stat-number { font-size: 3.5rem; font-weight: 700; color: var(--secondary-color); margin-bottom: 10px; }
.stat-label { font-size: 1rem; color: #94a3b8; }

/* معرض الأعمال (تم حذف تنسيقات التبويبات والاحتفاظ بالشبكة) */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 35px; }
.portfolio-item { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.04); border: 1px solid #e2e8f0; }
.portfolio-img-wrapper { position: relative; height: 240px; overflow: hidden; background-color: #000; cursor: pointer; }
.portfolio-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition-smooth); }
.portfolio-item:hover .portfolio-img-wrapper img { transform: scale(1.08); opacity: 0.85; }
.portfolio-zoom { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5); color: var(--white); font-size: 2rem; opacity: 0; transition: var(--transition-smooth); }
.portfolio-item:hover .portfolio-zoom { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.portfolio-info { padding: 22px 20px; background: var(--white); border-top: 1px solid #f1f5f9; text-align: start; }
.portfolio-info h4 { font-size: 1.2rem; color: var(--primary-color); margin-bottom: 6px; }
.portfolio-info p { font-size: 0.9rem; color: var(--text-muted); }

/* الـ Lightbox المنبثق التفاعلي */
.lightbox { display: none; position: fixed; z-index: 2000; inset: 0; background-color: rgba(13, 35, 58, 0.98); align-items: center; justify-content: center; }
.lightbox-content-wrapper { max-width: 80%; max-height: 80%; text-align: center; }
.lightbox-img { max-width: 100%; max-height: 65vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.lightbox-caption { margin-top: 20px; color: var(--white); font-size: 1.25rem; }
.close-lightbox { position: absolute; top: 30px; right: 40px; color: #94a3b8; font-size: 2.5rem; cursor: pointer; }
.lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.05); border: none; color: var(--white); font-size: 2rem; padding: 20px 25px; cursor: pointer; border-radius: 8px; transition: var(--transition-smooth); }
.lightbox-arrow:hover { background: var(--secondary-color); color: var(--primary-color); }
html[dir="ltr"] .prev-arrow { left: 40px; } html[dir="ltr"] .next-arrow { right: 40px; }
html[dir="rtl"] .prev-arrow { right: 40px; } html[dir="rtl"] .next-arrow { left: 40px; }

/* عملائنا والمميزات */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 25px; }
.client-box { background: var(--white); padding: 25px; border-radius: 10px; font-weight: 600; color: var(--primary-color); border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 90px; }
.features { background: linear-gradient(180deg, var(--white), var(--light-bg)); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: var(--white); padding: 40px 30px; border-radius: 12px; border: 1px solid #e2e8f0; transition: var(--transition-smooth); }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(13,35,58,0.08); }
.feature-icon { width: 60px; height: 60px; background-color: rgba(212, 175, 55, 0.1); color: var(--secondary-color); font-size: 1.6rem; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 25px; }
.feature-card h3 { color: var(--primary-color); font-size: 1.3rem; margin-bottom: 15px; }

/* التواصل */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info-card { background-color: var(--primary-color); color: var(--white); padding: 50px 40px; border-radius: 16px; }
.contact-info-card h3, .contact-actions-card h3 { margin-bottom: 30px; font-size: 1.6rem; font-weight: 600; }
.contact-info-card h3 { color: var(--secondary-color); }
.info-item { display: flex; align-items: flex-start; margin-bottom: 30px; }
.info-item i { font-size: 1.4rem; color: var(--secondary-color); margin-inline-end: 20px; margin-top: 4px; }
.info-item p { font-size: 1.05rem; color: #cbd5e1; }
.clickable-email { color: var(--secondary-color); text-decoration: underline; transition: var(--transition-smooth); }
.clickable-email:hover { color: var(--white); }
.contact-actions-card { background-color: var(--light-bg); padding: 50px 40px; border-radius: 16px; border: 1px solid #e2e8f0; }
.contact-actions-card p { margin-bottom: 30px; }
.action-buttons { display: flex; flex-direction: column; gap: 15px; }
.action-btn { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-radius: 10px; font-size: 1.1rem; font-weight: 600; transition: var(--transition-smooth); color: var(--white); }
.call-btn { background-color: var(--primary-color); }
.call-btn:hover { background-color: #1a3a5c; transform: translateY(-2px); }
.whatsapp-btn { background-color: #25d366; }
.whatsapp-btn:hover { background-color: #20ba5a; transform: translateY(-2px); }

/* الفوتر (تم حل مشكلة التصاق السوشيال ميديا بالسطر العلوي) */
footer { background-color: #06121f; color: #94a3b8; padding-block: 80px 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 50px; margin-bottom: 50px; }
.footer-about h3 { color: var(--white); margin-bottom: 20px; font-size: 1.5rem; }
.footer-about p { margin-bottom: 0; }

/* إضافة مسافة علوية وسفلية صريحة ومريحة لأيقونات السوشيال ميديا */
.social-icons {
    margin-block: 25px;
}

.social-icons a { display: inline-block; width: 42px; height: 42px; background-color: #0d233a; color: var(--white); text-align: center; line-height: 42px; border-radius: 50%; margin-inline-end: 12px; transition: var(--transition-smooth); }
.social-icons a:hover { background-color: var(--secondary-color); color: var(--primary-color); transform: translateY(-3px); }
.footer-links h4 { color: var(--white); margin-bottom: 25px; font-size: 1.15rem; }
.footer-links li { margin-bottom: 14px; }
.footer-links li a:hover { color: var(--secondary-color); }
.legal-info { font-size: 0.88rem; color: #475569; margin-top: 20px; line-height: 1.6; }
.footer-bottom { text-align: center; padding-top: 25px; border-top: 1px solid #1e293b; }

/* ==========================================================================
   الوسائط التفاعلية وإصلاح الأيباد والموبايل
   ========================================================================== */
@media (max-width: 1199px) {
    .hero-content h1 { font-size: 3rem; }
}

@media (max-width: 992px) {
    .menu-btn { display: block; z-index: 1010; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    
    .nav-wrapper {
        position: fixed;
        top: 0;
        inset-inline-start: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--primary-color);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 30px 40px 30px;
        transition: var(--transition-smooth);
        gap: 35px;
        box-shadow: 5px 0 30px rgba(0,0,0,0.2);
        z-index: 1005;
        align-items: flex-start;
    }
    
    .nav-wrapper.active { 
        inset-inline-start: 0; 
    }
    
    .nav-links { flex-direction: column; width: 100%; }
    .nav-links li { margin-block: 10px; width: 100%; }
    .nav-links li a { display: block; width: 100%; padding: 10px 0; font-size: 1.15rem; }
    
    .about-wrapper, .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .footer-grid { grid-template-columns: 1fr; gap: 35px; }
    .section-padding { padding-block: 80px; }
}

@media (max-width: 600px) {
    .hero-content h1 { font-size: 2.1rem; }
    .hero-content p { font-size: 1.05rem; }
    .hero-buttons .btn { margin: 8px 10px; display: block; }
    .services-grid, .portfolio-grid, .features-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.9rem; }
    .contact-info-card, .contact-actions-card { padding: 35px 20px; }
    .lightbox-arrow { padding: 12px 15px; font-size: 1.3rem; }
}