/* Menu Bar Styles */
.menu-bar {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    position: relative;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.menu-items {
    display: flex;
    align-items: center;
}

.menu-item {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.menu-item > span {
    display: block;
    padding: 12px 16px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.menu-item:hover > span {
    background: #f8f9fa;
    color: #212529;
    border-bottom-color: #667eea;
}

.menu-item.active > span {
    background: #e9ecef;
    color: #212529;
    border-bottom-color: #667eea;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.menu-item:hover .dropdown-menu,
.menu-item.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-section {
    padding: 8px 0;
}

.menu-section:first-child {
    padding-top: 12px;
}

.menu-section:last-child {
    padding-bottom: 12px;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    gap: 10px;
    position: relative;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: #212529;
}

.dropdown-menu a i {
    width: 16px;
    font-size: 12px;
    color: #6c757d;
}

.dropdown-menu a:hover i {
    color: #495057;
}

.shortcut {
    margin-left: auto;
    font-size: 11px;
    color: #6c757d;
    font-weight: 400;
}

.menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

/* Submenu Support */
.dropdown-menu .has-submenu::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    font-size: 10px;
    color: #6c757d;
}

.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 4px;
}

/* Menu Item States */
.dropdown-menu a.disabled {
    color: #adb5bd;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-menu a.checked::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 16px;
    font-size: 10px;
    color: #28a745;
}

.dropdown-menu a.checked {
    padding-left: 36px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.15s ease;
}

.context-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.context-menu .menu-section {
    padding: 4px 0;
}

.context-menu a {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    color: #495057;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
    gap: 8px;
}

.context-menu a:hover {
    background: #f8f9fa;
    color: #212529;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .menu-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .menu-items {
        min-width: max-content;
    }
    
    .menu-item > span {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .dropdown-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 300px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .menu-item:hover .dropdown-menu,
    .menu-item.active .dropdown-menu {
        transform: translate(-50%, -50%);
    }
    
    .shortcut {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .menu-bar {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .menu-item > span {
        color: #e2e8f0;
    }
    
    .menu-item:hover > span {
        background: #4a5568;
        color: #ffffff;
    }
    
    .dropdown-menu {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .dropdown-menu a {
        color: #e2e8f0;
    }
    
    .dropdown-menu a:hover {
        background: #4a5568;
        color: #ffffff;
    }
    
    .menu-divider {
        background: #4a5568;
    }
    
    .shortcut {
        color: #a0aec0;
    }
}

/* Animation Classes */
.menu-slide-in {
    animation: menuSlideIn 0.2s ease-out;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-fade-out {
    animation: menuFadeOut 0.15s ease-in;
}

@keyframes menuFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* Accessibility */
.menu-item:focus-within > span {
    background: #f8f9fa;
    color: #212529;
    border-bottom-color: #667eea;
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

.dropdown-menu a:focus {
    background: #e9ecef;
    color: #212529;
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .menu-bar {
        border-bottom: 2px solid #000;
    }
    
    .menu-item > span {
        border-bottom-width: 4px;
    }
    
    .dropdown-menu {
        border: 2px solid #000;
    }
    
    .menu-divider {
        background: #000;
        height: 2px;
    }
}
