/* Mega Menu Navigation */

/* Hide GeneratePress header completely */
.site-header,
#site-header,
.generate-header,
header.site-header,
.inside-header,
.site-header .inside-header {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

/* Remove any top spacing from GeneratePress elements */
#page,
.site,
#content,
.site-content,
.grid-container,
.container,
.hfeed,
div.site,
div#page {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure first child of body has no top margin */
body > *:not(.doa-mega-menu):not(#wpadminbar) {
    margin-top: 0 !important;
}

/* Remove WordPress admin bar default margin on html */
html {
    margin-top: 0 !important;
}

body {
    margin: 0 !important;
    padding-top: 73px !important; /* Global spacing for fixed menu */
}

/* Admin bar adjustment */
body.admin-bar {
    padding-top: 105px !important; /* Admin bar (32px) + menu (73px) */
}

html.admin-bar {
    margin-top: 0 !important;
}

/* Admin bar positioning */
#wpadminbar {
    position: fixed !important;
    top: 0 !important;
}

body.admin-bar .doa-mega-menu {
    top: 32px;
}

.doa-mega-menu {
    background: #3a9d82;
    border-bottom: 1px solid #2d7a66;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 100%;
    margin: 0;
    padding: 0;
}

.menu-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.menu-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    height: 50px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Menu Items */
.menu-items {
    display: flex;
    align-items: center;
    gap: 40px;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.menu-item > a:hover {
    color: #e0f2f1;
}

.menu-item > a i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.menu-item.has-dropdown:hover > a i {
    transform: rotate(180deg);
}

/* Profile Icon Link */
.menu-profile-icon {
    padding: 0 !important;
}

/* Shared Mega Dropdown Container */
.mega-dropdown-container {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    z-index: 998;
}

body.admin-bar .mega-dropdown-container {
    top: 105px;
}

/* Show dropdown - controlled by JavaScript */
.mega-dropdown-container.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* Content Panels */
.dropdown-content-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-content-panel.active {
    display: block;
    opacity: 1;
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 60px;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile dropdown - single column, smaller, aligned to right (third column) */
.dropdown-content-profile .dropdown-content {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 1400px;
    padding: 40px 60px;
    gap: 60px;
}

.dropdown-content-profile .dropdown-column {
    grid-column: 3 / 4;
}

.dropdown-column h4 {
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.dropdown-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-column li {
    margin-bottom: 4px;
}

.dropdown-column a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
}

.dropdown-column a:hover {
    color: #667eea;
    background: #f8f9fa;
    padding-left: 16px;
}

/* Special styling for "View All" links */
.dropdown-column a[href*="search"] {
    margin-top: 8px;
    color: #3a9d82;
    font-weight: 600;
}

.dropdown-column a[href*="search"]:hover {
    color: #2f7f6e;
}

/* Featured Column */
.dropdown-featured {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
}

.dropdown-featured p {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px;
}

.featured-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.featured-link:hover {
    background: #667eea;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.featured-link i {
    color: #667eea;
    font-size: 20px;
}

.featured-link:hover i {
    color: white;
}

.btn-dropdown {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    padding-left: 20px !important;
}

/* Mini Articles */
.featured-resources {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-article {
    display: block;
    padding: 12px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mini-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mini-article strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.mini-article span {
    color: #666;
    font-size: 12px;
}

/* Simple Dropdown (Profile) */
.simple-dropdown {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    margin-top: 12px;
    pointer-events: none;
}

.simple-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.simple-dropdown ul {
    list-style: none;
    padding: 12px;
    margin: 0;
}

.simple-dropdown li {
    margin-bottom: 0;
}

.simple-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.simple-dropdown a i {
    color: #3a9d82;
    font-size: 16px;
    width: 20px;
}

.simple-dropdown a:hover {
    background: #f8f9fa;
    color: #667eea;
}

.simple-dropdown a:hover i {
    color: #667eea;
}

/* CTA Button */
.menu-cta {
    margin-left: 16px;
}

.btn-menu-cta {
    display: inline-block !important;
    padding: 10px 24px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
    white-space: nowrap !important;
    line-height: 1.4 !important;
}

.btn-menu-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Profile Link */
.menu-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white !important;
    transition: all 0.3s ease;
}

.menu-profile-link i.fa-user-circle {
    font-size: 32px !important;
}

/* Hide profile text on desktop, show icon only */
.menu-profile-text {
    display: none;
}

.menu-profile-link .fa-chevron-down {
    display: none;
}

.menu-profile-link:hover {
    color: #e0f2f1 !important;
}

.menu-profile-link:hover i.fa-user-circle {
    transform: scale(1.1);
}

/* Hide mobile dropdown content on desktop - only show on mobile */
@media (min-width: 1025px) {
    .mobile-dropdown-content {
        display: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .menu-items {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .menu-items.active {
        opacity: 1;
        visibility: visible;
        max-height: calc(100vh - 73px);
        overflow-y: auto;
        padding: 12px 0;
    }

    body.admin-bar .menu-items.active {
        max-height: calc(100vh - 105px);
    }

    .menu-item {
        border-bottom: 1px solid #f0f0f0;
        padding: 0;
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    .menu-item > a:not(.btn-menu-cta) {
        color: #333 !important;
        padding: 16px 24px;
        display: block;
    }

    .menu-item > a:not(.btn-menu-cta):hover {
        background: #f8f9fa;
        color: #667eea !important;
    }

    /* Hide desktop dropdown container on mobile */
    .mega-dropdown-container {
        display: none !important;
    }

    /* Mobile dropdown content - show inline */
    .menu-item.has-dropdown .mobile-dropdown-content {
        display: none !important;
        background: #f8f9fa;
        padding: 12px 24px 24px;
    }

    .menu-item.has-dropdown.mobile-active .mobile-dropdown-content {
        display: block !important;
    }

    .mobile-dropdown-content .dropdown-column {
        margin-bottom: 24px;
    }

    .mobile-dropdown-content .dropdown-column:last-child {
        margin-bottom: 0;
    }

    .mobile-dropdown-content .dropdown-column h4 {
        color: #667eea;
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 0 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e0e0e0;
    }

    .mobile-dropdown-content .dropdown-column ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-dropdown-content .dropdown-column li {
        margin-bottom: 4px;
    }

    .mobile-dropdown-content .dropdown-column a {
        color: #555;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        display: block;
        padding: 8px 12px;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .mobile-dropdown-content .dropdown-column a:hover {
        color: #667eea;
        background: white;
        padding-left: 16px;
    }

    .mobile-dropdown-content .dropdown-column a[href*="search"] {
        color: #3a9d82;
        font-weight: 600;
        margin-top: 8px;
    }

    .mobile-dropdown-content .dropdown-column a i {
        margin-right: 8px;
        color: #3a9d82;
    }

    .menu-cta {
        margin-left: 0;
        padding: 16px 24px;
    }

    .btn-menu-cta {
        display: block !important;
        text-align: center;
        width: 100%;
        color: white !important;
    }

    /* Mobile: Menu item links should be full clickable areas */
    .menu-item.has-dropdown > a {
        cursor: pointer;
        position: relative;
    }

    .menu-item.has-dropdown > a i {
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
    }

    .menu-item.has-dropdown.mobile-active > a i {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Profile link on mobile - show text */
    .menu-profile-link {
        padding: 16px 24px !important;
        justify-content: flex-start;
    }

    .menu-profile-link i.fa-user-circle {
        font-size: 20px !important;
    }

    .menu-profile-text {
        display: inline !important;
        font-size: 15px;
        font-weight: 600;
        flex: 1;
    }

    .menu-profile-link .fa-chevron-down {
        display: inline !important;
        font-size: 11px;
        position: absolute;
        right: 24px;
    }

    .menu-item.menu-profile.has-dropdown.mobile-active > a .fa-chevron-down {
        transform: rotate(180deg);
    }
}

/* Prevent wpForo or other plugins from interfering with mega menu */
.doa-mega-menu,
.doa-mega-menu *,
.doa-mega-menu *::before,
.doa-mega-menu *::after,
.mega-dropdown-container,
.mega-dropdown-container *,
.mega-dropdown-container *::before,
.mega-dropdown-container *::after {
    box-sizing: border-box !important;
}

.doa-mega-menu {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Ensure dropdowns are hidden by default - override any plugin conflicts */
.mega-dropdown-container:not(.show) {
    display: none !important;
}

.mega-dropdown-container.show {
    display: block !important;
}

.dropdown-content-panel:not(.active) {
    display: none !important;
}

.simple-dropdown:not(.show) {
    display: none !important;
}
