:root{
    /* الألوان المطلوبة: أسود — برتقالي — أحمر */
    --primary-color: #000000;
    --accent-color: #ff8c00;
    --danger-color: #e53e3e;
    --bg-color: #ffffff;
    --muted: #555555;
    --light: #fafafa;
    --border: #e8e8e8;
    --text: #111111;
}

/* قواعد أساسية */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text);
    line-height: 1.7;
    padding-top: 50px;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1 15px;
}

/* ===== الشريط العلوي وزر اللغة ===== */
/* الشريط العلوي */
.top-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d2d2d 100%);
    color: #fff;
    padding: 1px 8px; /* ارتفاع أقل */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 0.75rem; /* أصغر قليلًا */
    line-height: 1.1; /* يقلل الارتفاع الكلي */
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px; /* تقليل الفراغ بين العناصر */
}

.top-bar .contact-info {
    display: flex;
    gap: 10px; /* تقليل المسافة بين الروابط */
}

/* روابط الهاتف والبريد */
.top-bar .contact-info a {
    color: var(--accent-color); /* برتقالي */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px; /* تقليل المسافة بين الأيقونة والنص */
    padding: 1px 4px; /* أقل padding */
    border-radius: 3px;
    font-size: 0.75rem; /* أصغر */
    transition: all 0.3s ease;
}

.top-bar .contact-info a:hover {
    color: #fff; /* عند المرور */
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

/* الساعة */
.top-bar .top-clock {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px; /* المسافة بين الساعة والتاريخ */
}


.top-clock i {
    margin-right: 3px; /* تقليل المسافة بين أيقونة الساعة والنص */
}


/* زر تغيير اللغة - الإصلاح النهائي */
.lang-switcher {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.lang-switcher button {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 80px;
    text-align: center;
    font-size: 0.95rem;
}

.lang-switcher button:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* ===== الهيدر الرئيسي ===== */
header.main-header {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* إصلاح الشعار - إزالة الفئات غير المعرفة */
.logo {
    display: flex !important;
    align-items: center !important;
    gap: 15px;
    transition: transform 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 65px;
    width: auto;
    border-radius: 8px;
    display: block !important;
    visibility: visible !important;
}

.logo-text {
    display: block !important;
    visibility: visible !important;
}

.logo-text h1 {
    margin-bottom: 5px;
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
    display: block !important;
}

.logo-text p {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    display: block !important;
}

/* ===== القائمة الرئيسية ===== */
.navigation {
    position: relative;
}

/* إصلاح زر القائمة المتنقلة */
.mobile-menu-btn {
    display: none; /* مخفي على الشاشات الكبيرة */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 1003;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-menu-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--accent-color);
}

.main-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.main-menu li {
    position: relative;
}

.main-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding: 10px 5px;
    transition: all 0.3s ease;
    font-size: 1.05rem;
}

.main-menu a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.main-menu a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-color), var(--danger-color));
    transition: width 0.4s ease;
    border-radius: 2px;
}

.main-menu a:hover::after {
    width: 100%;
}

/* ===== قسم الهيرو ===== */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%),
                url('https://images.unsplash.com/photo-1544620347-c4fd4a3d5957?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    padding: 120px 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.6) 100%);
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.6);
    opacity: 0.9;
    line-height: 1.6;
}

/* ===== الأزرار ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b00);
    color: #fff;
    padding: 15px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin: 8px;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.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 ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 140, 0, 0.4);
    background: linear-gradient(135deg, #ff6b00, var(--accent-color));
}

/* ===== تأثيرات الظهور ===== */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
}

/* ===== عناوين الأقسام ===== */
.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    display: inline-block;
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
    margin-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--danger-color));
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title p {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ===== قسم الخدمات ===== */
.services {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--danger-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.service-icon {
    height: 80px;
    width: 80px;
    margin: 30px auto 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #ff6b00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(255, 140, 0, 0.4);
}

.service-content {
    padding: 25px;
    text-align: center;
}

.service-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 700;
}

.service-content p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

/* ===== قسم من نحن ===== */
.about {
    padding: 100px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
}

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2.3rem;
    font-weight: 700;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 1.05rem;
}

.about-image {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,140,0,0.1), rgba(229,62,62,0.1));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.about-image:hover::before {
    opacity: 1;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* ===== قسم الاتصال ===== */
.contact {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

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

.contact-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 25px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.contact-icon {
    background: linear-gradient(135deg, var(--accent-color), #ff6b00);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.4rem;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.3);
}

.contact-details h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

.contact-details p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 1rem;
}

/* ===== الفوتر ===== */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d2d2d 100%);
    color: #fff;
    padding: 80px 0 30px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--danger-color));
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.footer-column p {
    color: #e6e6e6;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #e6e6e6;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-links a::before {
    content: '▸';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.footer-links a:hover::before {
    transform: translateX(3px);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.3);
}

/* ===== حقوق النشر ===== */
.copyright {
    color: #dcdcdc;
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.95rem;
}

