/* ========================================
   CSS الخاص بـ Navbar المتجاوب للجوالات
   مع إخفاء البحث وقائمة جانبية أنيقة
   ======================================== */

/* --- التأكد من عدم وجود تعارضات --- */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1060;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    width: 100%;
}

/* الشعار */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    white-space: nowrap;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.logo-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* روابط التنقل */
.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-link {
    padding: 8px 18px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #667eea;
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* صندوق البحث */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f8f9fa;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* القسم الأيمن */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* زر الإشعارات */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.notification-btn:hover {
    background: #f0f0f0;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f44336;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* قائمة الإشعارات */
.notification-dropdown {
    position: absolute;
    top: 60px;
    left: 20px;
    width: 350px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

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

.notification-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e8f0fe;
}

/* زر تسجيل الدخول */
.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* قائمة المستخدم */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    transition: background 0.3s;
}

.user-info:hover {
    background: #f0f0f0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: #999;
}

.dropdown-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s;
}

.user-info.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 55px;
    left: 0;
    width: 250px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

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

.dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item.logout {
    color: #f44336;
    border-top: 1px solid #eee;
}

/* مفتاح اللغة */
.lang-switcher {
    position: relative;
}

.lang-btn {
    padding: 6px 10px;
    border: none;
    cursor: pointer;
    background: #f1f1f1;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 120px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 99999;
}

.lang-menu div {
    padding: 10px;
    cursor: pointer;
}

.lang-menu div:hover {
    background: #eee;
}

.lang-menu.show {
    display: block;
}

/* زر القائمة للجوال */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #667eea;
}

/* ========== تصميم متجاوب للجوالات ========== */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 8px 15px;
        gap: 12px;
        min-height: auto;
    }

    .menu-toggle {
        display: block;
        order: 1;
    }

    .logo {
        order: 2;
        flex: 1;
    }

    .nav-right {
        order: 3;
        gap: 8px;
    }

    /* إخفاء صندوق البحث نهائياً في الجوالات */
    .search-box {
        display: none !important;
    }

    /* القائمة الجانبية */
    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 80px 20px 30px;
        transition: right 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        gap: 8px;
        overflow-y: auto;
        z-index: 1050;
        border-radius: 20px 0 0 20px;
    }

    .nav-links.active {
        right: 0;
    }

    /* خلفية داكنة */
    body.nav-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        backdrop-filter: blur(3px);
    }

    .nav-link {
        padding: 14px 20px;
        font-size: 16px;
        text-align: center;
        border-radius: 14px;
        white-space: normal;
    }

    /* تحسين أيقونات الجوال */
    .notification-btn, .lang-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f1f3f5;
    }

    .lang-btn span {
        display: none;
    }

    .lang-btn i, .lang-btn {
        font-size: 18px;
    }

    .user-details {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    /* زر إغلاق القائمة */
    .nav-links::before {
        content: "✕";
        position: absolute;
        top: 18px;
        left: 20px;
        font-size: 24px;
        color: #667eea;
        cursor: pointer;
        font-weight: bold;
        display: block;
    }

    .notification-dropdown {
        width: 300px;
        left: auto;
        right: -50px;
        top: 50px;
    }

    .user-dropdown {
        right: 0;
        left: auto;
        top: 50px;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 480px) {
    .nav-container {
        padding: 6px 12px;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .logo-text {
        display: none;
    }

    .notification-btn, .lang-btn {
        width: 36px;
        height: 36px;
    }

    .login-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    .nav-links {
        width: 260px;
        right: -260px;
        padding: 70px 15px 20px;
    }
}

/* شاشات متوسطة */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-box {
        max-width: 250px;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    .user-name, .user-role {
        display: none;
    }
}

/* منع التمرير الأفقي */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* تحسين اللمس */
* {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}