/**
 * Navigation Menu Styles
 * Styling for the main navigation bar and dropdown menus
 */

/* ========================================
   Cursor and Interaction States
   ======================================== */
.cursor-default {
    cursor: default;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.opacity-50 {
    opacity: 0.5;
}

/* ========================================
   Nav Section Specific
   ======================================== */
.nav-section-arrow {
    margin-left: auto;
}

.nav-section-divider {
    border-top: 1px solid #dee2e6;
    margin: 0.5rem 0;
}

/* ========================================
   Dev Tools Section
   ======================================== */
.dev-tools-placeholder {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
}

.dev-tools-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ========================================
   Logo and Avatar
   ======================================== */
.navbar-logo {
    height: 30px;
    margin-right: 10px;
}

.navbar-user-link {
    color: white !important;
    text-decoration: none !important;
}

.navbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
}

.navbar-user-icon {
    font-size: 1.2rem;
}

.navbar-dropdown-menu {
    min-width: 200px;
}

/* ========================================
   Main Navigation Bar
   ======================================== */
.navbar {
    background-color: #1e293b;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 999999; /* Highest z-index to ensure navbar is always on top */
}

.navbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.navbar-brand {
    color: #fff !important;
    font-weight: 600;
    padding: 1rem 1.5rem;
    margin-right: 0;
}

/* ========================================
   Navigation Menu
   ======================================== */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    margin-left: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #cbd5e1 !important;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #334155;
    color: #fff !important;
}

.nav-link.active {
    background-color: #3b82f6;
    color: #fff !important;
}

/* ========================================
   Dropdown Menu
   ======================================== */
.nav-dropdown {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    border-radius: 0 0 12px 12px;
    min-width: 400px;
    z-index: 999998; /* One level below navbar but above everything else */
    border: 1px solid #9ca3af;
    padding-top: 0.75rem;
}

.nav-item.show .nav-dropdown {
    display: block !important;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Custom scrollbar styling for dropdown */
.nav-dropdown::-webkit-scrollbar {
    width: 1px; /* ultra-thin scrollbar */
}

.nav-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.nav-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 1px;
}

.nav-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Firefox (and compatible) scrollbar styling */
.nav-dropdown {
    scrollbar-width: thin; /* makes scrollbar thinner in Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent; /* thumb and track */
}

/* ========================================
   Dropdown Items
   ======================================== */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.nav-dropdown-item:hover {
    background-color: #9ca3af;
    color: #ffffff;
}

/* Level 1 Menu Styling */
.nav-dropdown-item.nav-level-1 {
    background-color: #6b7280 !important;
    color: #f3f4f6 !important;
    font-weight: 600 !important;
    cursor: default !important;
    margin-bottom: 0.5rem !important;
}

.nav-dropdown-item.nav-level-1:hover {
    background-color: #6b7280 !important;
    color: #f3f4f6 !important;
    transform: none !important;
}

.nav-dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

.nav-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

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

/* ========================================
   Menu Sections
   ======================================== */
.nav-dropdown-section {
    padding: 0 0 0.5rem 0;
}

.nav-dropdown-subitem {
    padding-left: 3rem !important;
    margin: 0.25rem 0.5rem;
    border-radius: 6px;
}

.nav-dropdown-subitem:hover {
    padding-left: 3.5rem !important;
    background-color: #9ca3af;
    color: #ffffff;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

/* ========================================
   Active Menu Styling
   ======================================== */
.active-menu {
    background-color: #d1d5db !important;
    color: #1f2937 !important;
    font-weight: 600;
    /* pointer-events: none; removed to allow clicking on active menu */
}

.active-menu i {
    color: #1f2937 !important;
}

/* ========================================
   Nested Collapse Styles
   ======================================== */
.nav-section-content {
    display: block;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-section-content.collapsed {
    display: none !important;
}

.nav-section-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-section-arrow.rotated {
    transform: rotate(-90deg);
}

.nav-dropdown-header:hover {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

/* ========================================
   Subsection Styles
   ======================================== */
.nav-subsection-content {
    display: block;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.03);
    margin-left: 1.5rem;
    padding: 0.5rem 0 0.5rem 0.5rem;
    border-left: 3px solid #cbd5e1;
    border-radius: 0 0 0 8px;
}

.nav-subsection-content.collapsed {
    display: none !important;
}

.nav-subsection-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
    font-size: 0.8rem;
}

.nav-subsection-arrow.rotated {
    transform: rotate(-90deg);
}

/* ========================================
   Sub-sub Items (3rd level)
   ======================================== */
.nav-subsection-content .nav-dropdown-subsubitem {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem 0.6rem 4rem !important;
    margin: 0.2rem 0.3rem !important;
    border-radius: 6px;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-subsection-content a.nav-dropdown-subsubitem,
.nav-subsection-content span.nav-dropdown-subsubitem {
    padding-left: 4rem !important;
}

.nav-subsection-content .nav-dropdown-subsubitem:hover {
    padding-left: 4.5rem !important;
    background-color: #9ca3af;
    color: #ffffff;
}

.nav-subsection-content .nav-dropdown-subsubitem.active-menu {
    background-color: #d1d5db !important;
    color: #1f2937 !important;
    font-weight: 600;
    /* pointer-events: none; removed to allow clicking on active menu */
    padding-left: 4rem !important;
}

.nav-subsection-content .nav-dropdown-subsubitem i {
    width: 18px;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}
