/**
 * ملف تصميم الهيدر المبهر
 * Stunning Header Design
 */

/* ========== الهيدر الرئيسي ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* هيدر شفاف عند أعلى الصفحة */
.header.transparent {
    background: transparent;
    box-shadow: none;
}

.header.transparent .navbar-brand,
.header.transparent .nav-link {
    color: var(--white);
}

/* هيدر عند التمرير */
.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

/* ========== شريط علوي ========== */
.top-bar {
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    color: var(--white);
    padding: 8px 0;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.top-bar::before {
    display: none;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-item i {
    font-size: 16px;
}

/* Phone Link Styling */
.phone-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.phone-link:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.phone-link span {
    direction: ltr;
    unicode-bidi: embed;
}

/* ========== شريط التنقل ========== */
.navbar {
    padding: 15px 0;
    transition: all 0.3s ease;
}

.header.scrolled .navbar {
    padding: 10px 0;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
}

/* ========== الشعار ========== */
.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.navbar-brand {
    position: relative;
}

.navbar-brand img {
    height: 65px;
    margin-inline-end: 12px;
    transition: all 0.3s ease;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box, linear-gradient(135deg, #D4AA40, #BF9835) border-box;
    padding: 3px;
    box-shadow: 0 4px 15px rgba(212, 170, 64, 0.2);
    position: relative;
    z-index: 1;
}

.navbar-brand::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 71px;
    height: 71px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255,255,255,0.4) 0%,
        rgba(255,255,255,0.2) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    clip-path: circle(35.5px at 35.5px 35.5px);
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 71px;
    height: 71px;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.7) 50%,
        transparent 70%
    );
    border-radius: 50%;
    animation: logoShine 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 11;
    clip-path: circle(35.5px at 35.5px 35.5px);
    transform: translateX(-71px);
}

@keyframes logoShine {
    0% {
        transform: translateX(-71px);
        opacity: 0;
    }
    50% {
        transform: translateX(0px);
        opacity: 1;
    }
    100% {
        transform: translateX(71px);
        opacity: 0;
    }
}

.navbar-brand img {
    height: 65px;
    margin-inline-end: 12px;
    transition: all 0.3s ease;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box, linear-gradient(135deg, #D4AA40, #BF9835) border-box;
    padding: 3px;
    box-shadow: 0 4px 15px rgba(212, 170, 64, 0.2);
    position: relative;
    z-index: 1;
}

.header.scrolled .navbar-brand img {
    height: 45px;
}

.navbar-brand:hover img {
    transform: rotate(-5deg) scale(1.1);
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 24px;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 14.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.year-badge {
    background: linear-gradient(135deg, #D4AA40, #BF9835);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-right: 2px;
    box-shadow: 0 2px 6px rgba(212, 170, 64, 0.3);
    transition: all 0.3s ease;
}

.year-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(212, 170, 64, 0.4);
}

/* ========== قائمة التنقل ========== */
.navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
    display: inline-block; /* تأكيد العرض الأفقي */
}

.nav-link {
    display: inline-block;
    padding: 10px 12px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

/* خط متحرك تحت الروابط */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

[dir="rtl"] .nav-link::before {
    left: auto;
    right: 0;
}

.nav-link:hover {
    color: var(--primary-green);
    transform: translateY(-2px);
}

/* ========== القائمة المنسدلة المبهرة ========== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--white);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-top: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* إظهار قائمة الشركات عند التمرير */
.dropdown:hover .companies-dropdown,
.nav-item.dropdown:hover .companies-dropdown,
.companies-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* تأكيد ظهور القائمة بصيغة أقوى */
.nav-item.dropdown:hover > .dropdown-menu.companies-dropdown {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* مثلث صغير يشير للأعلى */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 30px;
    width: 16px;
    height: 16px;
    background: var(--white);
    transform: rotate(45deg);
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.05);
}

[dir="rtl"] .dropdown-menu::before {
    left: auto;
    right: 30px;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    opacity: 0.1;
    transition: left 0.3s ease;
}

.dropdown-item:hover::before {
    left: 0;
}

.dropdown-item:hover {
    color: var(--primary-green);
    padding-inline-start: 25px;
}

/* ========== أزرار الإجراءات ========== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* زر تبديل اللغة */
.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: var(--white);
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-top: 10px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

/* DISABLED: Hover on mobile causes sticky open state
   Now controlled by .show class via JavaScript click
.language-switcher:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
*/

/* Desktop only: Show dropdown on hover */
@media (min-width: 992px) {
    .language-switcher:hover .language-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.language-option {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.language-option:hover {
    background: var(--primary-green);
    color: var(--white);
}

/* زر طلب عرض سعر */
.header-cta {
    padding: 8px 20px;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
}

.header-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.header-cta:hover::before {
    width: 300px;
    height: 300px;
}

.header-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 170, 64, 0.3);
}

/* ========== زر القائمة للموبايل ========== */
/* DISABLED: Moved to mobile-responsive.css with luxury black & gold theme */
/*
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.menu-bar {
    width: 25px;
    height: 3px;
    background: var(--primary-green);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
}

.menu-bar:nth-child(1) {
    transform: translateY(-8px);
}

.menu-bar:nth-child(3) {
    transform: translateY(8px);
}

.mobile-menu-toggle.active .menu-bar:nth-child(1) {
    transform: rotate(45deg);
}

.mobile-menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg);
}
*/

/* ========== حل مشكلة انقسام المنيو ========== */
@media (min-width: 992px) and (max-width: 1400px) {
    .navbar-nav {
        gap: 16px;
    }

    .nav-link {
        padding: 10px 10px;
        font-size: 15px;
    }

    .navbar-brand img {
        height: 40px;
        margin-inline-end: 10px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 11px;
    }
}

@media (min-width: 1200px) and (max-width: 1300px) {
    .navbar-nav {
        gap: 14px;
    }

    .nav-link {
        padding: 10px 8px;
    }
}

@media (min-width: 1300px) and (max-width: 1400px) {
    .navbar-nav {
        gap: 18px;
    }
}

/* ========== Responsive ========== */
/* DISABLED: Moved to mobile-responsive.css with luxury black & gold theme */
/*
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    [dir="rtl"] .navbar-nav {
        left: auto;
        right: -100%;
    }

    .navbar-nav.active {
        left: 0;
    }

    [dir="rtl"] .navbar-nav.active {
        left: auto;
        right: 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 15px 0;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin: 0;
        padding: 0 0 0 20px;
    }

    [dir="rtl"] .dropdown-menu {
        padding: 0 20px 0 0;
    }

    .header-actions {
        margin-top: 30px;
        flex-direction: column;
        width: 100%;
    }

    .language-switcher,
    .header-cta {
        width: 100%;
    }
}
*/

/* ========== تأثيرات إضافية ========== */
.header.has-announcement {
    top: 40px;
}

.announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 1001;
}

