/* --- General & Base Styles --- */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    background-color: #f4f7f6;
}

.top-content-section {
    background: linear-gradient(113.26deg, #0E1747 12.22%, #6777D1 68.17%, #4A5BB8 92.47%);
    padding: 50px 0px;
    margin-top: 10px;
    margin-inline: 10px;
    border-radius: 20px;
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.10);
}

/* --- Site Header & Logo --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    color: white;
}



/* --- Main Navigation (Desktop) --- */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Dropdown Icon Styling --- */
.dropdown-icon {
    display: inline-flex;

    /* ★★★★★ FIX #1: The margin is now on the container ★★★★★ */
    margin-left: 8px;
    margin-top: 4px;

    /* High-quality bounce animation */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-icon svg {
    width: 16px;
    height: 16px;

    /* ★★★★★ FIX #2: The margin is removed from the SVG itself ★★★★★ */
    /* margin-left: 8px; <-- THIS LINE IS REMOVED */
}

/* Rotation is controlled by the '.is-open' class */
.dropdown-icon.is-open {
    transform: rotate(180deg);
}


/* --- Sub-Menu (Dropdown) Styling --- */
.sub-menu {
    position: absolute;
    top: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 15px;
    width: max-content;
    max-width: 650px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1000;
}

.has-dropdown:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sub-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.sub-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.sub-menu-item p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.3;
}

.sub-menu a {
    text-decoration: none;
}



/* --- Special "Try Playground" Button --- */
.try-playground-btn a {
    background-color: #fff;
    color: #4A5BB8;
    font-weight: 600;
    border-radius: 50px;
    padding: 10px 24px;
}

.try-playground-btn a:hover {
    background-color: #f0f0f0;
    color: #4A5BB8;
}

/* --- Hamburger Menu & Overlay --- */
.menu-toggle,
.menu-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    padding: 5px;
}

.menu-toggle svg {
    width: 28px;
    height: 28px;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


/* ======================================================= */
/* =========== RESPONSIVE STYLES (MOBILE) ================ */
/* ======================================================= */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
        z-index: 10;
    }

    .main-nav>ul {
        display: none;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 85%;
        height: 100vh;
        background: linear-gradient(113.26deg, #0E1747 12.22%, #6777D1 68.17%, #4A5BB8 92.47%);
        z-index: 101;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        padding: 20px 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    .main-nav.is-open>ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 50px;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav a {
        width: 100%;
        padding: 16px 25px;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .has-dropdown>a.is-open {
        background-color: rgba(255, 255, 255, 0.05);
        color: #fff;
    }

    /* --- MOBILE SUB-MENU STYLES --- */
    .sub-menu {
        position: static;
        left: auto;
        top: auto;
        transform: none !important;
        width: 100%;
        max-width: 100%;
        opacity: 1;
        visibility: visible;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    .sub-menu.is-open {
        max-height: 1000px;
    }

    .sub-items {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 10px 0;
    }

    .sub-menu a {
        padding: 12px 25px 12px 40px;
        font-size: 0.9em;
        color: #ddd;
    }

    .sub-menu a:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }

    .sub-menu-item {
        padding: 0;
    }

    .sub-menu-item p {
        color: inherit;
    }

    /* --- MOBILE "TRY PLAYGROUND" BUTTON --- */
    .try-playground-btn {
        border: none;
        padding: 25px;
    }

    .try-playground-btn a {
        display: block;
        text-align: center;
        width: 100%;
    }

    /* --- MOBILE CLOSE BUTTON --- */
    .menu-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 30px;
        z-index: 105;
    }

    /* Stop desktop hover effects on touch devices */
    .has-dropdown:hover>.sub-menu {
        display: none;
    }

    .has-dropdown .sub-menu.is-open {
        display: block;
    }
}


.mega-menu {
    display: flex;
    gap: 20px;
    /* Space between columns */
    padding: 20px;

    /* Allow it to grow based on content */
    max-width: 900px;
    /* Adjust as needed */
}

/* --- Mega Menu Columns --- */
.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Space between items in a column */
    flex: 1;
    /* Make columns share space equally */
    min-width: 200px;
    /* Prevent columns from getting too narrow */
}

/* --- Mega Menu Headings (e.g., "Google Workspace") --- */
.mega-menu-heading {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 10px;
    /* Add margin for spacing */
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* --- Override default sub-item styles for mega menu --- */
.mega-menu .sub-menu-item {
    width: 100%;
    box-sizing: border-box;
    /* Ensures padding is included in width */
}



/* --- Style for the text block next to an icon --- */
.sub-menu-text {
    display: flex;
    flex-direction: column;
}

.sub-menu-text p {
    line-height: 1.2;
    font-weight: 500;
}

.sub-menu-text span {
    font-size: 12px;
    color: #777;
    line-height: 1.3;
}


/* ======================================================= */
/* ============ MEGA MENU RESPONSIVE STYLES ============== */
/* ======================================================= */
@media (max-width: 992px) {

    /* On mobile, stack the mega menu columns vertically */
    .mega-menu {
        flex-direction: column;
        gap: 0;
        padding: 0px 0;
        /* Adjust padding for mobile */
    }

    .mega-menu-column {
        min-width: 100%;
    }

    .mega-menu-heading {
        font-size: 0.9em;
        padding: 12px 25px 8px 40px;
        /* Align with other mobile links */
        margin: 5px 0 0 0;
        color: #fff;
        border: none;
        opacity: 0.8;
    }

    /* Style the links under the heading on mobile */
    .mega-menu a {
        padding: 12px 25px 12px 55px;
        /* Indent the items under the heading */
    }

    /* Hide the descriptive sub-text on mobile to save space */
    .sub-menu-text span {
        display: none;
    }
}