/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 24px 0px;
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}

/* All pages except home: solid white header */
.header.header-solid {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* Home page: keep header transparent, scroll JS adds .scrolled */
.home-page .header.header-solid {
    background: transparent;
    box-shadow: none;
}

.home-page .header.header-solid.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 12px 0px;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 56px;
    width: auto;
    display: block;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: #1c1d1f;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    color: #f49e0d;
}

.nav-link.active, 
.nav .nav-link.dropdown.active .dropdown-toggle.desktop,
.nav .nav-link.dropdown.active .dropdown-toggle.mobile  {
    color: #f49e0d;
    font-weight: 700;
}

.nav-link.dropdown {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    cursor: pointer;
}

.nav-link.dropdown .dropdown-toggle,
.nav-link.dropdown .dropdown-toggle:hover,
.nav-link.dropdown .dropdown-toggle:visited,
.nav-link.dropdown .dropdown-toggle:active,
.nav-link.dropdown .dropdown-toggle:focus {
    color: #000000 ;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.nav-link.dropdown:hover .dropdown-toggle {
    color: #f49e0d !important;
}

.nav-link.dropdown .dropdown-toggle.mobile {
    display: none;
}

.dropdown-menu-wrapper .dropdown-menu{
    height: 100%;
    overflow-y: scroll;
}

.nav-link.dropdown .dropdown-menu-wrapper a.active{
   color: #f49e0d;
}

.nav-link.dropdown .arrow {
    font-size: 18px;
    transition: transform 0.3s;
}

.nav-link.dropdown:hover .arrow {
    transform: rotate(180deg);
}

.nav-link.dropdown .small-screen-arrow{
    display: none;
} 

.dropdown-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 30px;
    background: #292929;
    min-width: 200px;
    border-radius: 12px;
    height: 400px;
    overflow: hidden;
    padding: 15px 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;

}

.nav-link.dropdown:hover .dropdown-menu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-wrapper .dropdown-menu a {
    display: block;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.dropdown-menu-wrapper .dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu-wrapper .dropdown-menu a:hover {
    background: #3a3a3a;
    color: #f49e0d;
}

/* Enrol Button */
.nav-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.btn-enroll {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f49e0d;
    color: #1c1d1f;
    padding: 14px 48px 14px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s, padding 0.3s;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 40px;
    min-width: 130px;
}

.btn-enroll:hover {
    background: #ffd946;
    padding: 14px 33px;
}

.btn-enroll:hover .arrow-circle {
    display: none;
}

.btn-enroll .arrow-circle {
    width: 43px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    color: #1c1d1f;
    border: 2px solid #f49e0d;
}

/* menu icons */
#icon-close{
    display: none;
}
header .container.header-inner .menu-icon{
    display: none;
}

#icon-menu{
    width: 100%;
    height: 100%;
}
#icon-close{
    width: 26px;
    height: 26px;
}

.dropdown-menu-wrapper.show {
    display: block;
}



@media (width > 768px){  

    .dropdown-menu-wrapper{
        padding: 20px;
        padding-right: 10px;
        background-color: #292929;
    }

    /* Scrollbar width */
    .dropdown-menu-wrapper .dropdown-menu::-webkit-scrollbar {
        width: 8px;
    }
    
    /* Scrollbar track */
    .dropdown-menu-wrapper .dropdown-menu::-webkit-scrollbar-track {
        background-color: #292929;
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }
    
    /* Scrollbar thumb */
    .dropdown-menu-wrapper .dropdown-menu::-webkit-scrollbar-thumb {
        background-color: #f49e0d;
        border-radius: 12px;
        border: 1px solid #292929;
    }
    
    /* Hover effect */
    .dropdown-menu-wrapper .dropdown-menu::-webkit-scrollbar-thumb:hover {
        background-color: #f5b444;
    }

}

