/**
 * Navigation CSS für Wetterstation Bertingen
 * Vollständige responsive Navigation mit Mobile Menu
 * Version: 2.0 - Mobile Menu Fix
 */

/* Basis Navigation Container */
.navigation {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1;
    margin-bottom: 2rem;
}

.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* Entferne alle Listenpunkte */
.nav-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dropdown-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dropdown-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Desktop Navigation */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem 0;
        flex-wrap: wrap;
    }
    
    .nav-item {
        position: relative;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        text-decoration: none;
        color: #374151;
        font-weight: 500;
        border-radius: 0.5rem;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        white-space: nowrap;
    }
    
    .nav-link:hover {
        background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
        color: #2563eb;
        transform: translateY(-1px);
    }
    
    .nav-link.current {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: white;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    
    .nav-icon {
        font-size: 1.1em;
    }
    
    .dropdown-arrow {
        font-size: 0.8em;
        transition: transform 0.2s ease;
    }
    
    .dropdown:hover .dropdown-arrow,
    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    .external-icon {
        font-size: 0.9em;
        opacity: 0.7;
    }
    
    /* Desktop Dropdown Menu */
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        min-width: 220px;
        z-index: 1000;
        padding: 0.5rem 0;
        display: block;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }
    
    .dropdown-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1rem;
        color: #374151;
        text-decoration: none;
        transition: all 0.2s ease;
        font-weight: 500;
    }
    
    .dropdown-link:hover {
        background: linear-gradient(90deg, #f3f4f6, #e5e7eb);
        color: #2563eb;
        padding-left: 1.25rem;
    }
    
    .dropdown-link.current {
        background: linear-gradient(90deg, #dbeafe, #bfdbfe);
        color: #1d4ed8;
        font-weight: 600;
    }
    
    /* External Link Styling */
    .nav-item.external {
        margin-left: auto;
    }
    
    .nav-item.external .nav-link {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    }
    
    .nav-item.external .nav-link:hover {
        background: linear-gradient(135deg, #059669, #047857);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .main-nav {
        min-height: 60px;
        display: flex;
        align-items: center;
    }
    
    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: flex !important;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
        background: #3b82f6;
        border: 2px solid #1d4ed8;
        border-radius: 12px;
        padding: 0.75rem;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
        transition: all 0.3s ease;
        width: 48px;
        height: 48px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }
    
    .mobile-menu-toggle:hover {
        background: #1d4ed8;
        transform: translateY(-50%) scale(1.05);
    }
    
    .mobile-menu-toggle.active {
        background: #dc2626;
        border-color: #b91c1c;
    }
    
    .mobile-menu-toggle span {
        display: block;
        background: white;
        width: 22px;
        height: 3px;
        margin: 2px 0;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Hamburger Animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Mobile Menu */
    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 1001;
        padding: 6rem 2rem 2rem 2rem;
        overflow-y: auto;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    /* Mobile Navigation Items */
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 1.25rem 1.5rem;
        background: #f8fafc;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        color: #1e293b;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background: #e0f2fe;
        border-color: #0891b2;
        color: #0c4a6e;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
    }
    
    .nav-link.current {
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        border-color: #1d4ed8;
        color: white;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    
    .nav-icon {
        font-size: 1.3em;
        min-width: 1.5rem;
    }
    
    /* Mobile Dropdown */
    .dropdown-menu {
        display: none;
        background: #f1f5f9;
        border-radius: 8px;
        margin: 0.5rem 0 0 2rem;
        padding: 0.5rem;
        border: 1px solid #cbd5e1;
        width: calc(100% - 2rem);
        box-sizing: border-box;
    }
    
    .dropdown.active .dropdown-menu {
        display: block !important;
    }
    
    .dropdown-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
        color: #374151;
        text-decoration: none;
        font-weight: 500;
        border-radius: 6px;
        margin-bottom: 0.25rem;
        background: white;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;
        box-sizing: border-box;
    }
    
    .dropdown-link:last-child {
        margin-bottom: 0;
    }
    
    .dropdown-link:hover {
        background: #dbeafe;
        color: #1d4ed8;
        border-color: #93c5fd;
    }
    
    .dropdown-link.current {
        background: linear-gradient(90deg, #dbeafe, #bfdbfe);
        color: #1d4ed8;
        font-weight: 600;
        border-color: #3b82f6;
    }
    
    .dropdown-arrow {
        margin-left: auto;
        transition: transform 0.3s ease;
        font-size: 0.9em;
    }
    
    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* External Link Mobile */
    .nav-item.external {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px solid #e2e8f0;
    }
    
    .nav-item.external .nav-link {
        background: linear-gradient(135deg, #10b981, #059669);
        border-color: #059669;
        color: white;
    }
    
    .nav-item.external .nav-link:hover {
        background: linear-gradient(135deg, #059669, #047857);
        border-color: #047857;
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }
    
    .external-icon {
        font-size: 0.9em;
        opacity: 0.8;
    }
    
    /* Body scroll lock */
    body.mobile-menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Focus states for accessibility */
.nav-link:focus,
.dropdown-link:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* {
    -webkit-tap-highlight-color: transparent;
}

.nav-link,
.dropdown-link,
.mobile-menu-toggle {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Print styles */
@media print {
    .navigation {
        display: none;
    }
}

/* Mobile Burger Button - Oben Rechts Fix */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 9999 !important;
        transform: none !important;
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.05) !important;
    }
}
