/* =========================================================
   PORALEKHA HEADER
========================================================= */

.pl-header {
    position: relative;
    z-index: 9999;

    width: 100%;

    background: var(--pl-bg);

    border-bottom: 1px solid var(--pl-border);

    box-shadow: 0 2px 12px rgba(20, 40, 60, 0.04);
}


.pl-header__container {
    width: min(1200px, calc(100% - 48px));

    height: var(--pl-header-height);

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}


/* =========================================================
   LEFT
========================================================= */

.pl-header__left {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 30px;
}


.pl-header__logo {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;

    text-decoration: none !important;

    line-height: 0;
}


.pl-header__logo img {
    display: block;

    width: auto;
    max-width: 180px;
    max-height: 48px;

    object-fit: contain;
}


.pl-header__logo-text {
    color: var(--pl-text-primary);

    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.7px;
}


/* =========================================================
   SEARCH
========================================================= */

.pl-header__search {
    position: relative;

    width: min(340px, 28vw);

    height: 44px;

    margin: 0;

    display: flex;
    align-items: center;
}


.pl-header__search-icon {
    position: absolute;
    left: 15px;

    display: flex;

    color: #8291a0;

    pointer-events: none;
}


.pl-header__search input[type="search"] {
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0 16px 0 44px;

    border: 1px solid #e2e8ef;
    border-radius: 10px;

    background: #f8fafc;

    color: var(--pl-text-primary);

    font-size: 14px;

    outline: none;

    box-shadow: none;
}


.pl-header__search input[type="search"]::placeholder {
    color: #8c99a6;
}


.pl-header__search input[type="search"]:focus {
    border-color: var(--pl-text-primary);

    background: #fff;

    box-shadow: 0 0 0 3px rgba(23, 63, 95, 0.08);
}


/* Remove browser search X */

.pl-header__search input[type="search"]::-webkit-search-cancel-button {
    display: none;
}


/* =========================================================
   NAV
========================================================= */

.pl-header__nav {
    margin-left: auto;
}


.pl-header__menu {
    display: flex;
    align-items: center;

    gap: 5px;

    margin: 0;
    padding: 0;

    list-style: none;
}


.pl-menu-item {
    position: relative;
}


.pl-menu-link {
    height: 44px;

    padding: 0 13px;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--pl-text-primary);

    font-size: 15px;
    font-weight: 600;

    text-decoration: none !important;

    border-radius: 9px;

    transition:
            color 0.2s ease,
            background 0.2s ease;
}


.pl-menu-link:hover {
    color: var(--pl-text-primary);

    background: var(--pl-soft-bg);
}


.pl-menu-arrow {
    transition: transform 0.2s ease;
}


.pl-menu-item--has-dropdown:hover .pl-menu-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   COURSE DROPDOWN
========================================================= */
.pl-dropdown {
    position: absolute;

    top: 100%;
    left: 50%;

    width: 350px;

    /*
     * This creates visual space without creating
     * a mouse-gap between the button and dropdown.
     */
    padding-top: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateX(-50%) translateY(8px);

    transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
}


/*.pl-dropdown::before {*/
/*    content: "";*/

/*    position: absolute;*/

/*    top: 0;*/
/*    left: 50%;*/

/*    width: 12px;*/
/*    height: 12px;*/

/*    background: #fff;*/

/*    border-left: 1px solid var(--pl-border);*/
/*    border-top: 1px solid var(--pl-border);*/

/*    transform: translateX(-50%) rotate(45deg);*/

/*    z-index: 0;*/
/*}*/


.pl-menu-item--has-dropdown:hover .pl-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform:
            translateX(-50%)
            translateY(0);
}


.pl-dropdown__inner {
    position: relative;
    z-index: 1;

    overflow: hidden;

    padding: 18px;

    background: #fff;

    border: 1px solid var(--pl-border);
    border-radius: 14px;

    box-shadow:
            0 18px 45px rgba(20, 40, 60, 0.13);
}


.pl-dropdown__header {
    display: flex;
    flex-direction: column;

    margin-bottom: 12px;
    padding: 2px 4px 10px;

    border-bottom: 1px solid var(--pl-border);
}


