/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    padding: 0.6rem 0;
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.08);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Brand Section */
.navbar-brand-wrapper {
    padding: 0.5rem 0;
}

.brand-container {
    gap: 0.75rem;
}

.logo {
    width: 42px;
    height: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover .logo {
    transform: scale(1.05);
}

.company-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.navbar-brand:hover .company-name {
    transform: translateY(-1px);
    text-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.2);
}

/* Navigation Links */
.navbar-nav {
    gap: 0.6rem;
}

.nav-link {
    color: #1f2a37;
    font-weight: 600;
    padding: 0.7rem 1.1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}
.nav-cta .btn {
    border-radius: 999px;
}

.nav-cta .btn-outline-primary {
    background: rgba(43, 76, 126, 0.06);
    border: 1px solid rgba(43, 76, 126, 0.25);
}

.nav-cta .btn-outline-primary:hover {
    background: rgba(43, 76, 126, 0.12);
}

.nav-cta .btn-primary {
    box-shadow: 0 6px 18px rgba(43, 76, 126, 0.25);
}

.nav-cta .btn-primary:hover {
    box-shadow: 0 10px 24px rgba(43, 76, 126, 0.3);
}

.nav-link::before {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to left, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    opacity: 0;
}

.nav-link:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 100%;
    opacity: 1;
}

.nav-link i {
    font-size: 1.15rem;
    transition: transform 0.3s ease;
    pointer-events: none; /* يجعل جميع الأيقونات ضمن الروابط شفافة للمس لمنع مشاكل التداخل */
}

.nav-link:hover i {
    transform: scale(1.15) translateX(-2px);
}

/* Support Badge */
.support-link {
    position: relative;
}

.support-badge {
    background: linear-gradient(to right, #28a745, #20c997);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.2);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 0.8rem;
    margin-top: 0.7rem;
    right: 0; /* لدعم RTL */
    min-width: 220px;
    animation: dropdown-fade 0.2s ease;
    overflow: hidden;
    max-width: 260px;
}

@keyframes dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسين منطقة النقر للقائمة المنسدلة */
.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
    width: 100%;
    text-align: right;
    display: flex;
    align-items: center;
}

.dropdown-toggle i {
    pointer-events: none; /* يجعل الأيقونة شفافة للحدث وينقل الحدث للعنصر الأب */
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-toggle .dropdown-arrow {
    margin-right: 0.5rem;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.show .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-item {
    padding: 0.8rem 1.1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    color: #444;
    margin-bottom: 2px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.35;
}

.dropdown-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.dropdown-item:hover i {
    transform: scale(1.15);
}

.dropdown-divider {
    margin: 0.6rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Auth Buttons */
.nav-auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 1rem;
}

.nav-auth-buttons .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border-radius: 50px;
}

.nav-auth-buttons .btn i {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.nav-auth-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-auth-buttons .btn:hover i {
    transform: scale(1.15);
}

.nav-auth-buttons .btn-outline-primary {
    border-width: 2px;
    background: transparent;
}

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

.nav-auth-buttons .btn-danger {
    background: linear-gradient(to right, #dc3545, #fd7e14);
    border: none;
}

.nav-auth-buttons .btn-danger:hover {
    background: linear-gradient(to right, #c82333, #e74c3c);
}

/* تنسيق زر تسجيل الخروج */
.dropdown-item-form {
    margin: 0;
    padding: 0;
    width: 100%;
}

.dropdown-item.text-danger {
    color: #dc3545 !important;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #c82333 !important;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

/* Mobile Navbar */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler:hover {
    transform: scale(1.1);
}

/* تحسينات للجوال */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        margin-top: 1rem;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .nav-link {
        padding: 0.8rem 1rem !important;
        margin-bottom: 5px;
    }

    .navbar-nav {
        gap: 0.2rem;
    }
    
    .dropdown-menu {
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.05);
        margin-top: 0.3rem;
        padding: 0.5rem;
        animation: none;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .dropdown-item {
        padding: 0.7rem 1rem;
    }
    
    .dropdown-item:hover {
        transform: translateX(-3px);
    }
    
    .auth-nav {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-auth-buttons {
        margin-top: 1rem;
        margin-right: 0;
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-auth-buttons .btn {
        width: 100%;
        justify-content: center;
        margin: 0.3rem 0;
    }
    .nav-cta { display: none !important; }
}

/* تنسيق أيقونة السهم في القوائم المنسدلة */
.dropdown-arrow {
    font-size: 0.7rem;
    margin-right: 5px;
    color: #777;
    transition: transform 0.3s ease;
}

/* تدوير السهم عند فتح القائمة المنسدلة */
.dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* تنسيق القوائم المنسدلة على الجوال */
@media (max-width: 991.98px) {
    .dropdown-arrow {
        margin-right: 8px;
    }
}

/* زر تبديل اللغة */
.language-dropdown .dropdown-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.language-dropdown .dropdown-item.active {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.language-dropdown .dropdown-item:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
}

.language-dropdown .fa-check {
    color: var(--primary-color);
    margin-left: 0.5rem;
}

/* تعديلات الاتجاه حسب اللغة */
html[dir="ltr"] .dropdown-arrow {
    margin-right: 0;
    margin-left: 3px;
}

html[dir="ltr"] .navbar-nav .nav-link i:not(.dropdown-arrow) {
    margin-right: 5px;
    margin-left: 0;
}

html[dir="ltr"] .language-dropdown .fa-check {
    margin-right: 0.5rem;
    margin-left: 0;
}

html[dir="ltr"] .dropdown-menu {
    text-align: left;
}

html[dir="ltr"] .navbar-nav .nav-link {
    text-align: left;
}
