/**
 * Mobile Menu Dark Mode Fix
 * Zorgt voor goede leesbaarheid op mobiele apparaten met dark mode
 */

/* Mobile menu specifieke fixes */
@media screen and (max-width: 768px) {
    /* Menu toggle button */
    .menu-toggle {
        background-color: var(--primary-accent);
        color: white;
        border: 2px solid transparent;
        padding: 10px 15px;
        border-radius: 4px;
        font-weight: 600;
    }

    .menu-toggle:hover,
    .menu-toggle:focus {
        background-color: var(--primary-color);
        border-color: white;
    }

    /* Mobile navigation container */
    .main-navigation {
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }

    .main-navigation ul {
        background-color: transparent;
    }

    .main-navigation li {
        border-bottom: 1px solid var(--border-color);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        color: var(--text-color);
        padding: 15px 20px;
        display: block;
        font-weight: 500;
    }

    .main-navigation a:hover,
    .main-navigation .current-menu-item > a {
        background-color: var(--primary-lightest);
        color: var(--primary-dark);
    }

    /* Submenu items */
    .main-navigation ul ul {
        background-color: var(--bg-light);
        margin-left: 0;
        border-left: 3px solid var(--primary-accent);
    }

    .main-navigation ul ul a {
        padding-left: 35px;
        font-size: 0.95rem;
    }
}

/* Dark mode specific mobile menu */
@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {
    .menu-toggle {
        background-color: var(--primary-dark);
        color: white;
        border: 2px solid var(--primary-light);
    }

    .menu-toggle:hover,
    .menu-toggle:focus {
        background-color: var(--primary-accent);
        border-color: var(--primary-light);
    }

    .main-navigation {
        background-color: var(--bg-light);
        border-color: var(--primary-dark);
    }

    .main-navigation li {
        border-bottom-color: var(--border-color);
    }

    .main-navigation a {
        color: var(--text-color);
    }

    .main-navigation a:hover,
    .main-navigation .current-menu-item > a {
        background-color: var(--primary-dark);
        color: white;
    }

    .main-navigation ul ul {
        background-color: var(--bg-dark);
        border-left-color: var(--primary-light);
    }

    /* Ensure contrast for menu icons */
    .main-navigation .dashicons {
        color: var(--primary-light);
    }

    .main-navigation a:hover .dashicons {
        color: white;
    }
}

/* Hamburger menu icon styling */
.menu-toggle .menu-icon {
    display: inline-block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: background-color 0.3s;
}

.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.3s;
}

.menu-toggle .menu-icon::before {
    top: -6px;
}

.menu-toggle .menu-icon::after {
    bottom: -6px;
}

/* Animate hamburger to X when menu is open */
.menu-toggle.toggled .menu-icon {
    background-color: transparent;
}

.menu-toggle.toggled .menu-icon::before {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.toggled .menu-icon::after {
    transform: translateY(-6px) rotate(-45deg);
}

/* Additional fixes for header in mobile dark mode */
@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {
    .site-header {
        background: var(--primary-darker);
        border-bottom: 1px solid var(--primary-dark);
    }

    .site-branding {
        color: white;
    }

    .site-title a {
        color: white;
    }

    .site-description {
        color: rgba(255, 255, 255, 0.8);
    }

    /* Contact info in header */
    .header-contact {
        color: var(--text-color);
        background-color: rgba(0, 0, 0, 0.2);
        padding: 10px;
        border-radius: 4px;
    }

    .header-contact a {
        color: var(--primary-light);
    }

    .header-contact a:hover {
        color: white;
    }
}

/* Ensure announcement bar is readable */
@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {
    .announcements-bar {
        background-color: var(--primary-darker);
        color: white;
        border-bottom: 1px solid var(--primary-dark);
    }

    .announcements-bar a {
        color: var(--primary-light);
    }
}

/* Quick links in header for mobile */
@media screen and (max-width: 768px) {
    .quick-links {
        background-color: rgba(255, 255, 255, 0.05);
        padding: 10px;
        border-radius: 4px;
        margin: 10px 0;
    }

    .quick-links a {
        color: white;
        padding: 5px 10px;
        display: inline-block;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        margin: 2px;
    }

    .quick-links a:hover {
        background-color: var(--primary-accent);
    }
}

@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {
    .quick-links {
        background-color: rgba(0, 0, 0, 0.2);
    }

    .quick-links a {
        background-color: var(--primary-dark);
        color: var(--text-color);
    }

    .quick-links a:hover {
        background-color: var(--primary-accent);
        color: white;
    }
}

/* Fix for iOS specific dark mode issues */
@supports (-webkit-touch-callout: none) {
    @media (prefers-color-scheme: dark) {
        .main-navigation {
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
            background-color: var(--bg-light) !important;
        }

        .main-navigation a {
            -webkit-tap-highlight-color: transparent;
            color: var(--text-color) !important;
        }
    }
}