.pl-dropdown__header span {
    color: var(--pl-text-primary);

    font-size: 14px;
    font-weight: 750;
}


.pl-dropdown__header small {
    margin-top: 3px;

    color: var(--pl-muted);

    font-size: 11px;
}


/* =========================================================
   CATEGORY
========================================================= */

.pl-dropdown__categories {
    display: grid;

    gap: 4px;
}

.pl-category-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    gap: 11px;
    padding: 5px 10px;
    color: var(--pl-text-primary);
    text-decoration: none !important;
    border-radius: 9px;
    transition: background 0.2s ease,
    transform 0.2s ease;
}

.pl-category-link:hover {
    background: #f6f9fb;

    transform: translateX(3px);
}


.pl-category-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(23, 63, 95, 0.08);

    color: var(--pl-text-primary);

    font-size: 12px;
    font-weight: 800;
}


.pl-category-name {
    flex: 1;

    font-size: 14px;
    font-weight: 600;
}


.pl-category-arrow {
    color: #a0aab4;

    font-size: 16px;

    transition: transform 0.2s ease;
}


.pl-category-link:hover .pl-category-arrow {
    color: var(--pl-text-primary);

    transform: translateX(3px);
}


/* =========================================================
   ALL COURSES
========================================================= */

.pl-dropdown__all-courses {
    margin-top: 12px;

    min-height: 46px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--pl-btn-primary);

    color: #fff !important;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none !important;

    border-radius: 9px;

    transition:
            background 0.2s ease,
            transform 0.2s ease;
}


