﻿/* wwwroot/css/navmenu.css */

/* Root Variables */
:root {
    --primary: #1B5E7A;
    --primary-light: #2A7699;
    --primary-lighter: #E8F4F8;
    --primary-dark: #0F4C63;
    --secondary: #38B2AC;
    --secondary-light: #4FD1C5;
    --secondary-lighter: #C6F6E5;
    --white: #FFFFFF;
    --bg-light: #F8FAFC;
    --text: #2D3748;
    --text-light: #718096;
    --text-lighter: #A0AEC0;
    --danger: #F56565;
    --success: #48BB78;
    --warning: #ECC94B;
    --info: #4299E1;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s ease;
    --transition-slow: all 0.4s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary: #63B3ED;
    --primary-light: #90CDF4;
    --primary-lighter: #2D3748;
    --primary-dark: #3182CE;
    --secondary: #81E6D9;
    --white: #1A202C;
    --bg-light: #2D3748;
    --text: #E2E8F0;
    --text-light: #CBD5E0;
    --text-lighter: #718096;
    --border: #4A5568;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* NavMenu Container */
.nav-menu-container {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
}

/* Top Navigation Bar */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 60px; /* Reduced from 64px */
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px; /* Reduced padding */
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

/* Navbar Header */
.navbar-header {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 15px */
}

.navbar-toggler {
    background: none;
    border: none;
    width: 36px; /* Reduced */
    height: 36px; /* Reduced */
    border-radius: 6px; /* Reduced */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.3rem; /* Reduced */
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 6px; /* Added padding */
}

    .navbar-toggler:hover {
        background: var(--primary-lighter);
        color: var(--primary-light);
    }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced */
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1.1rem; /* Reduced */
    transition: var(--transition-fast);
    padding: 4px 0; /* Reduced padding */
}

    .navbar-brand:hover {
        transform: translateY(-1px);
    }

    .navbar-brand i {
        font-size: 1.5rem; /* Reduced */
        color: var(--primary);
    }

.brand-text {
    display: inline;
}

/* Navbar Controls - Compact */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced */
}

.nav-btn {
    background: none;
    border: none;
    width: 34px; /* Reduced */
    height: 34px; /* Reduced */
    border-radius: 6px; /* Reduced */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem; /* Reduced */
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    padding: 5px; /* Added padding */
}

    .nav-btn:hover {
        background: var(--primary-lighter);
        color: var(--primary);
    }

/* Theme Toggle */
.theme-toggle i {
    transition: var(--transition-fast);
}

/* Notification */
.notification-count {
    position: absolute;
    top: -2px; /* Reduced */
    left: -2px; /* Reduced */
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 16px; /* Reduced */
    height: 16px; /* Reduced */
    font-size: 0.65rem; /* Reduced */
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Profile - Compact */
.user-profile {
    position: relative;
}

.user-profile-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced */
    padding: 3px 6px; /* Reduced */
    border-radius: 18px; /* Slightly reduced */
    cursor: pointer;
    transition: var(--transition-fast);
}

    .user-profile-btn:hover {
        background: var(--primary-lighter);
    }

.user-avatar {
    width: 34px; /* Reduced */
    height: 34px; /* Reduced */
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem; /* Reduced */
    transition: var(--transition-fast);
}

    .user-avatar:hover {
        transform: scale(1.05);
    }

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.8rem; /* Reduced */
    color: var(--text);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem; /* Reduced */
    color: var(--text-light);
    line-height: 1.2;
}

.user-profile-btn i:last-child {
    font-size: 0.8rem; /* Reduced */
    color: var(--text-light);
}

/* User Dropdown Menu - Compact */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px); /* Reduced */
    left: 0;
    background: var(--white);
    border-radius: 10px; /* Reduced */
    box-shadow: var(--shadow-lg);
    width: 260px; /* Reduced */
    padding: 8px 0; /* Reduced */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px); /* Reduced */
    transition: all 0.15s ease;
    z-index: 1001;
    border: 1px solid var(--border);
}

    .user-dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.user-dropdown-header {
    padding: 12px 16px; /* Reduced */
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced */
}

.user-avatar-lg {
    width: 44px; /* Reduced */
    height: 44px; /* Reduced */
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.3rem; /* Reduced */
}

.user-dropdown-header h6 {
    margin: 0;
    font-size: 0.95rem; /* Reduced */
    color: var(--text);
    line-height: 1.3;
}

.user-dropdown-header small {
    color: var(--text-light);
    font-size: 0.75rem; /* Reduced */
    line-height: 1.3;
}

