/**
 * Dokan Dashboard Menu Custom Styling
 * Custom styles for the Bevesi theme
 */

/* Main menu container */
.dokan-dashboard-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Menu items */
.dokan-dashboard-menu li {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.dokan-dashboard-menu li:last-child {
    border-bottom: none;
}

/* Menu links */
.dokan-dashboard-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.dokan-dashboard-menu li a:hover {
    background-color: #f8f9fa;
    color: #007cba;
    transform: translateX(5px);
}

/* Active menu item */
.dokan-dashboard-menu li.active a {
    background-color: #007cba;
    color: #ffffff;
    font-weight: 600;
}

.dokan-dashboard-menu li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #005a87;
}

/* Icons */
.dokan-dashboard-menu .fas,
.dokan-dashboard-menu .far,
.dokan-dashboard-menu .fab {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Submenu styling */
.dokan-dashboard-menu .navigation-submenu {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dokan-dashboard-menu .navigation-submenu li {
    border-bottom: 1px solid #e9ecef;
}

.dokan-dashboard-menu .navigation-submenu li:last-child {
    border-bottom: none;
}

.dokan-dashboard-menu .navigation-submenu li a {
    padding: 12px 20px 12px 50px;
    font-size: 14px;
    color: #666666;
}

.dokan-dashboard-menu .navigation-submenu li a:hover {
    background-color: #e9ecef;
    color: #007cba;
}

.dokan-dashboard-menu .navigation-submenu li.current a {
    background-color: #e3f2fd;
    color: #007cba;
    font-weight: 600;
}

/* Dropdown arrow */
.dokan-dashboard-menu .menu-dropdown {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.dokan-dashboard-menu li.has-submenu:hover .menu-dropdown {
    transform: rotate(90deg);
}

/* Common links section */
.dokan-dashboard-menu .dokan-common-links {
    background-color: #f8f9fa;
    border-top: 2px solid #e9ecef;
    padding: 15px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.dokan-dashboard-menu .dokan-common-links a {
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #ffffff;
    color: #666666;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.dokan-dashboard-menu .dokan-common-links a:hover {
    background-color: #007cba;
    color: #ffffff;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

/* Mobile Slide Menu Implementation */
@media (max-width: 768px) {
    /* Hide the regular menu on mobile */
    .dokan-dashboard-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding-top: 60px;
    }
    
    /* Show menu when active */
    .dokan-dashboard-menu.mobile-menu-open {
        left: 0;
    }
    
    /* Mobile menu header */
    .dokan-dashboard-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 60px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        z-index: 10000;
        transition: left 0.3s ease-in-out;
        display: flex;
        align-items: center;
        padding: 0 20px;
    }
    
    .dokan-dashboard-menu.mobile-menu-open::before {
        left: 0;
    }
    
    /* Mobile menu header content */
    .dokan-dashboard-menu::after {
        content: 'MatDash';
        position: fixed;
        top: 20px;
        left: -100%;
        color: #ffffff;
        font-size: 20px;
        font-weight: 600;
        z-index: 10001;
        transition: left 0.3s ease-in-out;
        padding-left: 20px;
    }
    
    .dokan-dashboard-menu.mobile-menu-open::after {
        left: 0;
    }
    
    /* Mobile menu items */
    .dokan-dashboard-menu li {
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }
    
    .dokan-dashboard-menu li a {
        padding: 15px 20px;
        font-size: 16px;
        display: flex;
        align-items: center;
        color: #333;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .dokan-dashboard-menu li a:hover {
        background-color: #f8f9fa;
        color: #667eea;
        transform: translateX(5px);
    }
    
    .dokan-dashboard-menu li.active a {
        background-color: #667eea;
        color: #ffffff;
    }
    
    /* Mobile submenu */
    .dokan-dashboard-menu .navigation-submenu {
        background-color: #f8f9fa;
        border-top: 1px solid #e9ecef;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dokan-dashboard-menu .navigation-submenu.show {
        max-height: 500px;
    }
    
    .dokan-dashboard-menu .navigation-submenu li a {
        padding: 12px 20px 12px 50px;
        font-size: 14px;
        color: #666;
    }
    
    .dokan-dashboard-menu .navigation-submenu li a:hover {
        background-color: #e9ecef;
        color: #667eea;
    }
    
    /* Mobile icons */
    .dokan-dashboard-menu .fas,
    .dokan-dashboard-menu .far,
    .dokan-dashboard-menu .fab {
        margin-right: 15px;
        font-size: 18px;
        width: 20px;
        text-align: center;
    }
    
    /* Mobile common links */
    .dokan-dashboard-menu .dokan-common-links {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 0;
        margin: 0;
        padding: 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .dokan-dashboard-menu .dokan-common-links a {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
        border-radius: 6px;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .dokan-dashboard-menu .dokan-common-links a:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
    }
    
    .dokan-dashboard-menu .dokan-common-links a i {
        margin-right: 10px;
        font-size: 16px;
    }
    
    /* Mobile overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile hamburger button - hide the duplicate one */
    .mobile-hamburger {
        display: none;
    }
    
    /* Use the one from mobile header instead */
    .bevesi-mobile-header .mobile-hamburger {
        display: flex;
        position: static;
        z-index: auto;
    }
    
    /* Mobile close button */
    .mobile-menu-close {
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 10001;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        color: #ffffff;
        font-size: 24px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close:hover {
        color: #f0f0f0;
    }
}

/* Custom menu item specific styling */
.dokan-dashboard-menu li.reports a {
    /* Specific styling for reports menu item */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.dokan-dashboard-menu li.reports a:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateX(5px) scale(1.02);
}

/* Animation for menu items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dokan-dashboard-menu li {
    animation: slideIn 0.3s ease forwards;
}

.dokan-dashboard-menu li:nth-child(1) { animation-delay: 0.1s; }
.dokan-dashboard-menu li:nth-child(2) { animation-delay: 0.2s; }
.dokan-dashboard-menu li:nth-child(3) { animation-delay: 0.3s; }
.dokan-dashboard-menu li:nth-child(4) { animation-delay: 0.4s; }
.dokan-dashboard-menu li:nth-child(5) { animation-delay: 0.5s; }
.dokan-dashboard-menu li:nth-child(6) { animation-delay: 0.6s; }

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dokan-dashboard-menu {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .dokan-dashboard-menu li {
        border-bottom-color: #4a5568;
    }
    
    .dokan-dashboard-menu li a {
        color: #e2e8f0;
    }
    
    .dokan-dashboard-menu li a:hover {
        background-color: #4a5568;
        color: #63b3ed;
    }
    
    .dokan-dashboard-menu li.active a {
        background-color: #3182ce;
        color: #ffffff;
    }
    
    .dokan-dashboard-menu .navigation-submenu {
        background-color: #4a5568;
    }
    
    .dokan-dashboard-menu .navigation-submenu li a {
        color: #a0aec0;
    }
    
    .dokan-dashboard-menu .navigation-submenu li a:hover {
        background-color: #2d3748;
        color: #63b3ed;
    }
}
