* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 1. متغيرات CSS لسهولة التعديل */
:root {
    --primary-color: #d73737;
    --primary-color-dark: #b91c1c;
    --dark-bg: #1a1a1a;
    --medium-dark-bg: #2a2a2a;
    --light-dark-bg: #333333;
    --text-color-light: #ccc;
    --text-color-medium: #999;
    --text-color-bright: #F8F8F8;
    --border-color-dark: #444;
}

body {
    font-family: 'Cairo', 'Amiri', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #F8F8F8;
    overflow-x: hidden;
    background-color: #1a1a1a;
    transition: all 0.3s ease;
    direction: rtl;
    padding-top: 80px; /* إضافة مساحة علوية لتجنب تداخل المحتوى مع الهيدر الثابت */    direction: rtl;
    text-align: right;
}

a {
    color: inherit;
    text-decoration: none !important;
}

/* الحركات والتأثيرات البصرية */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(215, 55, 55, 0.5);
        text-shadow: 0 0 10px rgba(215, 55, 55, 0.3);
    }
    50% { 
        box-shadow: 0 0 25px rgba(215, 55, 55, 0.8), 0 0 35px rgba(215, 55, 55, 0.6);
        text-shadow: 0 0 20px rgba(215, 55, 55, 0.6);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes robotMove {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% { 
        transform: translateY(-5px) rotate(-2deg);
    }
    50% { 
        transform: translateY(-10px) rotate(0deg);
    }
    75% { 
        transform: translateY(-5px) rotate(2deg);
    }
}

@keyframes eyeBlink {
    0%, 90%, 100% { 
        transform: scaleY(1);
    }
    95% { 
        transform: scaleY(0.1);
    }
}

@keyframes tvGlow {
    0%, 100% {
        box-shadow: 0 20px 50px rgba(0,0,0,0.5), 
                    inset 0 0 15px rgba(0,0,0,0.7), 
                    0 0 30px var(--primary-color-dark);
    }
    50% {
        box-shadow: 0 20px 50px rgba(0,0,0,0.5), 
                    inset 0 0 15px rgba(0,0,0,0.7), 
                    0 0 60px var(--primary-color);
    }
}

/* العناوين */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

/* فئات الحركة */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* الهيدر */
.header {
    background: rgba(51, 51, 51, 0.5); /* خلفية شبه شفافة في الحالة الافتراضية */
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    /* display: none; */ /* تم إظهار شريط التنقل العلوي */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* إضافة حد زجاجي */
    /* display: none;  تمت إزالة هذا السطر لإظهار الناف بار */
}

.header.scrolled {
    background: #333333; /* خلفية معتمة عند التمرير */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
}

.logo i {
    color: #FFFFFF;
    animation: pulse 2s infinite;
}

.nav-menu {
    display: flex; /* تغيير من none إلى flex */
    list-style: none;
    position: absolute;
    top: 70px; /* أسفل الهيدر مباشرة */
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(15px);
    padding: 1rem 0;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    /* خصائص جديدة للتحريك */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    transform-origin: top center;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-menu.active a {
    opacity: 1;
    transform: translateX(0);
}

.nav-menu a {
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Cairo', sans-serif;
    display: block;
    padding: 1rem 2rem;
    text-align: center;
    /* خصائص جديدة لتحريك العناصر */
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* تأخير متدرج لظهور عناصر القائمة */
.nav-menu.active li:nth-child(1) a { transition-delay: 0.1s; }
.nav-menu.active li:nth-child(2) a { transition-delay: 0.15s; }
.nav-menu.active li:nth-child(3) a { transition-delay: 0.2s; }
.nav-menu.active li:nth-child(4) a { transition-delay: 0.25s; }
.nav-menu.active li:nth-child(5) a { transition-delay: 0.3s; }


.nav-menu a:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: #FFFFFF;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.hamburger {
    display: block; /* إظهار زر الهامبرغر دائماً */
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: white;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* قسم البطل الرئيسي مع خلفية GIF */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Darker overlay for better contrast */
    z-index: 2; /* Above video */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* Base layer */
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    z-index: 3; /* On top of everything */
    position: relative;
    padding: 0 1rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: slideRight 1.5s ease-out 0.3s both;
    font-weight: 800;   
    font-family: 'Cairo', sans-serif;
}

.hero p {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    margin-bottom: 2rem;
    opacity: 1;
    animation: slideLeft 1.5s ease-out 0.6s both;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

.hero .cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: #FFFFFF;
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    animation: slideDown 1.2s ease-out 0.9s both, glow 3s ease-in-out 2s infinite alternate;
    opacity: 1;
    font-family: 'Cairo', sans-serif;
}

.hero .cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(215, 55, 55, 0.4);
    background: var(--primary-color-dark);
}

/* قسم الخدمات */
.services {
    padding: 100px 0;
    background: var(--medium-dark-bg); /* توحيد الخلفية مع هوية الموقع */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 3rem;
    color: #F8F8F8;
    position: relative;
    opacity: 0;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
}

.section-title.services-title {
    animation: slideDown 1s ease-out;
    animation-fill-mode: both;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color-dark);
    border-radius: 2px;
    display: none; /* تمت إضافة هذا السطر لإخفاء الخط */
}

