.main-nav {
    background-color: var(--color-neutral-darkest);
    border-bottom: 4px solid var(--color-secondary);
    position: sticky;
    top: 0;
    padding: 1rem 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.menu {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.menu > li > a {
    color: white;
    text-decoration: none;
    /* font-size: var(--font-size-medium); */
    padding: 1rem 0;
    display: block;
    position: relative;
}

.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 9px;
    border: solid var(--color-secondary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -4px;
    vertical-align: middle;
}

.menu-item-has-children.active > a::after {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.sub-menu {
    display: none;
    position: absolute;
    background-color: var(--color-neutral-light);
    min-width: 240px;
    box-shadow: 4px 4px 0px 0px var(--color-neutral-darkest);
    border: 2px solid var(--color-neutral-darkest);
    padding: 1rem;
    list-style: none;
    margin-top: 1rem;
}

.sub-menu a {
    color: var(--color-neutral-darkest);
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    font-size: var(--font-size-medium);
}

.sub-menu a:hover {
    text-decoration: underline;
}

.nav-toggle {
    display: none;
}

.mobile-only {
    display: none !important;
}

.sub-menu-close-btn {
    display: none;
}

/* Mobile styles */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
        justify-content: center;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-neutral-darkest);
        padding: 1rem;
    }

    .nav-content {
        justify-content: space-between;
    }

    .nav-menu.active {
        display: block;
        text-align: center;
    }

    .menu {
        flex-direction: column;
        gap: 0rem;
    }

    .sub-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        margin-top: 0.5rem;
    }

    .menu-item-has-children.active::after {
        content: none !important;
    }

    .sub-menu-close-btn {
        display: inline !important;
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: xx-large;
    }
}

.sub-menu-container {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-neutral-lightest);
    padding: 3rem;
    border-bottom: 4px solid var(--color-secondary);
    border-top: 4px solid var(--color-secondary);
}

.sub-menu-container.active {
    opacity: 1;
    visibility: visible;
}

/* Add new styles for the dynamic border */
.menu-item-has-children.active::after {
    content: "";
    position: absolute;
    bottom: -33px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: var(--color-secondary);
    z-index: 1001;
}

.menu-item-has-children {
    position: relative;
}

.sub-links-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: max-content;
    margin-left: 3em;
}

.sub-links {
    color: var(--color-neutral-darkest);
    text-decoration: none;
    margin-bottom: 8px !important;
    display: flex;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: 1rem;
}

.sub-links a {
    color: var(--color-neutral-darkest);
    text-decoration: none;
    margin-bottom: 8px !important;
    width: 100%;
    display: block;
    margin-bottom: 1rem;
}

/* iOS-like Toggle Switch */
.ios-toggle {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-right: 40px;
    margin-left: 40px;
}

.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
    margin-right: 10px;
}

.ios-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--color-neutral-darkest);
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .ios-toggle-slider {
    background-color: var(--color-secondary);
}

input:focus + .ios-toggle-slider {
    box-shadow: 0 0 1px var(--color-secondary);
}

input:checked + .ios-toggle-slider:before {
    transform: translateX(16px);
}

/* Color for text label */
.ios-toggle {
    color: white;
}

/* Smaller variant */
.ios-toggle.small {
    width: auto;
    height: 26px;
}

.ios-toggle.small .ios-toggle-slider {
    width: 46px;
}

.ios-toggle.small .ios-toggle-slider:before {
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
}

.ios-toggle.small input:checked + .ios-toggle-slider:before {
    transform: translateX(20px);
}

/* Disabled state */
input:disabled + .ios-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-menu .btn {
    width: 117px;
    height: auto;
    font-size: 16px;
    padding: 10px 0;
}