/* ===== إدارة اللغات ===== */
.lang-ar { 
    display: block; 
}

.lang-en { 
    display: none; 
}

html[dir="ltr"] .lang-ar { 
    display: none; 
}

html[dir="ltr"] .lang-en { 
    display: block; 
}

html[dir="ltr"] {
    direction: ltr;
}

.lang-ar { 
    display: block; 
}

.lang-en { 
    display: none; 
}

html[lang="ar"] .lang-ar,
html[dir="rtl"] .lang-ar { 
    display: block; 
}

html[lang="ar"] .lang-en,
html[dir="rtl"] .lang-en { 
    display: none; 
}

html[lang="en"] .lang-ar,
html[dir="ltr"] .lang-ar { 
    display: none; 
}

html[lang="en"] .lang-en,
html[dir="ltr"] .lang-en { 
    display: block; 
}

/* ===== التجاوب مع الشاشات الصغيرة ===== */
@media (max-width: 1200px) {
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 140px; /* زيادة المساحة لاستيعاب الهيدر */
    }
    
    header.main-header {
        top: 60px; /* تعديل الموضع */
    }
    
    .top-container {
        flex-direction: row; /* الحفاظ على الاتجاه الأفقي */
        align-items: center;
        gap: 10px;
    }
    
    .contact-info {
        flex-direction: row; /* الحفاظ على الاتجاه الأفقي */
        gap: 10px;
        flex-wrap: wrap; /* السماح بالتفاف العناصر */
    }
    
    .contact-info a {
        font-size: 0.85rem; /* تصغير الخط قليلاً */
        padding: 4px 8px;
    }
    
    .lang-switcher {
        align-self: center; /* توسيط زر اللغة */
    }
    
    /* إصلاح زر القائمة المتنقلة */
    .mobile-menu-btn {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* إصلاح القائمة المتنقلة */
    .main-menu {
        display: none;
        flex-direction: column;
        background: #fff;
        position: fixed; /* تغيير إلى fixed */
        right: 0;
        top: 140px; /* تعديل الموضع ليكون تحت الهيدر */
        width: 100%; /* جعل العرض كامل الشاشة */
        max-height: calc(100vh - 140px);
        padding: 20px;
        border-radius: 0; /* إزالة الحواف المستديرة */
        box-shadow: 0 15px 40px rgba(0,0,0,0.15);
        z-index: 1000;
        overflow-y: auto; /* إضافة scroll إذا كانت القائمة طويلة */
    }
    
    .main-menu.show {
        display: flex;
    }
    
    .main-menu li {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .main-menu a {
        padding: 12px 15px;
        display: block;
        border-radius: 8px;
        transition: all 0.3s ease;
        font-size: 1.1rem;
    }
    
    .main-menu a:hover {
        background: rgba(255, 140, 0, 0.1);
        transform: none;
    }
    
    .hero {
        padding: 60px 20px; /* تقليل الحشو */
        min-height: 60vh; /* تقليل الارتفاع */
    }
    
    .hero h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .section-title h2 {
        font-size: 1.9rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .contact-item {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    body {
        padding-top: 150px; /* زيادة المساحة أكثر للشاشات الصغيرة */
    }
    
    header.main-header {
        top: 70px;
    }
    
    .main-menu {
        top: 150px;
        max-height: calc(100vh - 150px);
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo-img {
        height: 50px; /* تصغير الشعار */
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
        margin: 5px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-info a {
        font-size: 0.8rem;
    }
    
    .lang-switcher button {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

/* ===== تحسينات للغة الإنجليزية ===== */
html[dir="ltr"] .footer-links a:hover {
    transform: translateX(-5px);
}

html[dir="ltr"] .footer-links a::before {
    content: '◂';
}

html[dir="ltr"] .footer-links a:hover::before {
    transform: translateX(-3px);
}

html[dir="ltr"] .contact-item:hover {
    transform: translateX(-10px);
}

html[dir="ltr"] .main-menu {
    right: auto;
    left: 15px;
}

/* ===== تحسينات خاصة باللغة الإنجليزية ===== */
html[dir="ltr"] .logo-text h1 {
    font-size: 1.2rem; /* خط أصغر للإنجليزية */
}

html[dir="ltr"] .logo-text p {
    font-size: 0.8rem; /* خط أصغر للإنجليزية */
}

html[dir="ltr"] .hero h2 {
    font-size: 2rem; /* خط أصغر للإنجليزية */
}

/* ===== إصلاح النصوص المقطوعة ===== */
.hero h2,
.hero p,
.logo-text h1,
.logo-text p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}


/* ===== تحسينات الوصولية ===== */
.lang-switcher button:focus,
.mobile-menu-btn:focus,
.btn:focus {
    outline: 3px solid rgba(255, 140, 0, 0.4);
    outline-offset: 3px;
}

/* ===== تأثيرات إضافية ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* ===== تحسينات الأداء ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}