﻿/* إعدادات عامة */
* {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 80px; /* زيادة المسافة */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Navbar محسنة مع حجم أكبر */
.modern-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.3s ease;
    height: 80px; /* زيادة الارتفاع */
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.modern-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    height: 70px; /* تقليل الارتفاع عند التمرير */
}

.navbar-brand {
    font-size: 1.8rem; /* زيادة الخط */
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 20px 0; /* زيادة البادينج */
    margin-right: 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 80px;
    line-height: 1;
}

.navbar-brand:hover {
    text-decoration: none;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand i {
    font-size: 2rem; /* زيادة الأيقونة */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسين Container */
.navbar .container {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px; /* زيادة البادينج */
    justify-content: center; /* يخلي العناصر في النص */
}

.navbar-header {
    display: flex;
    align-items: center;
    height: 80px;
}

/* Navigation Links محسنة */
.modern-nav-link {
    color: #2c3e50;
    font-weight: 500;
    padding: 20px 20px !important; /* زيادة البادينج */
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 80px;
    font-size: 1.1rem; /* زيادة الخط */
}

.modern-nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px; /* زيادة سماكة الخط */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 1px;
}

.modern-nav-link:hover::before,
.modern-nav-link.active::before {
    width: 80%;
}

.modern-nav-link:hover {
    color: #667eea;
    text-decoration: none;
    transform: translateY(-2px);
}

.modern-nav-link.active {
    color: #667eea;
}

/* تحسين الـ nav lists */
.navbar-nav {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 80px;
    flex: 1;
    justify-content: center; /* يخليهم في النص */
    gap: 25px; /* مسافة متساوية بين العناصر */
}

.navbar-nav > li {
    display: flex;
    align-items: center;
    height: 80px;
}

/* Dropdown Menu محسن للديسكتوب */
.navbar-nav .dropdown-menu {
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 15px 0;
    margin-top: 8px;
    min-width: 240px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1051;
}

.dropdown.open .dropdown-menu,
.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu .dropdown-item {
    padding: 12px 25px;
    color: #2c3e50;
    transition: all 0.25s ease;
    border-radius: 6px;
    font-size: 1rem;
}

.dropdown-menu .dropdown-item:hover {
    background: #f5f5f5;
    color: #667eea;
    transform: translateX(5px);
}

/* User Section محسنة */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 80px;
}

.user-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 1rem;
}

.btn-logout {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.btn-login {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-login:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.3);
}

/* Mobile Toggle محسن */
.navbar-toggle {
    border: none;
    background: none;
    padding: 15px;
    margin: 0;
    height: 50px;
}

.navbar-toggle .icon-bar {
    background-color: #2c3e50;
    height: 3px;
    width: 28px;
    border-radius: 2px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.navbar-toggle:hover .icon-bar {
    background-color: #667eea;
}

/* Content Area */
.body-content {
    background: transparent;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

/* تحسين الـ collapse للموبايل */
.navbar-collapse {
    border: none;
    box-shadow: none;
    max-height: none;
}

.navbar-collapse.collapse {
    display: none;
}

.navbar-collapse.collapse.in {
    display: block;
}

/* تحسينات خاصة للموبايل */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .modern-navbar {
        height: 70px;
    }

    .navbar-brand {
        font-size: 1.4rem;
        margin-right: 15px;
        height: 70px;
        padding: 15px 0;
    }

    .navbar-nav {
        flex-direction: column;
        height: auto;
        gap: 0;
        justify-content: flex-start;
        align-items: flex-start;
        width: 100%;
    }

    .navbar-nav > li {
        height: auto;
        width: 100%;
        display: block;
    }

    .modern-nav-link {
        padding: 15px 20px !important;
        font-size: 1rem;
        height: auto;
        width: 100%;
        justify-content: flex-start;
        border-bottom: 1px solid #f0f0f0;
    }

    .modern-nav-link::before {
        display: none; /* إخفاء الخط السفلي في الموبايل */
    }

    /* تحسين Dropdown في الموبايل */
    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: #f8f9fa !important;
        transform: none !important;
        opacity: 1 !important;
        display: none;
    }

    .dropdown.open .dropdown-menu,
    .dropdown:hover .dropdown-menu {
        display: block !important;
    }

    .dropdown-menu .dropdown-item {
        padding: 12px 35px !important; /* زيادة المسافة للدلالة على التبعية */
        border-bottom: 1px solid #e9ecef;
        font-size: 0.95rem;
    }

    .dropdown-menu .dropdown-item:hover {
        transform: none;
        background: #e9ecef;
    }

    /* تحسين User Section في الموبايل */
    .user-section {
        flex-direction: column;
        gap: 10px;
        padding: 15px 20px;
        height: auto;
        width: 100%;
    }

    .user-welcome,
    .btn-logout,
    .btn-login {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
        padding: 12px 20px;
    }

    /* تحسين Navbar Collapse في الموبايل */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-radius: 0 0 20px 20px;
        margin-top: 70px;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    /* إضافة سهم للقوائم الفرعية في الموبايل */
    .dropdown > .modern-nav-link::after {
        content: '▼';
        font-size: 0.8rem;
        margin-left: auto;
        transition: transform 0.3s ease;
    }

    .dropdown.open > .modern-nav-link::after {
        transform: rotate(180deg);
    }
}

/* Animation للتحميل */
.navbar {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* تأثير التمرير */
.scroll-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* تحسينات إضافية للقوائم الفرعية */
.dropdown-menu {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}