/* شريط تقدم التحميل */
.header-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(135deg, #D4AA40, #BF9835, #A58230);
    transition: width 0.3s ease;
}

/* ========== قائمة الشركات المحسنة ========== */
.companies-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 320px !important;
    padding: 15px !important;
    background: var(--white);
    border-radius: 18px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(212, 170, 64, 0.2);
    margin-top: 15px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-20px) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
}

[dir="rtl"] .companies-dropdown {
    left: auto !important;
    right: 0 !important;
}

/* مثلث صغير للقائمة المنسدلة */
.companies-dropdown::before {
    display: none !important;
}

[dir="rtl"] .companies-dropdown::before {
    left: auto;
    right: 30px;
}

.companies-overview {
    background: linear-gradient(135deg, #D4AA40, #BF9835) !important;
    color: #000 !important;
    border-radius: 12px !important;
    padding: 12px 18px !important;
    margin-bottom: 8px !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.companies-overview:hover {
    background: linear-gradient(135deg, #BF9835, #BF9835) !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 170, 64, 0.4);
}

.companies-overview:hover i {
    color: #000000 !important;
}

.companies-overview {
    display: flex !important;
    align-items: center !important;
}

.companies-overview i {
    width: 24px;
    height: 24px;
    text-align: center;
    margin-left: 18px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.companies-overview span {
    flex: 1;
    text-align: right;
    padding-right: 8px;
}

.dropdown-divider {
    border-top: 1px solid rgba(212, 170, 64, 0.3) !important;
    margin: 10px 0 !important;
}

.company-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 18px !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    color: var(--text-primary) !important;
    position: relative;
    overflow: hidden;
}

.company-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212, 170, 64, 0.1), rgba(255, 165, 0, 0.1));
    transition: left 0.3s ease;
    z-index: 0;
}

.company-item:hover::before {
    left: 0;
}

.company-item:hover {
    color: #000000 !important;
    transform: none !important;
    background: transparent !important;
}

.company-item i {
    width: 28px;
    height: 28px;
    text-align: center;
    margin-left: 18px;
    font-size: 16px;
    color: #D4AA40;
    background: rgba(212, 170, 64, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.company-item:hover i {
    background: #D4AA40 !important;
    color: #000000 !important;
    transform: scale(1.1);
}

.company-item span {
    position: relative;
    z-index: 1;
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    text-align: right;
    padding-right: 8px;
}

/* RTL Support - حل نهائي: الأيقونة في اليمين والنص في اليسار */

/* إزالة المسافة الافتراضية من الأيقونة */
.company-item i {
    margin-left: 0;
}

.companies-overview i {
    margin-left: 0;
}

/* في RTL: ترتيب الأيقونة في البداية (اليمين) والنص بعدها (يسار) */
[dir="rtl"] .company-item {
    flex-direction: row;
}

[dir="rtl"] .companies-overview {
    flex-direction: row;
}

[dir="rtl"] .company-item i {
    order: 1; /* الأيقونة أولاً (يمين) */
    margin-left: 18px; /* مسافة بعد الأيقونة */
}

[dir="rtl"] .company-item span {
    order: 2; /* النص ثانياً (يسار) */
    padding-right: 0;
    padding-left: 8px;
}

[dir="rtl"] .companies-overview i {
    order: 1;
    margin-left: 18px;
}

[dir="rtl"] .companies-overview span {
    order: 2;
    padding-right: 0;
    padding-left: 8px;
}

[dir="rtl"] .company-item:hover {
    transform: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .companies-dropdown {
        min-width: 280px !important;
        padding: 12px !important;
    }

    .company-item span {
        font-size: 13px;
    }
}