.pl-dropdown__all-courses:hover {
    background: var(--pl-btn-primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   LOGIN
========================================================= */

.pl-login-button {
    min-height: 42px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--pl-btn-primary);

    color: #fff !important;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none !important;

    transition:
            background 0.2s ease,
            transform 0.2s ease;
}


.pl-login-button:hover {
    background: var(--pl-btn-primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   USER
========================================================= */

.pl-user-button {
    min-height: 44px;

    padding: 3px 7px 3px 3px;

    display: flex;
    align-items: center;

    gap: 8px;

    background: transparent;

    border: 0;

    color: var(--pl-text-primary);

    cursor: pointer;

    border-radius: 30px;
}


.pl-user-button:hover {
    background: var(--pl-soft-bg);
}


.pl-user-avatar,
.pl-user-dropdown__avatar {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
            linear-gradient(
                    135deg,
                    var(--pl-btn-primary),
                    var(--pl-btn-primary-dark)
            );

    color: #fff;

    font-size: 12px;
    font-weight: 800;

    text-transform: uppercase;
}


.pl-user-name {
    max-width: 110px;

    overflow: hidden;

    color: var(--pl-text-primary);

    font-size: 15px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   USER DROPDOWN
========================================================= */

.pl-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 270px;
    padding-top: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
            opacity 0.2s ease,
            visibility 0.2s ease,
            transform 0.2s ease;
}
.pl-user-dropdown__inner {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(20, 40, 60, 0.13);
}

.pl-menu-item--user:hover .pl-user-dropdown,
.pl-menu-item--user.is-open .pl-user-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}


.pl-user-dropdown__header {
    display: flex;
    align-items: center;

    gap: 10px;

    padding-bottom: 13px;

    border-bottom: 1px solid var(--pl-border);
}


.pl-user-dropdown__header strong {
    display: block;

    color: var(--pl-text-primary);

    font-size: 13px;
}


.pl-user-dropdown__header small {
    display: block;

    /*max-width: 175px;*/

    overflow: hidden;

    color: var(--pl-muted);

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.pl-user-dropdown__links {
    display: grid;

    gap: 3px;

    padding: 10px 0;
}

.pl-user-dropdown__links a, .pl-user-dropdown__logout {
    display: block;
    padding: 5px 5px;
    color: var(--pl-text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.pl-user-dropdown__links a:hover {
    background: var(--pl-soft-bg);
}


.pl-user-dropdown__logout {
    padding-top: 11px;

    border-top: 1px solid var(--pl-border);

    color: #c44949;
}


.pl-user-dropdown__logout:hover {
    background: #fff5f5;
}


/* =========================================================
   MOBILE TOGGLE
========================================================= */

.pl-header__mobile-toggle {
    display: none;

    width: 44px;
    height: 44px;

    padding: 0;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    background: transparent;

    border: 1px solid var(--pl-border);
    border-radius: 9px;

    cursor: pointer;
}


.pl-header__mobile-toggle span {
    width: 20px;
    height: 2px;

    display: block;

    background: var(--pl-text-primary);

    border-radius: 10px;

    transition:
            transform 0.2s ease,
            opacity 0.2s ease;
}


.pl-header__mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}


.pl-header__mobile-toggle.is-open span:nth-child(2) {
    opacity: 0;
}


.pl-header__mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .pl-header__container {
        width: min(100% - 32px, 1440px);

        gap: 18px;
    }

    .pl-header__left {
        gap: 18px;
    }

    .pl-header__search {
        width: 250px;
    }

    .pl-menu-link {
        padding: 0 9px;
    }

    .pl-user-name {
        display: none;
    }

}


@media (max-width: 900px) {

    .pl-header__container {
        position: relative;

        height: 70px;
    }

    .pl-header__left {
        flex: 1;
    }

    .pl-header__search {
        width: min(300px, 45vw);
    }

    .pl-header__mobile-toggle {
        display: flex;
    }
    .pl-header__nav {
        position: fixed;
        top: 103px;
        right: 0;
        left: auto;
        width: 50%;
        height: 100vh;
        padding: 80px 20px 20px;
        background: #fff;
        border-left: 1px solid var(--pl-border);
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition:
                opacity 0.25s ease,
                visibility 0.25s ease,
                transform 0.25s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    .pl-header.is-menu-open .pl-header__nav {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .pl-header__nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .pl-header__menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
    }

    .pl-menu-item {
        width: 100%;
    }

    .pl-menu-link {
        width: 100%;
        height: 48px;

        justify-content: space-between;

        padding: 0 12px;
    }

    .pl-menu-item--has-dropdown .pl-dropdown {
        position: static;

        width: 100%;

        padding: 0;

        transform: none;

        opacity: 1;
        visibility: visible;

        display: none;

        pointer-events: auto;

        box-shadow: none;
    }

    .pl-menu-item--has-dropdown.is-open .pl-dropdown {
        display: block;
    }

    .pl-dropdown::before {
        display: none;
    }

    .pl-dropdown__inner {
        padding: 10px;

        border-radius: 10px;

        box-shadow: none;

        background: var(--pl-soft-bg);
    }

    .pl-dropdown__header {
        display: none;
    }

    .pl-category-link {
        background: #fff;
    }

    .pl-user-button {
        width: 100%;

        justify-content: flex-start;

        padding: 6px;
    }

    .pl-user-name {
        display: block;

        flex: 1;

        text-align: left;
    }

    .pl-user-dropdown {
        position: static;
        width: 100%;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
    }

    .pl-menu-item--user.is-open .pl-user-dropdown {
        display: block;
    }

    .pl-login-button {
        width: 100%;
    }
    .pl-menu-item--has-dropdown:hover .pl-dropdown {
        transform: translateX(0%)
        translateY(0);
        padding: 15px 0;
    }
}


@media (max-width: 600px) {

    .pl-header__container {
        width: calc(100% - 24px);
    }

    .pl-header__logo img {
        max-width: 140px;
        max-height: 42px;
    }

    /*.pl-header__search {*/
    /*    width: 44px;*/
    /*}*/

    /*.pl-header__search input[type="search"] {*/
    /*    width: 44px;*/

    /*    padding: 0;*/

    /*    cursor: pointer;*/

    /*    color: transparent;*/
    /*}*/

    .pl-header__search-icon {
        left: 13px;
    }

    .pl-header__search input[type="search"]:focus {
        position: absolute;

        right: 0;

        width: min(260px, calc(100vw - 90px));

        padding-left: 44px;

        color: var(--pl-text-primary);

        background: #fff;

        cursor: text;

        z-index: 10;
    }
}