/* =========================================================
   ABFL AUTHENTICATED HEADER
========================================================= */


/* =========================================================
   ACCOUNT WRAPPER
========================================================= */

.abfl-account-nav {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: flex-end;
}


/* =========================================================
   ACCOUNT TRIGGER
========================================================= */

.abfl-account-trigger {
    min-height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding:
        5px
        12px
        5px
        6px;

    border:
        1px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.08);

    color: white;

    font-family:
        Inter,
        sans-serif;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}


.abfl-account-trigger:hover {
    background:
        rgba(255, 255, 255, 0.13);

    border-color:
        rgba(255, 79, 160, 0.45);

    transform:
        translateY(-1px);
}


.abfl-account-trigger.is-open {
    background:
        rgba(255, 255, 255, 0.13);

    border-color:
        rgba(255, 79, 160, 0.5);

    box-shadow:
        0 10px 28px
        rgba(0, 0, 0, 0.22);
}


/* =========================================================
   HANDLE
========================================================= */

.abfl-account-trigger-text {
    display: flex;
    align-items: center;

    min-width: 0;
}


.abfl-account-trigger-text strong {
    max-width: 150px;

    overflow: hidden;

    color: white;

    font-size: 13px;
    font-weight: 900;

    line-height: 1;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   CHEVRON
========================================================= */

.abfl-account-chevron {
    width: 16px;
    height: 16px;

    flex: 0 0 auto;

    color: #d8c8ef;

    transition:
        transform 0.18s ease;
}


.abfl-account-trigger.is-open
.abfl-account-chevron {
    transform:
        rotate(180deg);
}


/* =========================================================
   AVATAR
========================================================= */

.abfl-account-avatar {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    overflow: hidden;

    border:
        2px solid
        rgba(255, 79, 160, 0.72);

    border-radius: 50%;

    background: #311557;

    color: white;

    font-size: 11px;
    font-weight: 900;

    line-height: 1;
}


.abfl-account-avatar img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.abfl-account-avatar-fallback {
    background:
        linear-gradient(
            135deg,
            #ff4fa0,
            #7637c6
        );
}


/* =========================================================
   DROPDOWN MENU
========================================================= */

.abfl-account-menu {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    width: 270px;

    z-index: 1000;

    padding: 10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.14);

    border-radius: 22px;

    background: #251242;

    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.42);
}


.abfl-account-menu[hidden] {
    display: none !important;
}


/* =========================================================
   ACCOUNT MENU HEADER
========================================================= */

.abfl-account-menu-head {
    display: flex;
    align-items: center;

    gap: 12px;

    padding:
        10px
        10px
        12px;
}


.abfl-account-menu-head > div {
    min-width: 0;

    display: grid;

    gap: 3px;
}


