/* ==================================================================
   DIIB — Optimized Stylesheet
   نفس الشكل والأداء تماماً، بدون تكرار:
   - كل @keyframes معرّف مرة واحدة فقط
   - Media queries المكررة اندمجت (مع الحفاظ على قيم الـ cascade النهائية)
   - القيم المتكررة (تدرجات الأحمر) صارت CSS variables
   ================================================================== */

:root {
    --section-gradient: linear-gradient(180deg, #000000 0%, #000000 75%, #232425 100%);
    --grad-red: linear-gradient(135deg, #8f2018, #740e0e);
    --grad-red-dark: linear-gradient(135deg, #802020, #4e0d0d);
    --grad-red-tri: linear-gradient(135deg, #8c2d2d, #973333, #e74c3c);
}

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

body {
    padding-top: 70px;
    font-family: Arial, Helvetica, sans-serif;
    background: #000000;
    color: #ffffff;
}

/* (كان معرّف 3 مرات — اندمجوا بقاعدة وحدة بنفس النتيجة النهائية) */
.container {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ==== Header ==== */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideDown 0.8s ease-out;
    /* Header follows page direction: Arabic = logo right, language
       button left; English = logo left, language button right. */
}

header.scrolled .nav-link { color: #000000 !important; }
header.scrolled .menu-toggle span { background: #000000 !important; }

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.logo-container:hover { transform: scale(1.05); }

.logo-main {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000000;
    transition: all 0.3s ease;
}
.logo-container:hover .logo-main {
    border-color: #000000;
    box-shadow: 0 0 20px rgb(0, 0, 0);
}

.header-actions { display: flex; align-items: center; gap: 20px; }

.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    padding: 6px 14px;
    color: #000000;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.lang-toggle-btn:hover { background: rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.lang-toggle-btn svg { width: 18px; height: 18px; }

.main-nav ul { list-style: none; display: flex; gap: 5px; margin: 0; padding: 0; }

.nav-link {
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: #000000 !important;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #000000, #000000);
    transition: width 0.3s ease;
}
.nav-link:hover::before, .nav-link.active::before { width: 60%; }
.nav-link:hover { color: #000000; background: rgb(124, 124, 128); }
.nav-link.active { color: #000000 !important; background: #d3d3d3; }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}
.menu-toggle span {
    width: 28px;
    height: 3px;
    background: #2c3e50;
    border-radius: 3px;
    transition: all 0.3s ease;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(8px, -8px); }

@media (max-width: 768px) {
    header { padding: 15px 4%; }
    .header-actions { gap: 12px; }
    .lang-toggle-btn { padding: 5px 10px; font-size: 12px; }
    .menu-toggle { display: flex; }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 100px 30px 30px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.4s ease;
    }
    .main-nav.active { right: 0; }
    .main-nav ul { flex-direction: column; gap: 10px; }
    .nav-link { width: 100%; text-align: center; padding: 15px 20px; font-size: 18px; }
    .logo-main { width: 40px; height: 40px; }
}

/* ==== Hero Section ==== */
.hero-section {
    min-height: 100vh;
    background: var(--section-gradient);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 100px 5% 80px;
    direction: rtl;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content { animation: fadeInUp 1s ease-out; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 50px;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 30px;
    animation: slideInRight 1s ease-out 0.2s backwards;
}
.badge-icon { font-size: 16px; }

.hero-title {
    font-size: 60px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #ffffff !important;
}

.title-line { display: block; animation: slideInRight 1s ease-out backwards; }
.title-line:nth-child(1) { animation-delay: 0.3s; }
.title-line:nth-child(2) { animation-delay: 0.5s; }

.gradient-text {
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 25px;
    line-height: 1.8;
    color: #ffffff;
    margin-bottom: 40px;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 0.7s backwards;
}

/* CTA Buttons */
.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 60px;
    animation: fadeInUp 1s ease-out 0.9s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary { background: #ffffff !important; color: #000000 !important; }
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(71, 72, 73, 0.5);
}
.btn-primary svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.btn-primary:hover svg { transform: translateX(-5px); }

.btn-secondary {
    background: #25D366 !important;
    border: 2px solid #2ecc71 !important;
    color: #ffffff;
}
.btn-secondary:hover { background: #2ecc71; color: white; transform: translateY(-3px); }
.btn-secondary svg { width: 20px; height: 20px; }

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 30px;
    animation: fadeInUp 1s ease-out 1.1s backwards;
}
.stat-item { text-align: center; }
.stat-number {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #4a90e2, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.stat-label { font-size: 14px; color: #94a3b8; }
.stat-divider { width: 1px; height: 50px; background: rgba(148, 163, 184, 0.2); }

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
    animation: fadeIn 1s ease-out 0.5s backwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* Hero Circle - الدائرة في النص */
.hero-img img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 3s infinite;
    margin-bottom: 20px;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: #ffffff; }
    50% { box-shadow: #ffffff; }
}

/* Visual Cards */
.hero-visual-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.visual-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.8s ease-out backwards;
}
.visual-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 60px rgba(74, 144, 226, 0.4);
}

.card-1 { animation-delay: 0.3s; }
.card-2 { animation-delay: 0.5s; }
.card-3 { animation-delay: 0.7s; }

.card-icon { font-size: 28px; flex-shrink: 0; }
.visual-card h4 {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    margin: 0;
}

/* Scroll Indicator - اسحب لتحت */
.scroll-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: fadeIn 1s ease-out 1.5s backwards;
}
.scroll-indicator p { font-size: 12px; color: #94a3b8; }

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(148, 163, 184, 0.5);
    border-radius: 20px;
    margin: 0 auto 10px;
    position: relative;
}
.wheel {
    width: 4px;
    height: 10px;
    background: #4a90e2;
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

/* Hero Responsive
   (كان في بلوكين 1024 وبلوكين 768 شبه متطابقين — اندمجوا هون
    بالقيم النهائية اللي كانت فعلياً مطبّقة حسب ترتيب الـ cascade) */
@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; gap: 60px; }
    .hero-visual { height: 400px; }
    .hero-title { font-size: 48px; }
    .scroll-indicator { display: none; }
}

@media (max-width: 768px) {
    .hero-section { padding: 100px 5% 60px; }
    .hero-title { font-size: 36px; }
    .hero-description { font-size: 16px; }
    .hero-buttons { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    .hero-stats { flex-wrap: wrap; gap: 20px; margin-bottom: 40px; }
    .stat-divider, .hero-visual, .scroll-indicator { display: none; }
}

/* ==== Shared Animations (كل واحدة معرفة مرة واحدة فقط) ==== */
@keyframes scroll {
    0% { top: 8px; opacity: 1; }
    100% { top: 28px; opacity: 0; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==== Services Section ==== */
.services-section {
    padding: 100px 5%;
    background: var(--section-gradient);
    min-height: 100vh;
    direction: rtl;
    position: relative;
    overflow: hidden;
}

.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(53, 122, 189, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
    animation: fadeInUp 1s ease-out;
}

.section-title {
    font-size: 52px;
    font-weight: 700;
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    background: var(--grad-red-tri);
    border-radius: 3px;
}

.section-subtitle {
    font-size: 20px;
    color: #ffffff;
    margin-top: 20px;
    font-weight: 500;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
    margin-top: 50px;
}

.service-card {
    background: #1a1a1a;
    padding: 45px 35px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out backwards;
}
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* Gradient Border Effect */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--grad-red-tri);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 20px;
    z-index: -1;
}
.service-card::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    bottom: 2px;
    left: 2px;
    background: #1a1a1a;
    border-radius: 18px;
    z-index: -1;
}
.service-card:hover::before { opacity: 1; }

/* (كان في قاعدتين hover منفصلتين — اندمجوا) */
.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 60px rgba(150, 68, 68, 0.977);
    animation: glow 2s ease-in-out infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 20px 60px rgba(234, 27, 27, 0.4); }
    to { box-shadow: 0 20px 60px rgba(120, 35, 35, 0.4); }
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--grad-red-dark);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px rgba(147, 10, 10, 0.3);
    position: relative;
}
.service-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--grad-red);
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.service-card:hover .service-icon::before { opacity: 1; }
.service-icon svg { width: 40px; height: 40px; color: white; position: relative; z-index: 1; }
.service-card:hover .service-icon {
    transform: rotateY(360deg) scale(1.1);
    box-shadow: 0 10px 25px rgb(202, 87, 87);
}

.service-title {
    font-size: 26px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 18px;
    transition: color 0.3s ease;
}
.service-card:hover .service-title {
    background: linear-gradient(135deg, #ffffff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.service-description {
    font-size: 15px;
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 25px;
}

.service-features { list-style: none; padding: 0; margin: 0; }
.service-features li {
    font-size: 14px;
    color: #cbd5e1;
    padding: 10px 0;
    padding-right: 30px;
    position: relative;
    transition: all 0.3s ease;
}
.service-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    width: 22px;
    height: 22px;
    background: var(--grad-red-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(153, 57, 57, 0.927);
}
.service-card:hover .service-features li { color: #f1f5f9; padding-right: 35px; }

@media (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}
@media (max-width: 768px) {
    .services-section { padding: 60px 4%; }
    .section-title { font-size: 38px; }
    .section-subtitle { font-size: 16px; }
    .services-grid { grid-template-columns: 1fr; gap: 25px; }
    .service-card { padding: 35px 28px; }
}

/* ==== WhatsApp Float Button ==== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(48, 123, 76, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.6);
}
.whatsapp-float svg { width: 32px; height: 32px; color: white; }

.whatsapp-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ==== Scroll to Top Button ==== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--grad-red);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(234, 58, 39, 0.845);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(243, 43, 43, 0.841);
}
.scroll-top svg { width: 24px; height: 24px; color: white; }

/* ==== Loading Screen ==== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--grad-red);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.hidden { opacity: 0; visibility: hidden; }

.loader { text-align: center; }
.loader-circle {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #e24a4a, #cc2e2e);
    border-radius: 50%;
    display: inline-block;
    margin: 0 8px;
    animation: loading 1.4s infinite ease-in-out both;
}
.loader-circle:nth-child(1) { animation-delay: -0.32s; }
.loader-circle:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.loader-text {
    color: #ffffff;
    font-size: 18px;
    margin-top: 30px;
    font-weight: 300;
    animation: fadeInOut 1.5s infinite;
}
@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    .whatsapp-float { width: 55px; height: 55px; bottom: 20px; left: 20px; }
    .whatsapp-float svg { width: 28px; height: 28px; }
    .scroll-top { width: 45px; height: 45px; bottom: 20px; right: 20px; }
    .scroll-top svg { width: 20px; height: 20px; }
}

/* ==== Portfolio Section ==== */
.portfolio-section {
    padding: 100px 5%;
    background: var(--section-gradient);
    position: relative;
    overflow: hidden;
    direction: rtl;
}

.portfolio-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 50px 0;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.filter-btn {
    padding: 12px 30px;
    background: rgba(115, 115, 116, 0.497);
    border: 1px solid rgba(247, 247, 247, 0.2);
    border-radius: 50px;
    color: #c6c9cf;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.filter-btn:hover {
    background: rgba(72, 74, 77, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}
.filter-btn.active {
    background: var(--grad-red);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 25px rgba(226, 74, 74, 0.4);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.portfolio-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out backwards;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

.portfolio-image {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 20px;
}
.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.portfolio-item:hover .portfolio-image img { transform: scale(1.1); }

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(112, 123, 136, 0.95), rgba(104, 125, 112, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-content {
    text-align: center;
    padding: 30px;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}
.portfolio-item:hover .portfolio-content { transform: translateY(0); }

.portfolio-title { font-size: 24px; font-weight: 600; color: white; margin-bottom: 10px; }
.portfolio-category { font-size: 14px; color: rgba(255, 255, 255, 0.8); margin-bottom: 20px; }

.portfolio-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.portfolio-link svg { width: 20px; height: 20px; color: #4a90e2; }
.portfolio-link:hover {
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

.portfolio-cta {
    text-align: center;
    margin-top: 60px;
    animation: fadeInUp 1s ease-out 0.8s backwards;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(145deg, rgba(67, 65, 65, 0.8), rgb(49, 50, 53));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
}
.load-more-btn:hover {
    background: linear-gradient(135deg, #101317, #171616);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(130, 115, 115, 0.4);
}
.load-more-btn svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.load-more-btn:hover svg { transform: translateY(3px); }

@media (max-width: 768px) {
    .portfolio-section { padding: 60px 4%; }
    .portfolio-grid { grid-template-columns: 1fr; gap: 25px; }
    .portfolio-image { height: 280px; }
    .portfolio-filters { gap: 10px; }
    .filter-btn { padding: 10px 20px; font-size: 14px; }
    .load-more-btn { width: 100%; justify-content: center; }
}

/* ==== Contact Section ==== */
.contact-section {
    padding: 100px 5%;
    background: var(--section-gradient);
    position: relative;
    overflow: hidden;
    direction: rtl;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.contact-info { display: flex; flex-direction: column; gap: 25px; }

.info-card {
    background: #1a1a1a;
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(97, 98, 99, 0.2);
    transition: all 0.4s ease;
    animation: fadeInRight 0.8s ease-out backwards;
}
.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }
.info-card:hover {
    transform: translateX(-10px);
    border-color: rgb(84, 84, 85);
    box-shadow: 0 10px 40px rgb(84, 84, 85);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--grad-red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.4s ease;
}
.info-card:hover .info-icon {
    box-shadow: 0 10px 25px rgb(202, 87, 87);
    transform: rotateY(360deg);
}
.info-icon svg { width: 28px; height: 28px; color: white; }

.info-card h3 { font-size: 20px; font-weight: 600; color: #f1f5f9; margin-bottom: 10px; }
.info-card p { font-size: 15px; color: #ffffff; line-height: 1.6; }

/* File Upload */
.file-upload-wrapper { margin-top: 15px; }

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 110px;
    background: #8f2018;
    color: #000000;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}
.file-upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 60, 60, 0.4);
}
.file-upload-btn i { font-size: 20px; }

.file-name { margin-top: 12px; font-size: 14px; color: #666; font-weight: 500; }
.file-hint { margin-top: 8px; font-size: 12px; color: #999; }
.file-selected { color: #25D366 !important; font-weight: 600; }

/* Contact Form */
.contact-form-wrapper {
    background: #1a1a1a;
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #333;
    animation: fadeInLeft 0.8s ease-out 0.2s backwards;
}

.contact-form { display: flex; flex-direction: column; gap: 25px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 10px; }
.form-group label { font-size: 15px; font-weight: 500; color: #f1f5f9; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 18px;
    background: rgb(255, 255, 255);
    border: 1px solid rgba(69, 76, 83, 0.2);
    border-radius: 10px;
    color: #000000;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    direction: rtl;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 62, 64, 0.79);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select { cursor: pointer; }

/* File Upload inside contact form */
.file-upload-group .file-upload-wrapper {
    margin-top: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
}
.file-upload-group .file-name,
.file-upload-group .file-hint { margin-top: 0; flex-basis: 100%; }

/* Submit Button */
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 40px;
    background: #dcd9d9;
    border: none;
    border-radius: 50px;
    color: rgb(0, 0, 0);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgb(47, 47, 48);
    position: relative;
    overflow: hidden;
}
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}
.submit-btn:hover::before { left: 100%; }
.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgb(120, 122, 123);
}
.submit-btn svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.submit-btn:hover svg { transform: translateX(-5px); }

/* Form Message */
.form-message {
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: slideDown 0.4s ease;
}
.form-message.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
    display: block;
}
.form-message.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
    display: block;
}

@media (max-width: 968px) {
    .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .form-row { grid-template-columns: 1fr; }
    .contact-form-wrapper { padding: 30px 25px; }
}
@media (max-width: 768px) {
    .contact-section { padding: 60px 4%; }
}

/* ==== Footer Section ==== */
.footer-section {
    background: #000000;
    padding: 50px 5% 22px;
    border-top: 1px solid #1a1a1a;
    direction: rtl;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: -11px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1a1a1a;
}

.footer-col { animation: fadeInUp 0.8s ease-out backwards; }
.footer-col:nth-child(1) { animation-delay: 0.1s; }
.footer-col:nth-child(2) { animation-delay: 0.2s; }
.footer-col:nth-child(3) { animation-delay: 0.3s; }
.footer-col:nth-child(4) { animation-delay: 0.4s; }

.footer-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.footer-logo-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.footer-logo h3 {
    font-size: 24px;
    font-weight: 700;
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    font-size: 15px;
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 25px;
}

.footer-social { display: flex; gap: 12px; }
.social-link {
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.social-link:hover {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    border-color: #FF0000;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.4);
}
.social-link svg { width: 18px; height: 18px; color: #94a3b8; transition: color 0.3s ease; }
.social-link:hover svg { color: white; }

.footer-title {
    font-size: 20px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #FF0000, transparent);
    border-radius: 2px;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a {
    color: #94a3b8;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}
.footer-links a:hover { color: #FF0000; padding-right: 8px; }

.footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}
.footer-contact svg {
    width: 20px;
    height: 20px;
    color: #FF0000;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-bottom p { color: #64748b; font-size: 14px; margin: 0; }
.footer-bottom-links { display: flex; align-items: center; gap: 15px; }
.footer-bottom-links a {
    color: #64748b;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-bottom-links a:hover { color: #FF0000; }
.footer-bottom-links span { color: #333; }

@media (max-width: 1024px) {
    .footer-top { grid-template-columns: repeat(2, 1fr); gap: 40px; }
}
@media (max-width: 768px) {
    .footer-section { padding: 60px 4% 25px; }
    .footer-top {
        grid-template-columns: 1fr;
        gap: 35px;
        margin-bottom: 35px;
        padding-bottom: 35px;
    }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-bottom-links { justify-content: center; }
}

/* ==================================================================
   English (LTR) Mode Overrides
   The layout is authored RTL-first: several sections hard-code
   `direction: rtl`. When the page is switched to English we set
   <body class="lang-en"> — these rules flip those sections to LTR
   and left-align their text so English content reads naturally.
   Grid column definitions are direction-agnostic and left untouched;
   the browser mirrors grid placement automatically with `direction`.
   ================================================================== */

body.lang-en .hero-container,
body.lang-en .services-section,
body.lang-en .portfolio-section,
body.lang-en .contact-section,
body.lang-en .footer-section {
    direction: ltr;
}

/* Form fields typed in English should read left-to-right */
body.lang-en .contact-form input,
body.lang-en .contact-form textarea,
body.lang-en .contact-form select {
    direction: ltr;
    text-align: left;
}

/* Left-align body copy that is otherwise right-aligned by RTL flow.
   Section headings remain centered (their own text-align: center wins). */
body.lang-en .hero-badge,
body.lang-en .hero-title,
body.lang-en .hero-description,
body.lang-en .service-title,
body.lang-en .service-description,
body.lang-en .service-features li,
body.lang-en .portfolio-content,
body.lang-en .info-card,
body.lang-en .contact-form label,
body.lang-en .footer-description,
body.lang-en .footer-col,
body.lang-en .footer-links li,
body.lang-en .footer-contact li {
    text-align: left;
}

/* Service feature bullets: keep marker on the left in English */
body.lang-en .service-features { padding-left: 0; }

/* Hero visual cards: English labels are longer than the Arabic ones,
   which pushed the 3rd card onto a second row. Tighten spacing and
   allow the label to shrink so all three stay on one row in English. */
body.lang-en .hero-visual-cards { gap: 12px; flex-wrap: nowrap; }
body.lang-en .visual-card { padding: 14px 16px; gap: 8px; }
body.lang-en .visual-card h4 { font-size: 14px; }
body.lang-en .card-icon { font-size: 24px; }

/* سياسة الخصوصية */
/* Privacy Modal */

.privacy-modal{
    display:none;
    position:fixed;
    z-index:99999;
    inset:0;
    background:rgba(0,0,0,.7);
    justify-content:center;
    align-items:center;
    padding:25px;
}

.privacy-content{
    width:100%;
    max-width:850px;
    max-height:85vh;
    overflow-y:auto;
    background:#fff;
    border-radius:18px;
    padding:40px;
    position:relative;
    animation:fadeUp .35s ease;
}

.privacy-content h2{
    color:#000;
    margin-bottom:20px;
}

.privacy-content h3{
    margin-top:25px;
    color:#111;
}

.privacy-content p,
.privacy-content li{
    color:#555;
    line-height:2;
}

.privacy-content ul{
    padding-right:20px;
}

.privacy-close{
    position:absolute;
    top:18px;
    left:20px;
    font-size:32px;
    cursor:pointer;
    font-weight:bold;
}

@keyframes fadeUp{

    from{
        opacity:0;
        transform:translateY(30px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }

}

/* ==== Hero: align the logo with the headline ==== */
.hero-container { align-items: start; }
.hero-visual { justify-content: flex-start; height: auto; padding-top: 90px; }
@media (max-width: 1024px) {
    .hero-visual { padding-top: 0; }
}

/* ==== Header: logo + menu together, language button at the far end ==== */
header { justify-content: flex-start; gap: 30px; }
.header-actions { display: contents; }
.lang-toggle-btn { margin-inline-start: auto; }
@media (max-width: 768px) {
    header { gap: 12px; }
}

/* Clickable service cards and contact links */
.service-card[data-filter] { cursor: pointer; }
.contact-link { color: inherit; text-decoration: none; unicode-bidi: isolate; }
.contact-link:hover { text-decoration: underline; }

/* ==== Hero headline, slogan and tagline under the logo ==== */
.hero-title { font-size: 48px; line-height: 1.35; }
.hero-slogan {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.7;
    color: #cfcfcf;
    margin: 0 0 40px;
}
.hero-tagline {
    text-align: center;
    font-size: 18px;
    line-height: 1.8;
    color: #ffffff;
    margin: -10px 0 0;
}
.hero-tagline span { display: block; }
@media (max-width: 1024px) {
    .hero-title { font-size: 40px; }
}
@media (max-width: 768px) {
    .hero-title { font-size: 30px; }
    .hero-slogan { font-size: 20px; margin-bottom: 30px; }
    .hero-visual { display: flex; height: auto; padding-top: 0; }
    .hero-img, .hero-visual-cards { display: none; }
    .hero-tagline { font-size: 16px; margin: 0; }
}

/* Footer title underline: solid at the start of the text, fading out */
.footer-title::after { background: linear-gradient(to left, #FF0000, transparent); }
body.lang-en .footer-title::after { right: auto; left: 0; background: linear-gradient(to right, #FF0000, transparent); }