.service-card {
    background: var(--light-dark-bg); /* توحيد لون البطاقات */
    padding: 1.5rem; /* تصغير المساحة الداخلية */
    border-radius: 15px;
    text-align: right; /* تغيير المحاذاة لتناسب التصميم الجديد */
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color-dark); /* توحيد لون الحدود */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-dark));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color); /* استخدام اللون الأحمر الأساسي */
    box-shadow: 0 15px 30px rgba(215, 55, 55, 0.2);
}

.service-icon {
    font-size: 2.5rem; /* تصغير حجم الأيقونة */
    color: var(--primary-color-dark);
    margin-bottom: 1rem; /* تقليل الهامش السفلي */
    display: block;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: var(--primary-color);
}

.service-card h3 {
    font-size: 1.2rem; /* تصغير حجم العنوان */
    margin-bottom: 0.8rem; /* تقليل الهامش السفلي */
    color: #F8F8F8;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.service-card p {
    color: #ccc;
    line-height: 1.7;
    flex-grow: 1;
    font-size: 0.9rem; /* تصغير حجم النص */
    margin-bottom: 1rem; /* تقليل الهامش السفلي */
    font-family: 'Cairo', sans-serif;
}

.service-card .cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: rgb(255, 255, 255);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-top: 15px;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.service-card .cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.service-card .cta-button:hover::before {
    left: 100%;
}

.service-card .cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(215, 55, 55, 0.4);
    background: var(--primary-color-dark);
}

/* Services Grid Styles */
.services-slider {
    display: grid; /* سيتم تعديل هذا لاحقاً إذا كنت تستخدم السلايدر */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* تصغير عرض البطاقة بشكل كبير */
    gap: 1.5rem; /* تقليل المسافة بين البطاقات */
    margin-top: 4rem;
}

.service-card {
    opacity: 1; /* Make cards visible */
}

/* قسم من نحن - إصلاح الأخطاء */
.about {
    padding: 120px 0;
    background: #1a1a1a;
    position: relative;
    overflow: hidden; /* إضافة لمنع تسريب المحتوى */
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="%23b91c1c" stop-opacity="0.05"/><stop offset="100%" stop-color="%23d73737" stop-opacity="0.1"/></linearGradient></defs><circle cx="100" cy="100" r="80" fill="url(%23grad1)"/><circle cx="900" cy="800" r="120" fill="url(%23grad1)"/></svg>') !important;
    z-index: 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
}

.about-text h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 2.5rem;
    color: #F8F8F8;
    font-weight: 800;
    position: relative;
    font-family: 'Cairo', sans-serif;
}

.about-text h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0; /* تغيير من left إلى right للعربية */
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    display: none; /* تمت إضافة هذا السطر لإخفاء الخط */
}

.about-text p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #ccc;
    margin-bottom: 1.8rem;
    transition: all 0.3s ease;
    padding: 1rem;
    border-right: 3px solid transparent; /* تغيير من border-left إلى border-right */
    font-family: 'Cairo', sans-serif;
}

.about-text p:hover {
    border-right-color: var(--primary-color);
    background: rgba(215, 55, 55, 0.08);
    border-radius: 8px;
}

