/* Menu Manager - Frontend Menu Styles */

/* Main menu container */
.menu-manager-menu {
    background: #f8f8f8;
    border-right: 1px solid #eaeaea;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

/* Menu category styling */
.menu-category {
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
}

.menu-category-header {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: normal;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    /* Ensure white text on colored background for category headers */
    color: white !important;
}

.menu-category-header:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.menu-category-header i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.menu-category-header .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.menu-category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* Menu items container */
.menu-items {
    background: white;
    border-bottom: 1px solid #eaeaea;
    transition: max-height 0.3s ease;
    overflow: hidden;
    /* Reset text color for menu items to prevent inheritance from category */
    color: #333 !important;
}

.menu-category.collapsed .menu-items {
    max-height: 0;
}

/* Individual menu item */
.menu-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #333 !important;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.menu-item a:hover {
    color: #79aec8;
    text-decoration: none;
}

.menu-item a:focus {
    outline: 2px solid #79aec8;
    outline-offset: -2px;
}

/* Menu item icons */
.menu-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #666 !important;
    font-size: 14px;
}

.menu-item:hover i {
    color: #79aec8;
}

/* Menu badges/counters */
.menu-badge {
    background: #79aec8;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

.menu-badge.zero {
    background: #ccc;
}

/* Submenu styling */
.menu-item.has-submenu > a {
    position: relative;
}

.submenu-indicator {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.menu-item.expanded .submenu-indicator {
    transform: rotate(180deg);
}

.submenu {
    background: #f9f9f9;
    border-left: 3px solid #79aec8;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-item.expanded .submenu {
    max-height: 500px;
}

.submenu .menu-item a {
    padding-left: 32px;
    font-size: 12px;
    color: #555 !important;
}

.submenu .menu-item:hover a {
    color: #79aec8;
    background-color: rgba(121, 174, 200, 0.1);
}

/* Menu divider */
.menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 16px;
}

/* Active menu item */
.menu-item.active > a {
    background-color: #79aec8;
    color: white;
    font-weight: bold;
}

.menu-item.active > a i {
    color: white;
}

.menu-item.active .menu-badge {
    background: white;
    color: #79aec8;
}

/* Breadcrumb styling */
.menu-breadcrumb {
    padding: 10px 16px;
    background: #f0f8ff;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

.menu-breadcrumb a {
    color: #79aec8;
    text-decoration: none;
}

.menu-breadcrumb a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .menu-manager-menu {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .menu-manager-menu.mobile-open {
        left: 0;
    }

    .menu-category-header {
        padding: 12px 16px;
        font-size: 16px;
    }

    .menu-item a {
        padding: 10px 16px;
        font-size: 14px;
    }

    .submenu .menu-item a {
        padding-left: 40px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .menu-manager-menu {
        background: #2b2b2b;
        border-right-color: #444;
    }

    .menu-items {
        background: #333;
        border-bottom-color: #444;
    }

    .menu-item {
        border-bottom-color: #444;
    }

    .menu-item:hover {
        background-color: #404040;
    }

    .menu-item a {
        color: #e0e0e0;
    }

    .menu-item:hover a {
        color: #81d4fa;
    }

    .menu-item i {
        color: #bbb;
    }

    .menu-item:hover i {
        color: #81d4fa;
    }

    .submenu {
        background: #2a2a2a;
        border-left-color: #81d4fa;
    }

    .submenu .menu-item a {
        color: #ccc;
    }

    .submenu .menu-item:hover a {
        color: #81d4fa;
        background-color: rgba(129, 212, 250, 0.1);
    }

    .menu-divider {
        background: #555;
    }

    .menu-breadcrumb {
        background: #1e1e1e;
        border-bottom-color: #444;
        color: #ccc;
    }

    .menu-breadcrumb a {
        color: #81d4fa;
    }
}

/* Animation for menu loading */
.menu-manager-menu.loading {
    opacity: 0.7;
}

.menu-manager-menu.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #79aec8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print styles */
@media print {
    .menu-manager-menu {
        display: none;
    }
}