.abfl-account-menu-head strong {
    overflow: hidden;

    color: white;

    font-size: 14px;
    font-weight: 900;

    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.abfl-account-menu-head div span {
    overflow: hidden;

    color: #cfa9ff;

    font-size: 12px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   DIVIDER
========================================================= */

.abfl-account-menu-divider {
    height: 1px;

    margin:
        5px
        8px;

    background:
        rgba(255, 255, 255, 0.1);
}


/* =========================================================
   MENU LINKS
========================================================= */

.abfl-account-menu-link {
    width: 100%;

    min-height: 42px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding:
        0
        11px;

    border: 0;

    border-radius: 13px;

    background: transparent;

    color: white;

    text-decoration: none;

    font-family:
        Inter,
        sans-serif;

    font-size: 13px;
    font-weight: 800;

    text-align: left;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background 0.16s ease,
        color 0.16s ease;
}


.abfl-account-menu-link:hover {
    background:
        rgba(255, 255, 255, 0.08);
}


.abfl-account-menu-link svg {
    width: 17px;
    height: 17px;

    flex: 0 0 auto;

    color: #ff4fa0;
}


/* =========================================================
   LOGOUT
========================================================= */

.abfl-account-logout {
    color: #ffc2df;
}


.abfl-account-logout:hover {
    background:
        rgba(255, 79, 160, 0.1);
}


.abfl-account-logout:disabled {
    opacity: 0.6;

    cursor: wait;
}


/* =========================================================
   MAKE SURE HEADER CSS DOESN'T RESTYLE BUTTON
========================================================= */

.creator-auth .abfl-account-trigger,
.login-auth .abfl-account-trigger,
.signup-auth .abfl-account-trigger {
    color: white;
    text-decoration: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .abfl-account-trigger-text strong {
        max-width: 110px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .abfl-account-trigger {
        padding: 5px;

        gap: 0;
    }


    .abfl-account-trigger-text {
        display: none;
    }


    .abfl-account-chevron {
        display: none;
    }


    .abfl-account-menu {
        width:
            min(
                280px,
                calc(100vw - 32px)
            );
    }

}

/* =========================================================
   GLOBAL BETA BADGE
   Injected by auth-header.js beside "The Purple Library".
   Does not restyle the existing brand title.
========================================================= */

.abfl-brand-title-beta-row{
    display:inline-flex;
    align-items:center;
    gap:7px;

    min-width:0;

    /* inherit title spacing/typography from the existing header */
    font:inherit;
    color:inherit;
    line-height:inherit;
}

.abfl-global-beta-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    flex:0 0 auto;

    padding:3px 6px;

    border:
        1px solid
        rgba(255,79,160,.45);

    border-radius:999px;

    background:
        rgba(255,79,160,.14);

    color:#ff7fba;

    font-family:
        Inter,
        sans-serif;

    font-size:8px;
    font-weight:900;

    line-height:1;

    letter-spacing:.08em;

    text-transform:uppercase;

    vertical-align:middle;
}


/* =========================================================
   KO-FI SUPPORT — GLOBAL HEADER + FOOTER
========================================================= */

.abfl-kofi-nav-button,
.abfl-kofi-footer-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;

    border-radius:999px;

    background:#ff4fa0;
    color:#fff !important;

    font-family:Inter,sans-serif;
    font-weight:900;
    text-decoration:none !important;

    box-shadow:0 10px 26px rgba(255,79,160,.2);

    transition:
        transform .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

.abfl-kofi-nav-button{
    min-height:40px;
    padding:0 14px;
    margin-right:10px;
    font-size:12px;
    white-space:nowrap;
}

.abfl-kofi-footer-button{
    width:max-content;
    margin-top:10px;
    padding:9px 13px;
    font-size:11px;
}

.abfl-kofi-nav-button:hover,
.abfl-kofi-footer-button:hover{
    transform:translateY(-1px);
    background:#ff6aae;
    box-shadow:0 14px 30px rgba(255,79,160,.28);
}

.abfl-kofi-cup{
    font-size:14px;
    line-height:1;
}

/* Most ABFL auth wrappers are flex containers; keep Ko-fi aligned with them. */
[data-abfl-auth-nav]{
    align-items:center;
}

@media (max-width:700px){
    .abfl-kofi-nav-button{
        min-height:36px;
        padding:0 10px;
        margin-right:7px;
        font-size:0;
    }

    .abfl-kofi-nav-button .abfl-kofi-cup{
        font-size:15px;
    }
}


/* =========================================================
   ABFL AUTH HEADER RESPONSIVE PRESSURE FIX — BETA
   Appended 2026-11-12
========================================================= */

[data-abfl-auth-nav] {
    min-width: 0;
}

@media (max-width: 1280px) {

    .abfl-kofi-nav-button {
        min-height: 38px;

        padding:
            0
            11px;

        margin-right: 5px;

        font-size: 10px;
    }

    .abfl-account-trigger {
        min-height: 44px;
    }

    .abfl-account-trigger-text strong {
        max-width: 105px;

        font-size: 11px;
    }

    .abfl-account-avatar {
        width: 33px;
        height: 33px;
    }
}


@media (max-width: 1040px) {

    [data-abfl-auth-nav] {
        display: flex;

        justify-content: flex-end;

        gap: 6px;

        white-space: nowrap;
    }

    .abfl-kofi-nav-button {
        margin-right: 2px;
    }

    .abfl-account-trigger-text strong {
        max-width: 88px;
    }
}


@media (max-width: 700px) {

    [data-abfl-auth-nav] {
        gap: 4px;
    }

    .abfl-kofi-nav-button {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;

        padding: 0;
        margin-right: 0;

        border-radius: 50%;
    }

    .abfl-account-trigger {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;

        padding: 0;

        border-radius: 50%;
    }

    .abfl-account-avatar {
        width: 32px;
        height: 32px;
    }

    .abfl-account-menu {
        position: fixed;

        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;

        width: auto;
        max-height: min(72vh, 560px);

        overflow-y: auto;

        border-radius: 24px;
    }
}