.about-image {
    position: relative;
    /* overflow: hidden; */ /* تم تعطيل هذه الخاصية لإظهار رأس الروبوت */
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    height: 400px; /* تقليل الارتفاع */
    width: 70%; /* تقليل العرض إلى 70% */
    margin: 0 auto; /* توسيط الإطار */
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.2), rgba(215, 55, 55, 0.2));
    z-index: 1;
    border-radius: 20px;
}

.about-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 20px;
}

/* قسم الكلمات المفتاحية للـ SEO */
.seo-keywords {
    padding: 80px 0;
    background: #2a2a2a;
    text-align: center;
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.keyword-item {
    background: #333;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    color: #ccc;
}

.keyword-item:hover {
    border-color: var(--primary-color);
    background: #3a3a3a;
    transform: translateY(-5px);
    color: #f8f8f8;
}

.keyword-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.keyword-item p {
    font-family: 'Cairo', sans-serif;
}

/* قسم المدونة - تحسين الوظائف */
.blog-section {
    padding: 120px 0;
    background: #1a1a1a;
    position: relative;
}

.blog-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><linearGradient id="blog-grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="%23d73737" stop-opacity="0.05"/><stop offset="100%" stop-color="%23b91c1c" stop-opacity="0.1"/></linearGradient></defs><rect x="0" y="0" width="100" height="100" fill="url(%23blog-grad)"/><rect x="900" y="900" width="100" height="100" fill="url(%23blog-grad)"/></svg>') !important;
    z-index: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

.blog-post-card {
    background: #333;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    color: #F8F8F8;
    border: 2px solid transparent;
    position: relative;
}

.blog-post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-dark));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.blog-post-card:hover::before {
    transform: scaleX(1);
}

.blog-post-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--primary-color-dark);
}

.blog-post-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.blog-post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.blog-post-content {
    padding: 2rem;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
}

.blog-post-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 1.5rem;
    font-family: 'Cairo', sans-serif;
}

.read-more-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s;
}

.read-more-btn:hover::before {
    left: 100%;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, var(--primary-color-dark), #9a1616);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 55, 55, 0.3);
}

/* قسم الأسئلة الشائعة */
.faq-section {
    padding: 100px 0;
    background: #2a2a2a;
    position: relative;
}

.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid #444;
    border-radius: 12px;
    overflow: hidden;
    background: #333;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.faq-question {
    width: 100%;
    text-align: right;
    padding: 1.5rem 2rem;
    background: #333;
    border: none;
    color: white;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Cairo', sans-serif;
}

.faq-question::before {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    order: -1;
}

.faq-question.active::before {
    transform: rotate(45deg);
}

.faq-question:hover {
    background: #3a3a3a;
    color: var(--primary-color);
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #ccc;
    background: #2a2a2a;
}

.faq-answer.active {
    max-height: 500px;
    padding: 2rem;
}

.faq-answer p {
    line-height: 1.7;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
}

/* قسم التواصل */
.contact {
    padding: 120px 0;
    background: #333333;
    color: white;
    animation: slideUp 1s ease-out;
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="contact-grad" cx="50%" cy="50%"><stop offset="0%" stop-color="%23d73737" stop-opacity="0.1"/><stop offset="100%" stop-color="%23b91c1c" stop-opacity="0"/></radialGradient></defs><circle cx="500" cy="500" r="300" fill="url(%23contact-grad)"/></svg>') !important;
    z-index: 0;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 2.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #f8f8f8;
    font-family: 'Cairo', sans-serif;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1.05rem;
    background: rgba(0,0,0,0.3);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    text-align: right;
    direction: rtl;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d73737;
    box-shadow: 0 0 20px rgba(215, 55, 55, 0.3);
    background: rgba(0,0,0,0.5);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

.submit-btn {
    background: linear-gradient(135deg, #d73737, #b91c1c);
    color: #FFFFFF;
    padding: 15px 35px;
    border: 2px solid #d73737;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(215, 55, 55, 0.4);
    background: linear-gradient(135deg, var(--primary-color-dark), #9a1616);
}

/* الفوتر */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 4rem 0 2rem;
    text-align: right;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-dark), var(--primary-color));
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    text-align: right;
}

.footer-section {
    padding: 1rem 0;
}

