/* ============================================
   Mega Dropdown v3 – Enterprise Product Navigation
   Inspired by Calendly / Stripe / Notion / HubSpot
   ============================================ */

/* ---- Container ---- */
.lxb-dropdown-content--mega,
.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-content {
    min-width: 780px;
    max-width: 960px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.light-theme .lxb-dropdown-content--mega,
.light-theme .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-content {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ---- Wrapper ---- */
.lxb-mega {
    display: flex;
    flex-direction: column;
}

/* ================================================
   ANNOUNCEMENT BANNER
   ================================================ */
.lxb-mega-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, rgba(125, 128, 255, 0.1), rgba(99, 179, 237, 0.06));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12.5px;
}

.light-theme .lxb-mega-banner {
    background: linear-gradient(90deg, rgba(125, 128, 255, 0.06), rgba(99, 179, 237, 0.03));
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.lxb-mega-banner-text {
    flex: 1;
    opacity: 0.7;
}

.lxb-mega-banner-link {
    color: #7d80ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.lxb-mega-banner-link:hover {
    opacity: 0.8;
}

/* ================================================
   BADGES (New, Beta)
   ================================================ */
.lxb-mega-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 18px;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.lxb-mega-badge--new {
    background: linear-gradient(135deg, #7d80ff, #63b3ed);
    color: #fff;
}

.lxb-mega-badge--beta {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.light-theme .lxb-mega-badge--beta {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
}

/* ================================================
   MAIN 3-COLUMN GRID
   ================================================ */
.lxb-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 6px;
}

.lxb-mega-col {
    padding: 16px 12px 20px;
    min-width: 0;
    border-radius: 12px;
}

.lxb-mega-col:hover {
    background: rgba(255, 255, 255, 0.015);
}

.light-theme .lxb-mega-col:hover {
    background: rgba(0, 0, 0, 0.01);
}

/* ---- Category Heading ---- */
.lxb-mega-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
    margin: 0 0 12px 8px;
    padding: 0;
    line-height: 1;
    user-select: none;
}

html[dir="rtl"] .lxb-mega-heading {
    margin: 0 8px 12px 0;
}

/* ---- Heading Colored Icons ---- */
.lxb-mega-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    flex-shrink: 0;
}
.lxb-mega-heading-icon svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}

.lxb-mega-heading-icon--purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.lxb-mega-heading-icon--purple svg { stroke: #7c3aed; }

.lxb-mega-heading-icon--green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.lxb-mega-heading-icon--green svg { stroke: #10b981; }

.lxb-mega-heading-icon--blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.lxb-mega-heading-icon--blue svg { stroke: #3b82f6; }

.light-theme .lxb-mega-heading-icon--purple { background: rgba(124, 58, 237, 0.1); }
.light-theme .lxb-mega-heading-icon--green { background: rgba(16, 185, 129, 0.1); }
.light-theme .lxb-mega-heading-icon--blue { background: rgba(59, 130, 246, 0.1); }

/* ================================================
   MENU ITEM (icon + title + description)
   ================================================ */
.lxb-mega-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.lxb-mega-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

html[dir="rtl"] .lxb-mega-item:hover {
    transform: translateX(-2px);
}

.light-theme .lxb-mega-item:hover {
    background: rgba(0, 0, 0, 0.035);
}

/* ---- Icon Box ---- */
.lxb-mega-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    margin-top: 1px;
}

.light-theme .lxb-mega-icon {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}

.lxb-mega-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    opacity: 0.6;
    transition: opacity 0.18s, stroke 0.18s;
}

.lxb-mega-item:hover .lxb-mega-icon {
    background: rgba(125, 128, 255, 0.14);
    border-color: rgba(125, 128, 255, 0.2);
    transform: scale(1.08);
}

.lxb-mega-item:hover .lxb-mega-icon svg {
    opacity: 1;
    stroke: #8b8eff;
}

.light-theme .lxb-mega-item:hover .lxb-mega-icon {
    background: rgba(125, 128, 255, 0.08);
    border-color: rgba(125, 128, 255, 0.15);
}

/* ---- Item Body (title + description) ---- */
.lxb-mega-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.lxb-mega-item-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lxb-mega-item-desc {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.42;
    font-weight: 400;
}

.lxb-mega-item:hover .lxb-mega-item-desc {
    opacity: 0.6;
}

/* ================================================
   FOOTER: Featured Card + More Links
   ================================================ */
.lxb-mega-footer {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

.light-theme .lxb-mega-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.015);
}

