/* 
 * Mobile Navigation Optimization for OzSparkHub
 * =============================================
 * Inspired by Butterfly theme - simple and clean mobile navigation
 */

/* ========== Mobile Navigation (< 769px) ========== */
@media screen and (max-width: 768px) {
    /* Hide desktop navigation items on mobile */
    .navbar-menu {
        display: none !important;
    }
    
    /* Show hamburger menu on mobile */
    .navbar-burger {
        display: flex !important;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        width: 3.25rem;
        height: 3.25rem;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    
    .navbar-burger span {
        display: block;
        height: 2px;
        width: 20px;
        background-color: currentColor;
        margin: 2px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    /* Active state for hamburger */
    .navbar-burger.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .navbar-burger.is-active span:nth-child(2) {
        opacity: 0;
    }
    
    .navbar-burger.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Mobile menu overlay */
    .navbar-menu.is-active {
        display: block !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--background-color, #fff);
        z-index: 999;
        overflow-y: auto;
        padding: 1rem;
    }
    
    /* Mobile menu items - prevent crowding */
    .navbar-menu.is-active .navbar-item {
        display: block;
        padding: 1rem 1.5rem;  /* More padding to prevent crowding */
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 1rem;  /* Slightly smaller font for more space */
        line-height: 1.5;
        margin: 0;  /* Reset any margins */
    }
    
    /* Center logo on mobile */
    .navbar-brand {
        justify-content: center;
        flex-grow: 1;
    }
    
    /* Remove pseudo element on mobile */
    .navbar-brand::after {
        display: none !important;
    }
}

/* ========== Tablet Navigation (769px - 1087px) ========== */
@media screen and (min-width: 769px) and (max-width: 1087px) {
    /* Show navigation menu */
    .navbar-menu {
        display: flex !important;
    }
    
    /* Hide hamburger on tablet */
    .navbar-burger {
        display: none !important;
    }
    
    /* Adapt navbar to inherit page background naturally */
    .navbar,
    .navbar-main {
        background-color: transparent !important;
        backdrop-filter: none;  /* Remove any blur effects */
    }
    
    /* Ensure text color adapts to background */
    .navbar-item,
    .navbar-item a {
        color: inherit !important;
    }
    
    /* On dark backgrounds, ensure white text */
    .hero.is-dark .navbar-item,
    .hero.is-primary .navbar-item {
        color: #ffffff !important;
    }
    
    /* On light backgrounds, ensure dark text */
    .hero.is-light .navbar-item,
    .hero.is-white .navbar-item {
        color: #363636 !important;
    }
}

/* ========== Desktop Navigation (≥ 1088px) ========== */
@media screen and (min-width: 1088px) {
    /* Full navbar display */
    .navbar-menu {
        display: flex !important;
    }
    
    /* Hide hamburger on desktop */
    .navbar-burger {
        display: none !important;
    }
}

/* ========== Mobile Simplification ========== */
/* Remove dark mode toggle on mobile for simplicity */
@media screen and (max-width: 768px) {
    .theme-toggle {
        display: none !important;
    }
    
    /* Force light theme on mobile - override any dark theme */
    html[data-theme="dark"],
    body {
        background-color: #ffffff !important;
        color: #363636 !important;
    }
    
    /* Override any dark theme variables */
    html {
        --bg-primary: #ffffff !important;
        --bg-secondary: #f5f5f5 !important;
        --text-primary: #363636 !important;
        --text-secondary: #4a4a4a !important;
    }
    
    .navbar,
    .navbar-main {
        background-color: transparent !important;
    }
    
    .navbar-menu.is-active {
        background-color: #ffffff !important;
    }
    
    .navbar-menu.is-active .navbar-item {
        color: #363636 !important;
        border-bottom-color: rgba(0, 0, 0, 0.05) !important;
    }
    
    /* Ensure all sections have light background */
    .section,
    .container,
    .content {
        background-color: transparent !important;
    }
}

/* ========== Remove conflicting styles ========== */
@media screen and (max-width: 768px) {
    /* Override the grid layout that was causing issues */
    .navbar-main {
        display: flex !important;
        grid-template-areas: none !important;
        grid-template-columns: none !important;
    }
    
    .navbar-menu {
        grid-area: unset !important;
        flex-direction: column !important;
        width: 100% !important;
    }
}