.footer-section h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 8px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color-dark);
    border-radius: 2px;
    display: none; /* تمت إضافة هذا السطر لإخفاء الخط */
}

.footer-section p, .footer-section ul {
    font-size: 1rem;
    line-height: 1.9;
    color: #ccc;
    list-style: none;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.footer-section ul li:hover {
    transform: translateX(-5px);
}

.footer-section ul li a {
    color: #ccc;
    transition: color 0.3s ease;
    position: relative;
}

.footer-section ul li a::before {
    content: '◀';
    color: var(--primary-color);
    margin-left: 8px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-section ul li a:hover::before {
    opacity: 1;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-section.contact-info p a {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #ccc;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.footer-section.contact-info p a:hover {
    color: var(--primary-color);
    background: rgba(215, 55, 55, 0.1);
    transform: translateX(-5px);
}

.footer-section.contact-info p a i {
    color: var(--primary-color);
    min-width: 20px;
    font-size: 1.1rem;
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 20px;
    justify-content: flex-start;
}

.social-links a {
    font-size: 2rem;
    color: #ccc;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: var(--primary-color);
    background: rgba(215, 55, 55, 0.2);
    transform: translateY(-5px) scale(1.1);
}

.footer-bottom {
    border-top: 1px solid #444;
    margin-top: 4rem;
    padding-top: 2rem;
    font-size: 0.95rem;
    color: #aaa;
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 0.8rem;
    font-family: 'Cairo', sans-serif;
}

.footer-bottom a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--primary-color-dark);
}

/* زر الدردشة العائم المحسن - مع إمكانية السحب */
.chatbot-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: rgb(255, 255, 255);
    border: none;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    cursor: move;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 1001;
    animation: robotMove 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.chatbot-toggle.dragging {
    cursor: grabbing;
    animation: none;
    transform: scale(1.1); 
    box-shadow: 0 15px 35px rgba(215, 55, 55, 0.6);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-dark), var(--primary-color));
    border-radius: 22px;
    z-index: -1;
    animation: rotate 5s linear infinite;
}

.robot-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.robot-face {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1px;
}

.robot-eye {
    width: 10px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    animation: eyeBlink 3s infinite;
}

.robot-mouth {
    width: 5px;
    height: 3px;
    background: #fff;
    border-radius: 1px;
}

.robot-antenna {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: #fff;
}

.robot-antenna::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffff00;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chatbot-toggle:hover:not(.dragging) {
    transform: scale(1.1) rotateY(15deg);
    box-shadow: 0 12px 35px rgba(215, 55, 55, 0.5);
    animation: robotMove 1s ease-in-out infinite;
}

.chatbot-toggle:hover .robot-antenna::after {
    box-shadow: 0 0 15px #ffff00;
}