/* ---- Featured Card ---- */
.lxb-mega-featured {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    flex: 1;
    min-width: 0;
}

.lxb-mega-featured:hover {
    background: rgba(125, 128, 255, 0.08);
}

.lxb-mega-featured-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(125, 128, 255, 0.2), rgba(99, 179, 237, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
}

.lxb-mega-featured-icon svg {
    width: 20px;
    height: 20px;
    stroke: #7d80ff;
}

.lxb-mega-featured-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.lxb-mega-featured-body strong {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.lxb-mega-featured-body small {
    font-size: 12px;
    opacity: 0.45;
    font-weight: 400;
}

.lxb-mega-featured-arrow {
    font-size: 18px;
    opacity: 0.3;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.lxb-mega-featured:hover .lxb-mega-featured-arrow {
    opacity: 0.7;
    transform: translateX(3px);
}

html[dir="rtl"] .lxb-mega-featured:hover .lxb-mega-featured-arrow {
    transform: translateX(-3px);
}

/* ---- Footer Quick Links ---- */
.lxb-mega-footer-links {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    flex-shrink: 0;
}

.lxb-mega-footer-links a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    opacity: 0.45;
    border-radius: 6px;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}

.lxb-mega-footer-links a:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.06);
}

.light-theme .lxb-mega-footer-links a:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ================================================
   RESPONSIVE: Tablet (2 columns)
   ================================================ */
@media (max-width: 900px) {
    .lxb-dropdown-content--mega,
    .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-content {
        min-width: 520px;
        max-width: 90vw;
    }

    .lxb-mega-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lxb-mega-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .lxb-mega-footer-links {
        padding: 4px 8px 8px;
        justify-content: center;
    }
}

/* ================================================
   RESPONSIVE: Mobile (1 column)
   ================================================ */
@media (max-width: 520px) {
    .lxb-dropdown-content--mega,
    .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-content {
        min-width: 290px;
        max-width: calc(100vw - 16px);
        border-radius: 12px;
    }

    .lxb-mega-grid {
        grid-template-columns: 1fr;
        padding: 4px;
    }

    .lxb-mega-col {
        padding: 12px 8px 16px;
    }

    .lxb-mega-banner {
        padding: 8px 12px;
        font-size: 11.5px;
    }

    .lxb-mega-featured-icon {
        width: 36px;
        height: 36px;
    }
}

/* ================================================
   RTL POSITIONING
   ================================================ */
html[dir="rtl"] .lxb-dropdown-content--mega,
html[dir="rtl"] .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-content {
    left: auto;
    right: 50%;
    transform: translateX(50%) translateY(-10px);
}

html[dir="rtl"] .lxb-nav-dropdown[aria-expanded="true"] .lxb-dropdown-content--mega,
html[dir="rtl"] .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3)[aria-expanded="true"] .lxb-dropdown-content {
    transform: translateX(50%) translateY(0);
}

/* ================================================
   LEGACY: Pages with old dropdown markup (no --mega)
   ================================================ */
.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 16px;
    align-content: start;
    padding: 10px;
}

.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-item {
    margin: 0;
}

.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-separator {
    grid-column: 1 / -1;
    height: 0;
    margin: 4px 0;
    padding: 0;
    border: none;
    border-top: 1px solid var(--lxb-border-color, rgba(255, 255, 255, 0.08));
    min-height: 0;
}

@media (max-width: 900px) {
    .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-list {
        grid-template-columns: 1fr;
    }
}

.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-link-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-link-icon {
    background: rgba(0, 0, 0, 0.04);
}

.lxb-nav-list > .lxb-nav-item.lxb-nav-dropdown:nth-child(3) .lxb-dropdown-link-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    opacity: 0.6;
}
