/*
 * ImGenerate site navigation and mega menu
 */

.site-header {
    z-index: 1040;
}

.site-header .navbar {
    min-height: 72px;
    padding: 8px 0;
}

.site-nav-container {
    position: relative;
}

.site-brand {
    margin-right: 18px;
    padding: 0;
}

.site-header .nav-logo {
    width: 190px;
    max-width: 100%;
    height: auto;
    display: block;
}

.site-nav {
    align-items: center;
    gap: 2px;
}

.site-header .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.86) !important;
    background: transparent;
    border: 0;
    border-radius: 999px;
    margin: 0;
    padding: 9px 13px !important;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-header .nav-link::before {
    display: none;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible,
.site-header .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.site-nav-toggle {
    cursor: pointer;
    text-align: left;
}

.site-toggle-icon {
    font-size: 0.58rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.site-mega.is-open > .site-nav-toggle .site-toggle-icon,
.site-dropdown.is-open > .site-nav-toggle .site-toggle-icon,
.site-mega:hover > .site-nav-toggle .site-toggle-icon,
.site-dropdown:hover > .site-nav-toggle .site-toggle-icon {
    transform: rotate(180deg);
}

.site-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.site-nav-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: 14px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-color);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-nav-cta:hover,
.site-nav-cta:focus {
    background: #f0f6ff;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.site-dropdown {
    position: relative;
}

.site-mega {
    position: static;
}

/* Small dropdown menus */

.site-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 1200;
    display: none;
    width: 284px;
    padding: 8px;
    border: 1px solid #e2e9f3;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(10, 38, 71, 0.18);
}

.site-dropdown:hover > .site-menu,
.site-dropdown:focus-within > .site-menu,
.site-dropdown.is-open > .site-menu {
    display: block;
}

.site-menu-link {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #15253c;
    text-decoration: none;
    transition: background-color 0.18s ease;
}

.site-menu-link:hover,
.site-menu-link:focus {
    color: #0a2647;
    background: #f2f7ff;
}

.site-menu-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(0, 63, 169, 0.08);
    color: var(--secondary-color);
    font-size: 0.86rem;
}

.site-menu-link strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.site-menu-link small {
    display: block;
    margin-top: 1px;
    color: #6a7a8f;
    font-size: 0.76rem;
    line-height: 1.35;
}

/* Mega menu */

.site-mega-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1190;
    display: none;
    max-height: calc(100vh - 100px);
    overflow: auto;
    border: 1px solid #e2e9f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 75px rgba(10, 38, 71, 0.22);
}

.site-mega:hover > .site-mega-panel,
.site-mega:focus-within > .site-mega-panel,
.site-mega.is-open > .site-mega-panel {
    display: block;
}

.site-mega-inner {
    padding: 24px;
}

.site-mega-featured {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #e2e9f3;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7faff, #eef5ff);
}

.site-mega-featured-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #718199;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.site-mega-featured-head a {
    color: var(--secondary-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
}

.site-mega-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.site-mega-featured-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e2e9f3;
    border-radius: 9px;
    background: #fff;
    color: #1a2c45;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.site-mega-featured-link:hover {
    border-color: var(--tool-accent, #0f6fff);
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.site-mega-section-title {
    margin: 0 0 10px;
    color: #718199;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.site-mega-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.site-mega-category {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e2e9f3;
    border-radius: 10px;
    background: #fff;
    color: #1a2c45;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.site-mega-category:hover {
    border-color: var(--tool-accent, #0f6fff);
    background: #f7faff;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.site-mega-category-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(0, 63, 169, 0.08);
    color: var(--secondary-color);
    font-size: 0.75rem;
}

.site-mega-category-label {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.site-mega-category-label strong {
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-mega-category-label small {
    color: #7b8ba1;
    font-size: 0.68rem;
    line-height: 1.3;
}

.site-mega-category-arrow {
    flex: 0 0 auto;
    color: #9aa8bb;
    font-size: 0.55rem;
}

@media (max-width: 1199.98px) {
    .site-mega-featured-grid,
    .site-mega-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.site-mega-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}

.site-mega-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-mega-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    color: #718199;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1.3;
    text-transform: uppercase;
}

.site-mega-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #eef3fa;
    color: #60748f;
    font-size: 0.64rem;
    font-weight: 800;
}

.site-mega-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    border-radius: 8px;
    color: #1a2c45;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.site-mega-link:hover,
.site-mega-link:focus {
    color: #003fa9;
    background: #f2f7ff;
}

.site-mega-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: rgba(0, 63, 169, 0.075);
    color: var(--secondary-color);
    font-size: 0.72rem;
}

.site-mega-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e8eef7;
    color: #70809a;
    font-size: 0.82rem;
}

