/* =========================================================
   RateMySongWriting Header
   ========================================================= */


/* =========================================================
   DESKTOP HEADER
   ========================================================= */

.rms-header {
    width: 100%;
    position: relative;
    z-index: 999;
    background: #0b0b0f;
    color: #ffffff;
    border-bottom: 1px solid #1f1f26;
    box-sizing: border-box;
}

.rms-header-inner {
    width: 100%;
    max-width: 1440px;
    min-height: 76px;
    margin: 0 auto;
    padding: 0 32px;

    display: flex;
    align-items: center;

    box-sizing: border-box;
}


/* =========================================================
   DESKTOP LOGO
   ========================================================= */

.rms-header-logo {
    display: inline-flex;
    align-items: center;

    color: #ffffff;
    text-decoration: none;

    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.6px;

    white-space: nowrap;

    transition: opacity 0.2s ease;
}

.rms-header-logo:hover {
    color: #ffffff;
    opacity: 0.85;
}


/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.rms-header-nav {
    display: flex;
    align-items: center;

    gap: 30px;
    margin-left: 48px;
}

.rms-header-link {
    position: relative;

    color: #a1a1aa;
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    padding: 8px 0;

    transition: color 0.2s ease;
}

.rms-header-link:hover {
    color: #ffffff;
}


/* =========================================================
   DESKTOP ACTIONS
   ========================================================= */

.rms-header-actions {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 10px;
}


/* =========================================================
   DESKTOP SEARCH
   ========================================================= */

.rms-header-search {
    display: flex;
    align-items: center;

    gap: 9px;

    width: 260px;
    height: 42px;

    padding: 0 14px;

    border: 1px solid #292930;
    border-radius: 11px;

    background: #15151b;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.rms-header-search:focus-within {
    background: #18181f;
    border-color: #454550;

    box-shadow:
        0 0 0 3px rgba(255,255,255,0.04);
}

.rms-header-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    flex-shrink: 0;

    color: #a1a1aa;
}

.rms-header-search-icon svg {
    display: block;

    width: 17px;
    height: 17px;
}

.rms-header-search input {
    width: 100%;
    min-width: 0;
    height: 100%;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: #ffffff;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    box-shadow: none;
}

.rms-header-search input::placeholder {
    color: #71717a;
    opacity: 1;
}

.rms-header-search input:focus {
    outline: none;
    border: 0;
    box-shadow: none;
}

.rms-header-search input[type="search"]::-webkit-search-decoration,
.rms-header-search input[type="search"]::-webkit-search-cancel-button,
.rms-header-search input[type="search"]::-webkit-search-results-button,
.rms-header-search input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}


/* =========================================================
   DESKTOP LOGIN
   ========================================================= */

.rms-header-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 14px;

    color: #d4d4d8;
    text-decoration: none;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.rms-header-login:hover {
    background: #18181f;
    color: #ffffff;
}


/* =========================================================
   DESKTOP SIGN UP
   ========================================================= */

.rms-header-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 18px;

    border-radius: 10px;

    background: #ffffff;
    color: #0b0b0f;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.rms-header-signup:hover {
    background: #f4f4f5;
    color: #0b0b0f;

    transform: translateY(-1px);

    box-shadow:
        0 6px 20px rgba(0,0,0,0.25);
}


/* =========================================================
   DESKTOP PROFILE
   ========================================================= */

.rms-header-profile {
    position: relative;
}

.rms-header-profile-button {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    min-height: 42px;

    padding: 4px 10px 4px 6px;

    border: 1px solid transparent;
    border-radius: 11px;

    background: transparent;
    color: #ffffff;

    cursor: pointer;

    font-family: inherit;
}

.rms-header-profile-button:hover,
.rms-header-profile-button[aria-expanded="true"] {
    background: #18181f;
    border-color: #292930;
}

.rms-header-profile-avatar {
    width: 32px;
    height: 32px;

    flex-shrink: 0;

    overflow: hidden;

    border-radius: 50%;
}

.rms-header-avatar-image {
    display: block;

    width: 32px !important;
    height: 32px !important;

    object-fit: cover;
}

