/**
 * Accordion Menu CSS
 * Simplified version for iPad (875x1225) and tablets
 */

/* Hide/Show menu toggle based on screen size */
.menu-toggle {
    display: none;
}

/* iPad and tablets - Show accordion menu */
@media screen and (max-width: 1024px) {
    /* Show menu toggle button */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        background: #049a54;
        color: white;
        border: none;
        padding: 0;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .menu-toggle:hover {
        background: #038242;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .menu-toggle:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .menu-toggle-icon {
        display: flex;
        flex-direction: column;
        width: 24px;
        gap: 4px;
    }
    
    .menu-toggle-icon span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Hamburger animation */
    .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Navigation wrapper - hidden by default */
    .navigation-wrapper {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 9999;
        overflow: hidden;
    }
    
    /* Show navigation when active */
    .main-navigation.active .navigation-wrapper {
        display: block;
    }
    
    /* Menu styles */
    .main-navigation ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: block !important;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        background: transparent;
        transition: background-color 0.3s ease;
    }
    
    .main-navigation a:hover {
        background-color: #f8f8f8;
        color: #049a54;
    }
    
    /* Menu item arrow */
    .menu-item-arrow {
        display: inline-block;
        font-size: 20px;
        color: #999;
    }
    
    /* Special styling for logout */
    .menu-item-logout a {
        color: #dc3545;
        background-color: #fff5f5;
    }
    
    .menu-item-logout a:hover {
        background-color: #ffe0e0;
    }
}

/* Desktop - Normal horizontal menu */
@media screen and (min-width: 1025px) {
    .navigation-wrapper {
        display: block !important;
        position: static;
        background: transparent;
        box-shadow: none;
    }
    
    .main-navigation ul {
        display: flex;
        gap: 2rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .main-navigation li {
        border: none;
    }
    
    .main-navigation a {
        padding: 0.5rem 0;
        color: #333;
        text-decoration: none;
        font-weight: 500;
    }
    
    .main-navigation a:hover {
        color: #049a54;
        background: transparent;
    }
    
    .menu-item-arrow {
        display: none !important;
    }
    
    .menu-item-logout a {
        color: #721c24;
        background: transparent;
    }
    
    .menu-item-logout a:hover {
        color: #a91e2e;
        background: transparent;
    }
}

/* iPad specific adjustments */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .main-navigation {
        position: relative;
    }
    
    .navigation-wrapper {
        right: 0;
        left: auto;
        min-width: 280px;
    }
}

/* Mobile adjustments */
@media screen and (max-width: 767px) {
    .site-header {
        padding: 10px 0;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .site-title {
        font-size: 1.2rem;
        text-align: center;
    }

    .main-navigation {
        position: relative;
        display: flex;
        justify-content: center;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    .navigation-wrapper {
        border-radius: 0;
        left: -20px;
        right: -20px;
    }

    .main-navigation a {
        padding: 14px 16px;
        font-size: 14px;
    }
}