.dropdown-divider {
    height: 1px;
    background: var(--primary-lighter);
    margin: 8px 0; /* Reduced */
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced */
    padding: 8px 16px; /* Reduced */
    color: var(--text);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.9rem; /* Reduced */
    line-height: 1.4;
    margin: 2px 0; /* Added small margin */
}

    .dropdown-item:hover {
        background: var(--primary-lighter);
        margin: 2px 4px; /* Reduced margin on hover */
        border-radius: 6px;
    }

    .dropdown-item i {
        width: 18px; /* Reduced */
        text-align: center;
        font-size: 1rem; /* Reduced */
        color: var(--text-light);
    }

    .dropdown-item.logout {
        color: var(--danger);
    }

        .dropdown-item.logout i {
            color: var(--danger);
        }

    /* Compact Dropdown Items */
    .dropdown-item.small-item {
        padding: 6px 16px; /* Reduced */
        font-size: 0.85rem; /* Reduced */
        margin: 1px 0; /* Reduced */
    }

        .dropdown-item.small-item i {
            font-size: 0.9rem; /* Reduced */
        }

/* Section title in dropdown */
.nav-section-title {
    font-size: 0.8rem; /* Reduced */
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px; /* Reduced */
    margin-bottom: 12px; /* Reduced */
    padding-right: 10px;
}

/* Sidebar Menu - Compact */
.sidebar-menu {
    position: fixed;
    top: 60px; /* Matches navbar height */
    right: 0;
    width: 260px; /* Reduced */
    height: calc(100vh - 60px);
    background: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform 0.25s ease-in-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid var(--border);
}

    .sidebar-menu.open {
        transform: translateX(0);
    }

.sidebar-header {
    padding: 16px; /* Reduced */
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-title {
    margin: 0;
    font-size: 1rem; /* Reduced */
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced */
}

.sidebar-close-btn {
    background: none;
    border: none;
    width: 30px; /* Reduced */
    height: 30px; /* Reduced */
    border-radius: 6px; /* Reduced */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem; /* Reduced */
    padding: 4px; /* Added padding */
}

    .sidebar-close-btn:hover {
        background: var(--primary-lighter);
        color: var(--danger);
    }

/* Sidebar Navigation - Compact */
.sidebar-nav {
    flex: 1;
    padding: 16px; /* Reduced */
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px; /* Reduced */
}

.nav-section-title {
    font-size: 0.8rem; /* Reduced */
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px; /* Reduced */
    margin-bottom: 12px; /* Reduced */
    padding-right: 8px; /* Reduced */
}

.nav-item {
    margin-bottom: 4px; /* Reduced */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced */
    padding: 10px 12px; /* Reduced */
    color: var(--text);
    text-decoration: none;
    border-radius: 6px; /* Reduced */
    transition: all 0.15s ease;
    position: relative;
    margin: 2px 0; /* Added small margin */
}

    .nav-link:hover {
        background: var(--primary-lighter);
        color: var(--primary);
        transform: translateX(-3px); /* Reduced */
        margin: 2px 4px; /* Adjusted on hover */
    }

    .nav-link.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: var(--white) !important;
        box-shadow: 0 3px 8px rgba(27, 94, 122, 0.2); /* Reduced */
        font-weight: 600;
        margin: 2px 0; /* Keep same margin when active */
    }

    .nav-link i {
        font-size: 1.1rem; /* Reduced */
        width: 22px; /* Reduced */
        text-align: center;
    }

.nav-badge {
    margin-right: auto;
    padding: 2px 8px; /* Reduced */
    background: var(--primary-lighter);
    color: var(--text-light);
    border-radius: 10px; /* Reduced */
    font-size: 0.7rem; /* Reduced */
    font-weight: 600;
    transition: var(--transition-fast);
}

.nav-link.active .nav-badge {
    background: rgba(255, 255, 255, 0.25); /* Slightly more transparent */
    color: var(--white);
}

.nav-badge.new {
    background: var(--success);
    color: var(--white);
}

/* Sidebar Footer - Compact */
.sidebar-footer {
    padding: 16px; /* Reduced */
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced */
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Reduced */
    padding: 10px; /* Reduced */
    border: none;
    border-radius: 6px; /* Reduced */
    font-weight: 600;
    font-size: 0.85rem; /* Reduced */
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    margin: 2px 0; /* Added small margin */
}

    .quick-action-btn.primary {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: var(--white);
    }

        .quick-action-btn.primary:hover {
            transform: translateY(-1px); /* Reduced */
            box-shadow: 0 4px 12px rgba(27, 94, 122, 0.25); /* Reduced */
            margin: 2px 2px; /* Adjusted on hover */
        }

    .quick-action-btn.outline {
        background: none;
        border: 2px solid var(--primary-lighter);
        color: var(--text);
    }

        .quick-action-btn.outline:hover {
            border-color: var(--primary);
            color: var(--primary);
            margin: 2px 2px; /* Adjusted on hover */
        }

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 60px; /* Matches navbar height */
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Main Content Area - Compact */
.main-content {
    margin-top: 60px; /* Matches navbar height */
    padding: 16px; /* Reduced */
    min-height: calc(100vh - 60px);
    background: var(--bg-light);
    transition: var(--transition-normal);
}

