/**
 *  mida-portal/mida/static/mida/components/header/header.css
**/

/**
 * Header component styles 
**/

.header {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    width: 100%;
}


/**
 * Global overrides/modifications
**/

.header .top-nav .threelane-container {
    justify-content: flex-end;
}


/**
 * Top navigation styles
**/

.header .top-nav {
    background-color: var(--green);
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0;
    width: 100%;
}

.header .top-nav-desktop {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    width: 100%;
}

.header .top-nav-mobile {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0;
}

.header .top-nav .top-nav-links {
    align-items: center;
    display: flex;
    gap: 2rem;
}

.header .top-nav .top-nav-links .top-nav-link {
    color: var(--white, #FFF);
    font-family: var(--p1-font-family, "Barlow", Helvetica);
    font-size: 1rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1.625rem;
    text-decoration: none;
    transition: color 0.2s;
}

.header .top-nav .top-nav-links .top-nav-link:hover {
    color: #bbf7d0;
}

.header .top-nav .user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Social Links */
.header .top-nav .social-links {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.header .top-nav .social-link {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 1px solid var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.header .top-nav .social-link:hover {
    background-color: rgba(var(--white), 0.2);
}

/* Button Login */
.header .button-login {
    align-items: center;
    background-color: var(--dark-blue);
    border-radius: 9999px;
    border-color: transparent;
    display: flex;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: background-color 0.2s;
}

.header .button-login:hover,
.header .button-login:focus {
    background-color: var(--dark-blue);
}

.header .icon-user {
    align-items: center;
    background-color: var(--white);
    border-radius: 50%;
    display: flex;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.header .button-text {
    color: var(--white);
    font-family: var(--p4-font-family);
    font-weight: var(--font-weight-medium);
    margin-left: 1rem;
    font-size: calc(var(--p4-font-size) - 2px);
}


/** 
 * Search 
**/

.header .search-wrapper {
    margin: 0 .5rem;
    position: relative;
}

.header .button-search {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
    background: transparent;
    transition: color 0.2s;
}

.header .button-search:hover {
    color: #bbf7d0;
}

.header .search-dropdown .dropdown-menu {
    left: auto;
    top: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    width: 18rem;
    z-index: 50;
    right: 0;
}

.header .search-dropdown .dropdown-menu form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header .search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    outline: none;
}

.header .search-input:focus {
    border-color: #00a564;
    box-shadow: 0 0 0 2px rgba(0, 165, 100, 0.2);
}

.header .search-dropdown form button {
    background-color: #00a564;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.header .search-dropdown form button:hover {
    background-color: #008a54;
}


/**
 * Main navigation styles
 */

.header .main-nav {
    align-items: center;
    align-self: stretch;
    background: var(--white, #FFF);
    border-bottom: 1px solid var(--grey-medium, #B1B3B5);
    display: flex;
    flex-direction: row;
    gap: 0.625rem;
    padding: 1.8125rem 0.625rem;
}

.header .desktop-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

.header .main-nav .logo {
    display: flex;
    width: 100%;
    max-width: 266px;
}

.header .main-nav .nav-menu {
    flex: .875;
}

.header .main-nav .nav-menu .nav-list {
    align-items: center;
    display: flex;
    gap: 30px;
    list-style: none;
    flex-direction: row;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.header .main-nav .nav-menu .nav-list .nav-item {
    position: relative;
}

.header .main-nav .nav-menu .nav-list .nav-item .nav-link {
    display: flex;
    align-items: center;
    color: var(--dark-blue);
    font-family: var(--p1-font-family, "Barlow", Helvetica);
    gap: 0.25rem;
    transition: color 0.2s;
}

.header .main-nav .nav-menu .nav-list .nav-item .dropdown-icon {
    margin-left: 5px;
}

.header .main-nav .caret {
    background-image: url('/static/mida/components/header/img/icon-triangledown.svg');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    border: none;
    height: 14px;
    width: 14px;
}

.header .mobile-menu-button {
    display: block;
    padding: 0.5rem;
    color: #22408f;
    background: transparent;
}

/* Mobile Menu */
.header .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}

.header .mobile-menu.show {
    display: block;
}

.header .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--grey-light);
    z-index: -1;
}

.header.mobile-menu-content {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 20rem;
    background: white;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
}

.header .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.header .mobile-menu-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.header .mobile-menu-close {
    padding: 0.5rem;
    background: transparent;
}

.header .mobile-menu-nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header .mobile-nav-link {
    display: block;
    color: #22408f;
    font-weight: var(--font-weight-medium);
    transition: color 0.2s;
}

.header .mobile-nav-link:hover {
    color: #00a564;
}


/** 
 * Responsive styles 
**/

@media (min-width: 768px) {
    .header .top-nav-desktop {
        display: flex;
    }

    .header .top-nav-mobile {
        display: none;
    }
}


@media (min-width: 1024px) {

    .header .top-nav .top-nav-links {
        display: flex;
        flex: auto;
        justify-content: flex-end;
        padding-right: 2rem;
    }

    .header .top-nav .top-nav-links .top-nav-link {
        font-size: 1.125rem;
    }

    .header .desktop-nav {
        display: flex;
    }

    .header .mobile-menu-button {
        display: none;
    }

    .header .mobile-menu {
        display: none !important;
    }
}


/**
 * Hover Effects 
**/

@media (hover: hover) {

    .header .social-icon:hover,
    .header .button-login:hover,
    .header .button-search:hover,
    .header .top-nav-link:hover,
    .header .nav-link:hover,
    .header .dropdown-item:hover,
    .header .mobile-nav-link:hover {
        transition: all 0.2s ease-in-out;
    }
    
}