/* ========================================
   استایل‌های مشترک منوها
   ======================================== */

/* متغیرهای رنگی مشترک */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius: 0.375rem;
    --transition: all 0.3s ease;
}

/* ========================================
   منوی عمومی (Top Navigation)
   ======================================== */

.persian-nav {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

.persian-nav .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.persian-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    transition: var(--transition);
    position: relative;
}

.persian-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.persian-nav .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.persian-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* ========================================
   منوی کناری مدیریت (Admin Sidebar)
   ======================================== */

.sidebar {
    background: linear-gradient(180deg, #2c3e50, #34495e);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--primary-color);
}

.sidebar-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    color: white;
    font-weight: 600;
    margin: 0;
    padding: 1rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.875rem 1.25rem;
    border-radius: 0;
    transition: var(--transition);
    border-right: 3px solid transparent;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-right-color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: linear-gradient(90deg, var(--primary-color), rgba(0, 123, 255, 0.8));
    border-right-color: white;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
}

.nav-group-title {
    background: rgba(0, 0, 0, 0.3) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.nav-group-title:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    color: white !important;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* ========================================
   منوی پایین (Bottom Navigation)
   ======================================== */

.bottom-nav-simple {
    background: white;
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.bottom-nav-simple .nav-item {
    color: var(--secondary-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bottom-nav-simple .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

.bottom-nav-simple .nav-item:hover {
    color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
    transform: translateY(-3px);
}

.bottom-nav-simple .nav-item:hover::before {
    width: 100%;
}

.bottom-nav-simple .nav-item.active {
    color: var(--primary-color);
    background: rgba(0, 123, 255, 0.1);
}

.bottom-nav-simple .nav-item.active::before {
    width: 100%;
}

.bottom-nav-simple .nav-item i {
    transition: var(--transition);
}

.bottom-nav-simple .nav-item:hover i {
    transform: scale(1.1);
}

/* ========================================
   آیکون‌های مشترک
   ======================================== */

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    text-align: center;
}

/* ========================================
   انیمیشن‌های مشترک
   ======================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.sidebar-nav .nav-item {
    animation: slideInRight 0.3s ease forwards;
}

.sidebar-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
.sidebar-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
.sidebar-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
.sidebar-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }

.bottom-nav-simple .nav-item {
    animation: slideInUp 0.3s ease forwards;
}

.bottom-nav-simple .nav-item:nth-child(1) { animation-delay: 0.1s; }
.bottom-nav-simple .nav-item:nth-child(2) { animation-delay: 0.2s; }
.bottom-nav-simple .nav-item:nth-child(3) { animation-delay: 0.3s; }
.bottom-nav-simple .nav-item:nth-child(4) { animation-delay: 0.4s; }
.bottom-nav-simple .nav-item:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   ریسپانسیو
   ======================================== */

@media (max-width: 768px) {
    .persian-nav .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .bottom-nav-simple {
        padding: 8px 0;
    }
    
    .bottom-nav-simple .nav-item {
        padding: 8px 6px;
        min-width: 50px;
    }
    
    .bottom-nav-simple .nav-item i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-simple .nav-item span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .persian-nav .navbar-brand {
        font-size: 1.2rem;
    }
    
    .persian-nav .nav-link {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem;
        margin: 0 0.1rem;
    }
    
    .bottom-nav-simple .nav-item {
        padding: 6px 4px;
        min-width: 45px;
    }
    
    .bottom-nav-simple .nav-item i {
        font-size: 1rem;
    }
    
    .bottom-nav-simple .nav-item span {
        font-size: 0.65rem;
    }
}

/* ========================================
   حالت تاریک
   ======================================== */

@media (prefers-color-scheme: dark) {
    .bottom-nav-simple {
        background: #1a1a1a;
        border-top-color: #333;
    }
    
    .bottom-nav-simple .nav-item {
        color: #a0a0a0;
    }
    
    .bottom-nav-simple .nav-item:hover,
    .bottom-nav-simple .nav-item.active {
        color: #4dabf7;
        background: rgba(77, 171, 247, 0.1);
    }
}

/* ========================================
   بهبودهای دسترسی
   ======================================== */

.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-link:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   استایل‌های اضافی برای سازگاری
   ======================================== */

.persian-text {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========================================
   بهبودهای بصری
   ======================================== */

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.persian-nav .nav-link i {
    margin-left: 0.5rem;
}

.bottom-nav-simple .nav-item i {
    margin-bottom: 4px;
    display: block;
}

/* ========================================
   استایل‌های خاص برای گروه‌ها
   ======================================== */

#group-content .nav-link {
    padding-right: 2rem;
}

#group-tools .nav-link {
    padding-right: 2rem;
}

#group-analytics .nav-link {
    padding-right: 2rem;
}

#group-financial .nav-link {
    padding-right: 2rem;
}

#group-system .nav-link {
    padding-right: 2rem;
}
