/**
 * HVAC Menu System Styles
 * WordPress-compliant navigation styling
 */

/* Dashboard navigation - NO container styling */
.hvac-trainer-dashboard-page .hvac-trainer-menu-wrapper {
    background: transparent !important;
    border: none !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    display: block !important;
}

/* Other pages - container styling (but NOT dashboard) */
.hvac-page-wrapper:not(.hvac-trainer-dashboard-page) .hvac-trainer-menu-wrapper {
    background: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    width: 100% !important;
    display: block !important;
}

.hvac-trainer-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hvac-page-wrapper .hvac-trainer-menu,
.hvac-trainer-menu {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
}

/* Position help menu item to the far right */
.hvac-trainer-menu .hvac-help-menu-item {
    margin-left: auto !important;
    order: 999 !important; /* Ensure it's always last */
}

/* Style the help menu icon */
.hvac-trainer-menu .hvac-help-menu-item a {
    padding: 15px 10px !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
}

.hvac-trainer-menu .hvac-help-menu-item .dashicons {
    font-size: 18px !important;
}

.hvac-page-wrapper .hvac-trainer-menu .menu-item,
.hvac-trainer-menu .menu-item {
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    list-style: none !important;
}

.hvac-trainer-menu .menu-item > a,
.hvac-trainer-menu .menu-item > .menu-toggle {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
}

.hvac-trainer-menu .menu-item > a:hover,
.hvac-trainer-menu .menu-item > .menu-toggle:hover {
    background-color: #f8f9fa;
    color: #007cba;
}

.hvac-trainer-menu .menu-item.has-children > .menu-toggle {
    position: relative;
}

.hvac-trainer-menu .menu-item .dashicons {
    margin-right: 8px;
    font-size: 16px;
}

.hvac-trainer-menu .dropdown-arrow {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.hvac-trainer-menu .menu-item.has-children.open .dropdown-arrow {
    transform: rotate(180deg);
}

.hvac-trainer-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 200px;
    z-index: 99999 !important;
    display: none;
}

.hvac-trainer-menu .menu-item.has-children.open .sub-menu {
    display: block;
}

.hvac-trainer-menu .sub-menu .menu-item {
    width: 100%;
}

.hvac-trainer-menu .sub-menu .menu-item > a {
    padding: 12px 20px;
    font-weight: 400;
    white-space: nowrap;
}

.hvac-trainer-menu .sub-menu .menu-item > a:hover {
    background-color: #f8f9fa;
    color: #007cba;
}

.hvac-trainer-menu .sub-menu .sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 1px;
}

/* Special styling for logout */
.hvac-trainer-menu .menu-item-logout {
    margin-left: auto;
}

/* Hamburger Menu Styles */
.hvac-hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 10001;
}

.hvac-hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger animation when active */
.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(2) {
    opacity: 0;
}

.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Desktop Responsive Styles */
@media (min-width: 993px) {
    .hvac-hamburger-menu {
        display: none !important;
    }
    
    .hvac-page-wrapper .hvac-trainer-menu,
    .hvac-trainer-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 992px) {
    .hvac-trainer-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .hvac-hamburger-menu {
        display: block !important;
    }
    
    .hvac-page-wrapper .hvac-trainer-menu,
    .hvac-trainer-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        flex-direction: column !important;
        width: 100% !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        border-top: 1px solid #e0e0e0 !important;
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
        z-index: 10000 !important;
    }
    
    .hvac-page-wrapper .hvac-trainer-menu.active,
    .hvac-trainer-menu.active {
        display: flex !important;
    }
    
    .hvac-trainer-menu .menu-item {
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .hvac-trainer-menu .menu-item > a,
    .hvac-trainer-menu .menu-item > .menu-toggle {
        padding: 15px 20px !important;
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    /* Sub-menu styles for mobile */
    .hvac-trainer-menu .sub-menu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa !important;
        padding-left: 20px !important;
    }
    
    .hvac-trainer-menu .menu-item.has-children.open .sub-menu {
        display: block !important;
    }
    
    .hvac-trainer-menu .sub-menu .menu-item {
        border-bottom: 1px solid #e9ecef !important;
    }
    
    .hvac-trainer-menu .sub-menu .sub-menu {
        position: static !important;
        left: 0 !important;
        margin-left: 0 !important;
        padding-left: 20px !important;
    }
    
    /* Help menu item on mobile */
    .hvac-trainer-menu .hvac-help-menu-item {
        margin-left: 0 !important;
        order: initial !important;
    }
    
    .hvac-trainer-menu .hvac-help-menu-item a {
        justify-content: flex-start !important;
        padding: 15px 20px !important;
    }
    
    .hvac-trainer-menu .hvac-help-menu-item a::after {
        content: "Help" !important;
        margin-left: 8px !important;
    }
}

@media (max-width: 768px) {
    .hvac-trainer-nav {
        padding: 0 15px;
    }
    
    .hvac-trainer-menu .menu-item > a,
    .hvac-trainer-menu .menu-item > .menu-toggle {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    .hvac-trainer-menu .sub-menu {
        padding-left: 15px !important;
    }
}

.hvac-trainer-menu .menu-item-logout > a {
    color: #d63638;
}

.hvac-trainer-menu .menu-item-logout > a:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hvac-page-wrapper .hvac-trainer-menu,
    .hvac-trainer-menu {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        width: 100% !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        border-top: 1px solid #e0e0e0 !important;
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
        z-index: 10000 !important;
    }
    
    .hvac-page-wrapper .hvac-trainer-menu.active,
    .hvac-trainer-menu.active {
        display: flex !important;
    }
    
    .hvac-trainer-menu .menu-item {
        width: 100%;
    }
    
    .hvac-trainer-menu .menu-item > a,
    .hvac-trainer-menu .menu-item > .menu-toggle {
        justify-content: space-between;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .hvac-trainer-menu .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid #007cba;
        margin-left: 20px;
        background: #f8f9fa;
    }
    
    .hvac-trainer-menu .menu-item-logout {
        margin-left: 0;
        border-top: 2px solid #e0e0e0;
        margin-top: 10px;
        padding-top: 10px;
    }
}

/* Active page highlighting */
.hvac-trainer-menu .menu-item.current-menu-item > a,
.hvac-trainer-menu .menu-item.current-menu-parent > a {
    background-color: #007cba;
    color: #ffffff;
}

.hvac-trainer-menu .menu-item.current-menu-item > a:hover,
.hvac-trainer-menu .menu-item.current-menu-parent > a:hover {
    background-color: #005a87;
}