.site-mega-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-mega-footer a {
    color: var(--secondary-color);
    font-weight: 800;
    text-decoration: none;
}

.site-mega-footer a:hover {
    color: var(--primary-color);
}

@media (max-width: 1199.98px) {
    .site-header .nav-logo {
        width: 170px;
    }

    .site-header .nav-link {
        padding: 9px 10px !important;
        font-size: 0.94rem;
    }

    .site-nav-cta {
        padding: 9px 14px;
        font-size: 0.86rem;
    }

    .site-mega-grid {
        gap: 14px;
    }

    .site-mega-link {
        font-size: 0.79rem;
    }
}

@media (max-width: 991.98px) {
    .site-header .navbar-collapse {
        margin-top: 12px;
        padding-bottom: 14px;
    }

    .site-nav {
        align-items: stretch;
        width: 100%;
        gap: 4px;
    }

    .site-header .nav-item {
        width: 100%;
    }

    .site-header .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 11px 12px !important;
        font-size: 1rem;
    }

    .site-nav-toggle {
        justify-content: space-between !important;
    }

    .site-toggle-icon {
        margin-left: auto;
    }

    .site-header .site-mega-panel,
    .site-header .site-menu {
        position: static;
        display: none;
        width: auto;
        max-height: none;
        margin: 4px 0 10px;
        padding: 0;
        overflow: visible;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.14);
        box-shadow: none;
    }

    .site-header .site-mega-panel {
        max-height: calc(100vh - 220px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .site-header .site-menu {
        max-height: calc(100vh - 220px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .site-header .site-mega:hover > .site-mega-panel,
    .site-header .site-mega:focus-within > .site-mega-panel,
    .site-header .site-dropdown:hover > .site-menu,
    .site-header .site-dropdown:focus-within > .site-menu {
        display: none;
    }

    .site-header .site-mega.is-open > .site-mega-panel,
    .site-header .site-dropdown.is-open > .site-menu {
        display: block;
    }

    .site-mega-inner {
        padding: 14px;
    }

    .site-mega-featured {
        border-color: rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.06);
    }

    .site-mega-featured-head,
    .site-mega-section-title {
        color: rgba(255, 255, 255, 0.62);
    }

    .site-mega-featured-head a,
    .site-mega-featured-link,
    .site-mega-category {
        color: #fff;
    }

    .site-mega-featured-head a {
        color: #fff;
    }

    .site-mega-featured-link,
    .site-mega-category {
        border-color: rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.08);
    }

    .site-mega-featured-link:hover,
    .site-mega-category:hover {
        border-color: rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }

    .site-mega-category-icon {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .site-mega-category-label small {
        color: rgba(255, 255, 255, 0.58);
    }

    .site-mega-category-arrow {
        color: rgba(255, 255, 255, 0.55);
    }

    .site-mega-featured-grid,
    .site-mega-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-mega-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .site-mega-title {
        color: rgba(255, 255, 255, 0.62);
    }

    .site-mega-title span {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }

    .site-mega-link {
        color: #fff;
        font-size: 0.9rem;
    }

    .site-mega-link:hover,
    .site-mega-link:focus {
        color: #fff;
        background: rgba(255, 255, 255, 0.12);
    }

    .site-mega-icon {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .site-mega-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        border-top-color: rgba(255, 255, 255, 0.14);
        color: rgba(255, 255, 255, 0.7);
    }

    .site-mega-footer a {
        color: #fff;
    }

    .site-menu {
        padding: 8px;
    }

    .site-menu-link {
        color: #fff;
    }

    .site-menu-link:hover,
    .site-menu-link:focus {
        color: #fff;
        background: rgba(255, 255, 255, 0.12);
    }

    .site-menu-link small {
        color: rgba(255, 255, 255, 0.62);
    }

    .site-menu-icon {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .site-nav-cta {
        display: flex;
        width: 100%;
        margin: 10px 0 0;
        padding: 11px 18px;
    }
}

@media (max-width: 575.98px) {
    .site-header .nav-logo {
        width: 160px;
    }

    .site-mega-inner {
        padding: 12px;
    }

    .site-mega-grid {
        gap: 16px;
    }

    .site-mega-featured-grid,
    .site-mega-category-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