/* نافذة الدردشة */
.chatbot-window {
    position: fixed; 
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: #333333;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    z-index: 1002;
    display: none;
    flex-direction: column;
    animation: scaleIn 0.3s ease-out;
    transform-origin: bottom right;
    color: #F8F8F8;
    border: 2px solid #444;
    overflow: hidden;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chatbot-header h4 {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    font-family: 'Cairo', sans-serif;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: #2a2a2a;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #444;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: fadeInUp 0.3s ease-out;
    line-height: 1.5;
    font-family: 'Cairo', sans-serif;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-message {
    background: linear-gradient(135deg, #555, #666);
    align-self: flex-end;
    margin-left: auto;
    animation: fadeInLeft 0.3s ease-out;
    color: #F8F8F8;
    border-bottom-left-radius: 6px;
}

.bot-message {
    background: linear-gradient(135deg, #444, #4a4a4a);
    align-self: flex-start;
    animation: fadeInRight 0.3s ease-out;
    color: #F8F8F8;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bot-message .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.bot-message .button-group button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.bot-message .button-group button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s;
}

.bot-message .button-group button:hover::before {
    left: 100%;
}

.bot-message .button-group button:hover {
    background: linear-gradient(135deg, var(--primary-color-dark), #9a1616);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215, 55, 55, 0.3);
}

.chatbot-input {
    display: flex;
    padding: 1.5rem;
    border-top: 1px solid #555;
    background: #333;
    border-radius: 0 0 20px 20px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #555;
    border-radius: 25px;
    margin-left: 12px; 
    background: #444;
    color: #F8F8F8;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    text-align: right;
    direction: rtl;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(215, 55, 55, 0.3);
}

.chatbot-input button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, var(--primary-color-dark), #9a1616);
    transform: scale(1.05);
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .header {
        display: none; /* إخفاء الهيدر العلوي على الموبايل */
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }

    body {
        padding-top: 0; /* إزالة المساحة العلوية على الموبايل */
        padding-bottom: 70px; /* تعديل المساحة السفلية لتناسب ارتفاع شريط التنقل */
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .chatbot-window {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        height: 75vh;
        bottom: 20px;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-section h3::after {
        right: 50%;
        transform: translateX(50%);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-section.contact-info p a {
        justify-content: center;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .keywords-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1.5rem;
    }
}

/* شريط التنقل السفلي للهاتف */
.bottom-nav {
    display: none; /* إخفاؤه افتراضياً */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px; /* تحديد ارتفاع ثابت */
    background: #1e1e1e; /* خلفية معتمة لزيادة الوضوح */
    backdrop-filter: none; /* إزالة التأثير الضبابي الذي قد يسبب مشاكل أداء */
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex; /* إظهاره فقط على الشاشات الصغيرة */
    }
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    flex-grow: 1;
    height: 100%;
}

.bottom-nav-link i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.bottom-nav-link:hover {
    color: white;
    background: rgba(215, 55, 55, 0.1);
}

.bottom-nav-link.active {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.bottom-nav-link.active i {
    text-shadow: 0 0 10px #d73737;
}

.chatbot-options button {
    background: var(--primary-color-dark);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chatbot-options button:hover {
    background: #a01a1a; /* Kept as is, as it's a darker shade */
}

/* Gallery Styles */
.gallery-filters {
    text-align: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background: #333;
    color: #fff;
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
    font-weight: 600; 
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

@keyframes flipInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes flipOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes strongFlipInLeft {
    from { transform: perspective(1500px) rotateX(180deg) scale(0.7); opacity: 0; }
    to { transform: perspective(1500px) rotateX(0deg) scale(1); opacity: 1; }
}

@keyframes strongFlipOutLeft {
    from { transform: perspective(1500px) rotateX(0deg) scale(1); opacity: 1; }
    to { transform: perspective(1500px) rotateX(-180deg) scale(0.7); opacity: 0; }
}

.carousel-container {
    position: relative;
    background: #1a1a1a; /* Dark grey for the TV frame */
    border-radius: 0; /* Sharp corners for the TV */
    padding: 25px; /* Space between the frame and the screen */
    border: 5px solid #111; /* Thicker border */
    animation: tvGlow 3s infinite alternate;
    max-width: 800px; /* Limit the max width */
    margin: 80px auto 0; /* Add top margin to prevent overlap */
    perspective: 1000px;
}

.carousel-container::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 0;
    box-shadow: 0 0 10px var(--primary-color);
}

.gallery-carousel {
    position: relative;
    overflow: hidden;
    background: #000; /* Black screen background */
    border-radius: 0; /* Sharp corners for the screen */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    aspect-ratio: 4 / 3; /* TV-like aspect ratio */
}

.gallery-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none; /* Hide all items by default */
    align-items: center;
    justify-content: center;
}

.gallery-item.active {
    display: flex; /* Show only the active item */
}

.gallery-item.flip-in-right { animation: flipInRight 0.7s forwards; }
.gallery-item.flip-out-right { animation: flipOutRight 0.7s forwards; }
.gallery-item.strong-flip-in-left { animation: strongFlipInLeft 0.8s forwards; }
.gallery-item.strong-flip-out-left { animation: strongFlipOutLeft 0.8s forwards; }

.carousel-btn {
    position: absolute;
    bottom: -60px; /* زيادة المسافة قليلاً للأسفل */
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1); /* خلفية زجاجية */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2); /* حدود زجاجية */
    cursor: pointer;
    z-index: 11;
    border-radius: 15px; /* زوايا دائرية للشكل الزجاجي */
    width: 70px;
    height: 50px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px); /* زيادة التأثير الضبابي */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* ظل ناعم */
}

/* تم التعليق لإظهار أسهم التنقل على جميع الأجهزة، بما في ذلك التي تدعم اللمس */
/* .touch-device .carousel-btn {
    display: none;
} */

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* زيادة وضوح الخلفية عند التحويم */
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-btn.prev {
    left: 25%; /* إبعاد السهم عن المنتصف قليلاً */
}

.carousel-btn.next {
    right: 25%; /* إبعاد السهم عن المنتصف قليلاً */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item[data-category="video"]::after {
    content: '\f04b'; /* Font Awesome play icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 15px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item[data-category="video"]:hover::after {
    opacity: 1;
}

.gallery-item iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* TV Arms Styles */
.tv-arm {
    position: absolute;
    top: 45%;
    width: 100px; /* Arm length */
    height: 22px; /* Arm thickness */
    background: linear-gradient(to right, #222, #111);
    border: 2px solid #333;
    z-index: 10;
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.tv-arm::before {
    content: '';
    position: absolute;
    top: -9px;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border: 3px solid #333;
    border-radius: 50%;
    z-index: -1;
}

.tv-arm.left {
    left: -20px; /* Position closer to the TV */
    border-radius: 15px 10px 10px 15px;
    transform: rotate(30deg);
}

.tv-arm.left::before {
    left: -20px;
}

.tv-arm.right {
    right: -20px; /* Position closer to the TV */
    border-radius: 10px 15px 15px 10px;
    transform-origin: right center;
    transform: rotate(-30deg);
}

.tv-arm.right::before {
    right: -20px;
}

.tv-head {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 50px;
    background: #111;
    border: 3px solid #333;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
}

.tv-logo {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 0 10px var(--primary-color);
    opacity: 0; /* يبدأ مخفياً */
}

.tv-logo.start-animation {
    animation: logo-fade-in-out 3s ease-out forwards;
}

@keyframes logo-fade-in-out {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    20%, 80% { opacity: 1; transform: scale(1); }
}

.tv-eyes {
    position: absolute;
    display: flex;
    gap: 30px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.tv-eye {
    width: 28px;
    height: 28px;
    background: #000;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 2px solid #222;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.tv-pupil {
    width: 10px;
    height: 10px;
    background: #ff4d4d;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    /* The transform is now fully controlled by JavaScript for accuracy */
    box-shadow: 0 0 8px #ff4d4d, 0 0 12px #ff0000;
    transition: transform 0.2s ease-out;
}

.tv-eye::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    transform: translateY(-100%);
    transition: transform 0.2s ease-in-out;
}

.tv-eye.blinking::after {
    animation: eye-blink-animation 0.4s ease-in-out;
}

@keyframes eye-blink-animation {
    0%, 100% { transform: translateY(-100%); }
    50% { transform: translateY(0%); }
}

.tv-beak {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid #ff4d4d;
    opacity: 0;
    animation: beak-appear 1.5s ease-in-out forwards 3s;
    filter: drop-shadow(0 0 8px #ff4d4d) drop-shadow(0 0 12px #ff0000);
}

@keyframes beak-appear {
    from { opacity: 0; transform: translateX(-50%) scale(0.5); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.tv-beak.talking {
    animation: beak-talk 0.5s infinite;
}

@keyframes beak-talk {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-50%) scaleY(0.6); }
}

.tv-hand {
    position: absolute;
    width: 35px;
    height: 35px;
    background: #222;
    border-radius: 50%;
    border: 2px solid #333;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.tv-arm.left .tv-hand {
    right: -18px;
    top: -7px;
}

.tv-arm.right .tv-hand {
    left: -18px;
    top: -7px;
}

.carousel-container:hover .tv-arm.left {
    animation: wave 1.5s ease-in-out infinite;
}

.carousel-container:hover .tv-arm.right {
    animation: wave 1.5s ease-in-out infinite reverse;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(30deg);
    }
    50% {
        transform: rotate(-15deg) translateY(-5px);
    }
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader {
    flex-direction: column;
}

.preloader-robot {
    width: 150px;
    height: 150px;
    position: relative;
    animation: robotMove 2s ease-in-out infinite;
}


.preloader-robot .robot-antenna {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 20px;
    background: #fff;
}

.preloader-robot .robot-antenna::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 15px #ffff00;
}

.preloader-robot .robot-head {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preloader-robot .robot-face {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.preloader-robot .robot-eye {
    width: 20px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    animation: eyeBlink 3s infinite;
}

.preloader-robot .robot-mouth {
    width: 10px;
    height: 6px;
    background: #fff;
    border-radius: 2px;
}

.preloader-text {
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--primary-color), 0 0 40px var(--primary-color);
    animation: glow-text 1.5s ease-in-out infinite alternate;
}

@keyframes glow-text {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--primary-color), 0 0 20px var(--primary-color);
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

/* --- قسم فريق العمل --- */
.team-section {
    background-color: #1a1a1a; /* خلفية داكنة تتناسب مع التصميم */
    padding: 80px 0;
    overflow: hidden; /* لمنع أي عناصر من الخروج عن نطاق القسم */
    position: relative;
}

.team-section .section-title {
    color: #fff;
    margin-bottom: 40px;
}

.team-subtitle {
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

/* --- بداية تعديلات السلايدر الدائري 3D --- */
.carousel-3d-container {
    position: relative;
    width: 250px;
    height: 350px;
    margin: 0 auto;
    perspective: 1000px;
}

.carousel-3d {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
}

.carousel-3d-item {
    position: absolute;
    width: 250px;
    height: 320px;
    background: var(--medium-dark-bg);
    border-radius: 15px;
    border: 2px solid var(--border-color-dark);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.carousel-3d-item figure {
    margin: 0;
    padding: 1.5rem 1rem;
    text-align: center;
}

/* حاوية الصورة الدائرية */
.carousel-3d-item figure > div {
    border-radius: 50%;
    position: relative;
    margin: 0 auto 1rem;
    width: 150px;
    height: 150px;
    background-color: #2a2a2a; /* لون الدائرة الخلفية */
    border: 3px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* الصورة داخل الحاوية */
.carousel-3d-item figure > div > img {
    position: absolute;
    top: 50%; /* توسيط الصورة عمودياً */
    left: 50%;
    transform: translate(-50%, -50%); /* ضبط التوسيط الدقيق */
    width: 100%; /* جعل عرض الصورة يطابق عرض الدائرة */
    height: 100%; /* جعل ارتفاع الصورة يطابق ارتفاع الدائرة */
    object-fit: contain; /* تغيير القيمة لضمان ظهور الصورة بالكامل دون قص */
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3)); /* إضافة ظل خفيف للصورة */
}

.carousel-3d-item figure figcaption h2 {
    color: #f0f0f0; /* لون أفتح ليتناسب مع الخلفية الداكنة */
    font-size: 1.2rem;
    font-weight: 700; /* استخدام وزن الخط المتوفر */
    font-family: 'Cairo', sans-serif;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.carousel-3d-item figure figcaption p {
    color: #aaa; /* لون أفتح */
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Cairo', sans-serif;
}

/* --- تحسينات للشاشات الصغيرة (الهاتف) --- */
@media (max-width: 768px) {
    .carousel-3d-container {
        width: 200px;
        height: 280px;
    }
    .carousel-3d-item {
        width: 200px;
        height: 260px;
    }
    .carousel-3d-item figure > div {
        width: 100px;
        height: 100px;
    }
    .carousel-3d-item figure figcaption h2 { font-size: 1rem; }
    .carousel-3d-item figure figcaption p { font-size: 0.8rem; }

}
/* --- نهاية تعديلات السلايدر الدائري 3D --- */

/* --- قسم من نحن الجديد (About Us) --- */
.about-us-section {
    background-color: #1a1a1a;
    padding: 80px 0;
    overflow: hidden;
    position: relative;
}

.about-narrative {
    max-width: 800px;
    margin: 0 auto 4rem auto; /* إضافة هامش سفلي لفصله عن قسم الفريق */
    text-align: center;
    color: var(--text-color-light);
}

.about-narrative h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.about-narrative p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-color-light);
    font-family: 'Cairo', sans-serif;
}

/* تعديل اسم قسم الفريق ليتناسب مع الهيكلة الجديدة */
.team-section {
    padding-top: 40px; /* تقليل المسافة العلوية لأنه أصبح جزءاً من قسم أكبر */
}
/* --- نهاية تعديلات السلايدر الدائري 3D --- */