/* Ensure dropdown menu is styled properly for small screens */
@media (max-width: 1023px) {
    /* Dropdown menu styles for small screens */
    .dropdown-menu-wrapper {
        width: 100%;
        left: 0;
        right: 0;
        display: none;
        position: absolute;
        background-color: #fff;
        overflow-x: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 10px;
        border-radius: 4px;
    }
    .nav-link.dropdown .dropdown-toggle.desktop {
        display: none;
    }
    .nav-link.dropdown .dropdown-toggle.mobile {
        display: inline-block;
    }
    header .container.header-inner .nav-group .nav a:last-child{
        border-bottom: none;
    }
    header.header {
        box-shadow: none;
        padding-top: 20px;
        padding-bottom: 0px;
        background-color: white;
    }
    .home-page .header.header-solid.scrolled{
        background-color: white;
    }
    .header.header-solid.scrolled,
    .header.header-solid, 
    .home-page .header.header-solid{
        padding: 10px 0px 10px;
        background-color: white;
    }
    header .container.header-inner {
        display: flex;
        flex-direction: row;
        padding: 0 20px;
    }
    .header .container.header-inner .logo-link{
       width: 15%;
    }    
    .header .container.header-inner .logo-link .logo-img{
       width: 100%;
       height: auto;
    }    
    header .container.header-inner .menu-icon{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
    }
    header .container.header-inner .nav-group{
        position: absolute;
        top: var(--header-height);
        margin-top: -13px;
        right: 0;
        width: 100%;
        height: calc(100dvh - var(--header-height) + 13px);
        overflow-y: auto;
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
        background-color: white;
        gap: 30px;
        padding: 30px 20px;
        transform: scale(0);
        transition: 
            transform 0.3s ease,
            opacity 0.3s ease,
            background-color 0.3s ease;

        transform-origin: top right;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    header .container.header-inner .nav-group.active{
        display: flex;
        flex-direction: column;

        transform: scale(1);
        opacity: 1;

        pointer-events: auto;
        animation: nav-expand 0.1s linear;
    }

    .nav-group.closed{
        animation: nav-shrink 0.1s linear;
    }
    header .container.header-inner .nav-group .nav{
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0px;
    }
    header .container.header-inner .nav-group .nav a{
        padding: 15px 0px;
        width: 100%;
        border-bottom: solid 1px #1c1d1f1b;
    }
    header .container.header-inner .nav-group .nav .nav-link.dropdown{
        width: 100%;
        flex-wrap: wrap;
        border-bottom: solid 1px #1c1d1f1b;
    }
    header .container.header-inner .nav-group .nav a.mobile{
        border-bottom: none;
    }
    .nav-link.dropdown .dropdown-menu-wrapper{
        width: 100%;
        padding-bottom: 0px;
        padding-top: 0px;
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        height: 260px;
        margin-top: 0px;
    }
    .nav-link.dropdown .course-menu{
        width: 100%;
        display: flex;
        flex-direction: row;      /* Force side-by-side */
        flex-wrap: nowrap;        /* Prevent the arrow from dropping to a new line */
        align-items: center;      /* Center arrow vertically with text */
    }
    header .container.header-inner .nav-group .nav .dropdown .course-menu a.mobile {
        width: auto;
        border-bottom: none;
        padding-right: 10px;      /* Gives a little breathing room before the arrow */
    }
    .nav-link.dropdown .small-screen-arrow{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;              /* Use a fixed width instead of % to prevent calculation errors */
        height: 100%;             /* Use 100% of the parent text height */
        flex-shrink: 0;
    } 
    .nav-link.dropdown .small-screen-arrow.show{
        rotate: 180deg;
    }
    .nav-group .nav .nav-link.dropdown .dropdown-menu-wrapper .dropdown-menu a:before{
        content: ">";
        margin-right: 10px;
        font-size: large;
    }
    .nav-group .nav .nav-link.dropdown .dropdown-menu-wrapper .dropdown-menu a:hover {
        background: none;
    }
    .nav-group .nav .nav-link.dropdown .dropdown-menu-wrapper .dropdown-menu a{
        color: #1C1D1F;
    }
    .nav-group .nav .nav-link.dropdown .dropdown-menu-wrapper .dropdown-menu a.active{
        color: #f49e0d;
    }
    .header.header-solid .nav-group .btn-enroll{
        border-radius: 10px;
        color: #FBF8E8;
        padding: 16px 33px;
        margin-left: -80%;
    }
    .header.header-solid .nav-group .btn-enroll span{
        display: block;
        text-align: center;
        color: #FBF8E8;
        font-family: Inter;
        font-size: 18px;
        font-weight: 600;
        letter-spacing: -0.36px;
    }
    .header.header-solid .nav-group .btn-enroll .arrow-circle{
        display:none
    }
    .nav-link.dropdown .arrow {
        display: none;
    }


   .dropdown-menu-wrapper .dropdown-menu {
        height: 100%;
        overflow-y: scroll;
    }

    header .container.header-inner .menu-icon {
        width: 60px;
        height: 60px;
    }
    /* header .container.header-inner .nav-group {
        top: 85px;
    } */
    .header .container.header-inner .logo-link {
        padding: 10px 0px;
    }
}

@media (max-width:768px) {
    header.header-solid.scrolled, .header.header-solid, .home-page .header.header-solid {
        padding-bottom: 0px;
    }
}
@media (max-width: 767px) {
    header .container.header-inner .nav-group{
        top: var(--header-height);
    }
    .header.header-solid .nav-group .btn-enroll {
        border-radius: 10px;
        color: #FBF8E8;
        padding: 16px 33px;
        margin-left: -62%;
    }
    .header .container.header-inner .logo-link {
        width: 27%;
    }

    .header.header-solid.scrolled,
    .header.header-solid, 
    .home-page .header.header-solid{
        padding:  0px;
        background-color: white;
    }
    .header.header-solid .header-inner{
        padding-top: 10px;
    }
    header .container.header-inner .menu-icon {
        width: 50px;
        height: 50px;
    }
}

/* Media queries for extra small screens */
@media (max-width: 400px) {
    .header.header-solid .nav-group .btn-enroll span {
        font-size: 16px;
    }
    .header.header-solid .nav-group .btn-enroll{
        padding: 12px 23px;
        margin-left: -62%;
    }
    header .container.header-inner .nav-group .nav a {
        padding: 13px 0px;
        font-size: 14px;
    }
    .header .container.header-inner .nav-group{
        padding-top: 20px;
    }
    /* header .container.header-inner .nav-group {
        top: 80px;
    } */
}

@media (max-width: 374px) {
    .header.header-solid .nav-group .btn-enroll{
        padding: 12px 23px;
        margin-left: -52%;
    }
}

@media (min-width:769px) and (max-width:1023px){
    header .container.header-inner .nav-group{
        position: absolute;
        top: var(--header-height);
        margin-top: -13px;
    }
}

@media (min-width:1441px){
    .header-inner{
        padding: 0px;
    }
}

/* Animations */
@keyframes nav-expand{
    0%{
        transform: scale(0);
        opacity: 0.3;
        background-color: #f49f0d36;
    }

    60%{
        transform: scale(0.7);
        opacity: 0.8;
        background-color: #f49f0d36;
    }

    95%{
        background-color: #f49f0d36;
    }

    100%{
        transform: scale(1);
        opacity: 1;
        background-color: white;
    }
}

@keyframes nav-shrink{
    0%{
        transform: scale(1);
        opacity: 1;
        background-color: white;
    }

    40%{
        background-color: #f49f0d36;
    }

    100%{
        transform: scale(0);
        opacity: 0.2;
        background-color: #f49f0d36;
    }
}

/* Tablet and small screen header hide/show */
@media (max-width: 1023px) {
  .header {
    transition: transform 0.3s ease-in-out;
  }

  .header.hidden {
    transform: translateY(-100%);
  }
}