/* Mobile Menu Styles */

.mobile-menu-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.mobile-menu-container[data-position="fixed"] {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.mobile-menu-container[data-position="relative"] {
    position: relative;
}

.mobile-menu-container[data-position="absolute"] {
    position: absolute;
}

/* Menu Toggle Button */
.mobile-menu-toggle {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 50%;
    cursor: pointer;
    padding: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: #f8f9fa;
    border-color: #2979ff;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.25);
}

.mobile-menu-toggle.active {
    background: #2979ff;
    border-color: #2979ff;
    color: white;
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-sidebar.active {
    left: 0;
}

/* Sidebar Header */
.mobile-menu-header {
    background: linear-gradient(135deg, #2979ff 0%, #1e88e5 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Menu Content */
.mobile-menu-content {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

/* Menu Items */
.mobile-menu-content .menu-item {
    position: relative;
    margin: 0 15px 5px 15px;
}

.mobile-menu-content .menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 48px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.mobile-menu-content .menu-item a:hover {
    background: #f8f9fa;
    color: #2979ff;
    text-decoration: none;
}

.mobile-menu-content .menu-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #2979ff;
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.mobile-menu-content .menu-item a:hover::before {
    transform: scaleY(1);
}

/* Icons */
.mobile-menu-content .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.mobile-menu-content .icon.blue { 
    background: #e3f2fd; 
    color: #2979ff; 
}

.mobile-menu-content .icon.green { 
    background: #e8f5e9; 
    color: #43a047; 
}

.mobile-menu-content .icon.orange { 
    background: #fff3e0; 
    color: #fb8c00; 
}

.mobile-menu-content .icon.purple { 
    background: #f3e5f5; 
    color: #8e24aa; 
}

.mobile-menu-content .icon.red { 
    background: #ffebee; 
    color: #e53935; 
}

/* Submenu */
.mobile-menu-content .submenu {
    display: none;
    padding-left: 20px;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 5px 0;
}

.mobile-menu-content .menu-item.active > a {
    color: #2979ff;
    background: #e3f2fd;
}

.mobile-menu-content .menu-item.active > a .menu-toggle {
    transform: rotate(180deg);
}

.mobile-menu-content .menu-item.active > .submenu {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.mobile-menu-content .submenu .menu-item a {
    padding: 10px 15px;
    font-size: 14px;
    height: auto;
    min-height: 40px;
}

/* Menu Toggle for Submenu */
.mobile-menu-content .menu-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #333;
    transition: all 0.3s ease;
    z-index: 3;
    font-size: 12px;
}

.mobile-menu-content .menu-item.active > .menu-toggle {
    background: #2979ff;
    color: white;
    border-radius: 0 8px 8px 0;
}

.mobile-menu-content .menu-toggle:hover {
    background: #2979ff;
    color: white;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    background: rgba(41, 121, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-sidebar {
        width: 280px;
        left: -280px;
    }
    
    .mobile-menu-container[data-position="fixed"] {
        top: 15px;
        left: 15px;
    }
    
    .mobile-menu-toggle {
        padding: 10px;
    }
    
    .mobile-menu-header {
        padding: 15px;
    }
    
    .mobile-menu-header h3 {
        font-size: 1.2em;
    }
    
    .mobile-menu-content {
        padding: 15px 0;
    }
    
    .mobile-menu-content .menu-item {
        margin: 0 10px 5px 10px;
    }
    
    .mobile-menu-content .menu-item a {
        padding: 10px 12px;
        font-size: 14px;
        height: 44px;
    }
    
    .mobile-menu-content .icon {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .mobile-menu-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .mobile-menu-content .menu-item {
        margin: 0 15px 5px 15px;
    }
}

/* Custom Scrollbar */
.mobile-menu-sidebar::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-menu-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.mobile-menu-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for menu items */
.mobile-menu-content .menu-item {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.3s ease forwards;
}

.mobile-menu-content .menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-content .menu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-content .menu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-content .menu-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-content .menu-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-content .menu-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-content .menu-item:nth-child(7) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hide on desktop if needed */
@media (min-width: 1025px) {
    .mobile-menu-container.hide-desktop {
        display: none;
    }
}