/* Main Layout */
.main-layout {
    position: relative;
    min-height: 100vh;
    background: var(--bg-light);
}

/* Theme Implementation */
.theme-toggle {
    position: relative;
}

[data-theme="dark"] .theme-toggle i {
    color: var(--warning);
}

[data-theme="dark"] .top-navbar {
    background: var(--primary-dark);
    border-bottom-color: var(--primary);
}

[data-theme="dark"] .sidebar-menu {
    background: var(--primary-dark);
    border-left-color: var(--primary);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Focus States - Minimal */
.nav-btn:focus,
.user-profile-btn:focus,
.nav-link:focus,
.dropdown-item:focus,
.quick-action-btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px; /* Reduced */
}

/* Active Link Indicator - Minimal */
.nav-link.active::before {
    content: '';
    position: absolute;
    right: -16px; /* Reduced */
    top: 50%;
    transform: translateY(-50%);
    width: 3px; /* Reduced */
    height: 50%; /* Reduced */
    background: var(--secondary);
    border-radius: 2px;
}

/* Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px); /* Reduced */
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-menu.show {
    animation: fadeInDown 0.15s ease forwards;
}

/* Responsive Design */
@media (min-width: 992px) {
    .sidebar-menu {
        transform: translateX(0) !important;
        display: flex !important;
    }

    .navbar-toggler,
    .sidebar-close-btn,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-right: 260px; /* Matches sidebar width */
    }
}

@media (max-width: 991px) {
    .sidebar-menu {
        width: 100%;
        max-width: 300px; /* Reduced */
    }

    .brand-text {
        display: none;
    }

    .user-info {
        display: none;
    }

    .user-profile-btn i:last-child {
        display: none;
    }

    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 0 12px; /* Reduced */
    }

    .navbar-controls {
        gap: 6px; /* Reduced */
    }

    .nav-btn {
        width: 32px; /* Reduced */
        height: 32px; /* Reduced */
        font-size: 0.95rem; /* Reduced */
    }

    .user-avatar {
        width: 32px; /* Reduced */
        height: 32px; /* Reduced */
        font-size: 0.95rem; /* Reduced */
    }

    .user-profile-btn {
        padding: 2px 4px; /* Reduced */
    }

    .main-content {
        padding: 12px; /* Reduced */
    }
}

@media (max-width: 576px) {
    .top-navbar {
        padding: 0 8px; /* Reduced */
        height: 56px; /* Reduced */
    }

    .navbar-header {
        gap: 8px; /* Reduced */
    }

    .navbar-toggler {
        width: 32px; /* Reduced */
        height: 32px; /* Reduced */
        font-size: 1.2rem; /* Reduced */
    }

    .navbar-brand i {
        font-size: 1.3rem; /* Reduced */
    }

    .navbar-controls {
        gap: 4px; /* Reduced */
    }

    .nav-btn {
        width: 30px; /* Reduced */
        height: 30px; /* Reduced */
        font-size: 0.9rem; /* Reduced */
    }

    .user-avatar {
        width: 30px; /* Reduced */
        height: 30px; /* Reduced */
        font-size: 0.9rem; /* Reduced */
    }

    .sidebar-menu {
        top: 56px; /* Matches reduced navbar height */
        height: calc(100vh - 56px);
        max-width: 100%;
    }

    .nav-link span {
        font-size: 0.85rem; /* Reduced */
    }

    .main-content {
        margin-top: 56px; /* Matches reduced navbar height */
        padding: 10px; /* Reduced */
        min-height: calc(100vh - 56px);
    }
}

@media (max-width: 360px) {
    .navbar-brand i {
        font-size: 1.1rem; /* Reduced */
    }

    .user-avatar {
        width: 28px; /* Reduced */
        height: 28px; /* Reduced */
        font-size: 0.85rem; /* Reduced */
    }

    .nav-btn {
        width: 28px; /* Reduced */
        height: 28px; /* Reduced */
    }

    .sidebar-nav {
        padding: 12px; /* Reduced */
    }

    .nav-link {
        padding: 8px 10px; /* Reduced */
    }
}

/* Scrollbar Styling - Minimal */
.sidebar-nav::-webkit-scrollbar {
    width: 4px; /* Reduced */
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--primary-lighter);
    border-radius: 2px; /* Reduced */
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 2px; /* Reduced */
}

    .sidebar-nav::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }

/* Utility Classes */
.compact {
    margin: 0;
    padding: 0;
}

.no-margin {
    margin: 0 !important;
}

.no-padding {
    padding: 0 !important;
}

.small-margin {
    margin: 2px !important;
}

.small-padding {
    padding: 4px !important;
}