.rms-header-profile-name {
    max-width: 130px;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    color: #f4f4f5;

    font-size: 14px;
    font-weight: 600;
}

.rms-header-profile-chevron {
    width: 15px;
    height: 15px;

    color: #a1a1aa;

    transition: transform 0.2s ease;
}

.rms-header-profile-button[aria-expanded="true"]
.rms-header-profile-chevron {
    transform: rotate(180deg);
}


/* =========================================================
   DESKTOP PROFILE MENU
   ========================================================= */

.rms-header-profile-menu {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 250px;

    padding: 8px;

    background: #15151b;

    border: 1px solid #292930;
    border-radius: 14px;

    box-shadow:
        0 18px 45px rgba(0,0,0,0.45);

    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;

    transform: translateY(-6px);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}

.rms-header-profile-menu.is-open {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.rms-header-profile-menu-user {
    padding: 10px 11px 12px;
}

.rms-header-profile-menu-name {
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.rms-header-profile-menu-email {
    margin-top: 4px;

    color: #71717a;

    font-size: 12px;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.rms-header-profile-divider {
    height: 1px;

    margin: 4px 0;

    background: #292930;
}

.rms-header-profile-item {
    display: flex;
    align-items: center;

    gap: 11px;

    width: 100%;

    padding: 10px 11px;

    border-radius: 9px;

    color: #d4d4d8;
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    box-sizing: border-box;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.rms-header-profile-item:hover {
    background: #1f1f27;
    color: #ffffff;
}

.rms-header-profile-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    flex-shrink: 0;

    color: #a1a1aa;
}

.rms-header-profile-item-icon svg {
    width: 17px;
    height: 17px;

    display: block;
}

.rms-header-profile-item:hover
.rms-header-profile-item-icon {
    color: #ffffff;
}

.rms-header-profile-logout {
    color: #f87171;
}

.rms-header-profile-logout:hover {
    background: #241619;
    color: #fca5a5;
}


/* =========================================================
   MOBILE APP
   Hidden by default
   ========================================================= */

.rms-mobile-app {
    display: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media screen and (max-width: 1100px) {

    .rms-header-inner {
        padding: 0 24px;
    }

    .rms-header-nav {
        gap: 22px;
        margin-left: 32px;
    }

    .rms-header-search {
        width: 220px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 800px) {

    /*
     * Hide the desktop header completely.
     */

    .rms-header {
        display: none !important;
    }


    /*
     * Show mobile app.
     */

    .rms-mobile-app {
        display: block !important;

        width: 100%;

        background: #0b0b0f;
        color: #ffffff;

        box-sizing: border-box;
    }


    /* =====================================================
       MOBILE TOP BAR
       ===================================================== */

    .rms-mobile-app-top {
        display: flex;

        align-items: center;
        justify-content: space-between;

        width: 100%;
        min-height: 62px;

        padding: 0 18px;

        box-sizing: border-box;

        background: #0b0b0f;
    }


    /*
     * Mobile logo
     */

    .rms-mobile-app-logo {
        display: inline-flex;
        align-items: center;

        color: #ffffff !important;
        text-decoration: none !important;

        font-size: 18px;
        font-weight: 800;

        letter-spacing: -0.4px;

        white-space: nowrap;
    }

    .rms-mobile-app-logo:hover {
        color: #ffffff !important;
    }


    /*
     * Mobile profile avatar
     */

    .rms-mobile-app-profile {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 36px;
        height: 36px;

        overflow: hidden;

        border-radius: 50%;

        flex-shrink: 0;
    }

    .rms-mobile-app-avatar {
        display: block;

        width: 36px !important;
        height: 36px !important;

        object-fit: cover;
    }


    /*
     * Logged-out login button
     */

    .rms-mobile-app-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        min-height: 36px;

        padding: 0 13px;

        border: 1px solid #292930;
        border-radius: 9px;

        background: #15151b;

        color: #ffffff !important;
        text-decoration: none !important;

        font-size: 13px;
        font-weight: 700;
    }


    /* =====================================================
       MOBILE SEARCH
       ===================================================== */

    .rms-mobile-app-search {
        display: flex;
        align-items: center;

        gap: 10px;

        width: calc(100% - 32px);
        height: 46px;

        margin: 4px 16px 16px;
        padding: 0 14px;

        box-sizing: border-box;

        background: #15151b !important;

        border: 1px solid #292930 !important;
        border-radius: 12px !important;
    }

    .rms-mobile-app-search:focus-within {
        background: #18181f !important;

        border-color: #454550 !important;

        box-shadow:
            0 0 0 3px rgba(255,255,255,0.04);
    }


    /*
     * Search icon
     */

    .rms-mobile-app-search-icon {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 18px;
        height: 18px;

        flex-shrink: 0;

        color: #a1a1aa;
    }

    .rms-mobile-app-search-icon svg {
        display: block;

        width: 17px;
        height: 17px;
    }


    /*
     * Search input
     */

    .rms-mobile-app-search input {
        width: 100%;
        min-width: 0;
        height: 100%;

        padding: 0 !important;

        border: 0 !important;
        outline: 0 !important;

        background: transparent !important;

        color: #ffffff !important;

        font-family: inherit;

        font-size: 14px;

        box-shadow: none !important;
    }

    .rms-mobile-app-search input::placeholder {
        color: #71717a !important;
        opacity: 1;
    }

    .rms-mobile-app-search input:focus {
        border: 0 !important;
        outline: 0 !important;

        box-shadow: none !important;
    }

    .rms-mobile-app-search input[type="search"]::-webkit-search-decoration,
    .rms-mobile-app-search input[type="search"]::-webkit-search-cancel-button,
    .rms-mobile-app-search input[type="search"]::-webkit-search-results-button,
    .rms-mobile-app-search input[type="search"]::-webkit-search-results-decoration {
        -webkit-appearance: none;
        appearance: none;
    }


    /* =====================================================
       MOBILE BOTTOM NAVIGATION
       ===================================================== */

    .rms-mobile-bottom-nav {
        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;

        z-index: 999999;

        display: grid;

        grid-template-columns: repeat(4, 1fr);

        width: 100%;
        height: 68px;

        padding: 6px 8px;

        box-sizing: border-box;

        background: #0b0b0f;

        border-top: 1px solid #292930;

        box-shadow:
            0 -8px 25px rgba(0,0,0,0.25);

        /*
         * Safe-area support for phones
         */

        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }


    /*
     * Navigation link
     */

    .rms-mobile-bottom-link {
        display: flex;

        align-items: center;
        justify-content: center;

        flex-direction: column;

        gap: 4px;

        min-width: 0;

        color: #71717a !important;

        text-decoration: none !important;

        border-radius: 10px;

        transition:
            color 0.2s ease,
            background 0.2s ease;
    }

    .rms-mobile-bottom-link:hover {
        color: #ffffff !important;

        background: #15151b;
    }


    /*
     * Icons
     */

    .rms-mobile-bottom-icon {
        display: flex;

        align-items: center;
        justify-content: center;

        width: 22px;
        height: 22px;
    }

    .rms-mobile-bottom-icon svg {
        display: block;

        width: 20px;
        height: 20px;
    }


    /*
     * Labels
     */

    .rms-mobile-bottom-label {
        font-size: 10px;
        font-weight: 600;

        line-height: 1;

        white-space: nowrap;
    }


    /*
     * Prevent the fixed navigation from covering
     * the bottom of the page.
     */

    body {
        padding-bottom: 68px;
    }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media screen and (max-width: 500px) {

    .rms-mobile-app-top {
        min-height: 58px;

        padding: 0 15px;
    }

    .rms-mobile-app-logo {
        font-size: 17px;
    }

    .rms-mobile-app-search {
        width: calc(100% - 30px);

        margin-left: 15px;
        margin-right: 15px;
    }

    .rms-mobile-bottom-nav {
        height: 66px;
    }

    .rms-mobile-bottom-label {
        font-size: 9px;
    }

    body {
        padding-bottom: 66px;
    }
}