/**
 * Mega-Menü CSS Erweiterung für Kontinente Navigator
 * 
 * Minimal-invasive CSS-Erweiterung für WordPress-Menü-Funktionalität
 * Baut auf den bestehenden Plugin-Styles auf
 */

/* Basis-Mega-Menü Container */
.kontinente-mega-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.kontinente-mega-menu .mega-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

/* Kontinente Menu Items */
.menu-item-continent {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-item-continent > a.continent-trigger {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.menu-item-continent > a.continent-trigger:hover {
    background: #f8f9fa;
    color: #007bff;
}

/* Mega-Dropdown */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e1e5e9;
    display: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Hover-Verhalten */
.menu-item-continent:hover .mega-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega-Dropdown Content */
.mega-dropdown .kontinente-navigator {
    margin: 0;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-dropdown .kontinente-container {
    gap: 30px;
}

.mega-dropdown .kontinent-wrapper {
    background: transparent;
    box-shadow: none;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
}

.mega-dropdown .kontinent-title {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2c3e50;
}

.mega-dropdown .laender-menu {
    max-height: 200px;
    overflow-y: auto;
}

.mega-dropdown .land-item a {
    padding: 6px 0;
    font-size: 14px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kontinente-mega-menu .mega-menu-list {
        flex-direction: column;
        width: 100%;
    }
    
    .mega-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #ffffff;
        overflow-y: auto;
        transform: translateX(100%);
        z-index: 9999;
    }
    
    .menu-item-continent:hover .mega-dropdown {
        transform: translateX(0);
    }
    
    .mega-dropdown .kontinente-navigator {
        padding: 60px 20px 40px;
    }
    
    .mega-dropdown .kontinente-container {
        flex-direction: column;
    }
    
    /* Mobile Close Button */
    .mega-dropdown::before {
        content: "✕ Schließen";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50px;
        background: #ffffff;
        border-bottom: 1px solid #e1e5e9;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        cursor: pointer;
        z-index: 10000;
    }
}

/* Fallback wenn kein Menü zugewiesen */
.mega-menu-fallback {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    color: #6c757d;
}

.mega-menu-fallback p {
    margin: 0 0 10px 0;
}

.mega-menu-fallback a {
    color: #007bff;
    text-decoration: none;
}

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

/* Integration mit bestehenden Plugin-Styles */
.mega-dropdown .kontinente-navigator.kn-desktop .kontinente-container,
.mega-dropdown .kontinente-navigator.kn-mobile .kontinente-container {
    /* Bestehende responsive Logik beibehalten */
}

/* Loading-State */
.mega-dropdown.loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-dropdown.loading::after {
    content: "Lade...";
    color: #6c757d;
    font-style: italic;
}

/* Performance-Optimierung */
.mega-dropdown * {
    box-sizing: border-box;
}

/* Accessibility */
.menu-item-continent > a.continent-trigger:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mega-dropdown,
    .menu-item-continent > a.continent-trigger {
        transition: none;
    }
}