/**
 * Header hesap menüsü — mesaj/bildirim ikon kutusu ile uyumlu (masaüstü)
 */

.header-account-menu-wrapper {
    position: relative;
    margin-left: 0;
}

/* —— Varsayılan (mobil: mobile-header-bar.css ile tamamlanır) —— */
.header-account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 38px;
    height: 38px;
    padding: 3px 8px 3px 3px;
    margin: 0;
    border: none;
    border-radius: 10px !important;
    -webkit-border-radius: 10px !important;
    background: rgba(59, 102, 255, 0.1) !important;
    background-color: rgba(59, 102, 255, 0.1) !important;
    color: #f0f3f8;
    cursor: pointer;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.2;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    transition: background-color 0.2s ease;
}

.header-account-trigger:hover {
    background-color: rgba(59, 102, 255, 0.16) !important;
}

.header-account-trigger.is-open {
    background-color: rgba(59, 102, 255, 0.18) !important;
}

body.light-mode .header-account-trigger {
    background-color: rgba(59, 102, 255, 0.08) !important;
}

body.light-mode .header-account-trigger:hover {
    background-color: rgba(59, 102, 255, 0.12) !important;
}

body.light-mode .header-account-trigger.is-open {
    background-color: rgba(59, 102, 255, 0.14) !important;
}

.header-account-trigger__avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-inset, #121318);
}

.header-account-trigger__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
}

.header-account-trigger__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.header-account-trigger__name {
    display: none;
}

.header-account-trigger__balance {
    font-size: 12px;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.2;
}

body.light-mode .header-account-trigger__balance {
    color: #16a34a;
}

.header-account-trigger__chev {
    flex-shrink: 0;
    font-size: 10px;
    color: #8a94a6;
    opacity: 0.85;
    margin-left: 0;
    line-height: 1;
}

body.light-mode .header-account-trigger__chev {
    color: #6b7280;
}

.header-account-trigger.is-open .header-account-trigger__chev {
    color: #9ca3af;
}

/* Yukarı kalkma — auth-buttons global hover */
.auth-buttons .header-account-trigger,
.auth-buttons .header-account-trigger:hover,
.auth-buttons .header-account-trigger:active,
.auth-buttons .header-account-trigger:focus,
.auth-buttons .header-account-trigger:focus-visible {
    transform: none !important;
    box-shadow: none !important;
}

/* —— Masaüstü: şeffaf zemin, ince kenarlık, 10px köşe —— */
@media (min-width: 1025px) {
    .header-account-menu-wrapper {
        margin-left: 0;
        padding: 0 !important;
    }

    .header-account-menu-wrapper.nav-item,
    .header-account-menu-wrapper.nav-item:hover {
        background: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Eski #hamburgerIcon kutu stillerini geçersiz kıl */
    #hamburgerIcon.header-account-trigger,
    button.header-account-trigger#hamburgerIcon {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: min(280px, 42vw) !important;
        height: var(--header-icon-h, 48px) !important;
        min-height: var(--header-icon-h, 48px) !important;
        max-height: var(--header-icon-h, 48px) !important;
        padding: 5px 12px 5px 6px !important;
        gap: 0 !important;
        border-radius: 10px !important;
        -webkit-border-radius: 10px !important;
        -moz-border-radius: 10px !important;
        background: transparent !important;
        background-color: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        overflow: visible !important;
        position: relative !important;
        transition: border-color 0.2s ease;
    }

    .header-account-trigger:hover,
    .header-account-trigger.is-open {
        background: transparent !important;
        background-color: transparent !important;
        border-color: rgba(255, 255, 255, 0.22) !important;
        transform: none !important;
        box-shadow: none !important;
    }

    body.light-mode .header-account-trigger {
        border-color: var(--header-strip-border, rgba(74, 158, 255, 0.15)) !important;
    }

    body.light-mode .header-account-trigger:hover,
    body.light-mode .header-account-trigger.is-open {
        border-color: rgba(74, 158, 255, 0.28) !important;
    }

    /* Sol: profil */
    .header-account-trigger__avatar {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin: 0;
        border-radius: 50%;
    }

    .header-account-trigger__avatar img {
        border-radius: 50%;
        object-fit: cover;
        object-position: center center;
    }

    /* Orta: kullanıcı adı + bakiye (avatar ile çakışmasın) */
    .header-account-trigger__meta {
        flex: 1 1 auto;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: 2px;
        min-width: 0;
        margin: 0 10px;
        padding: 0;
        line-height: 1.15;
        position: static !important;
        transform: none !important;
    }

    .header-account-trigger__name {
        display: block !important;
        order: 1;
        width: auto;
        max-width: 100%;
        margin: 0;
        padding: 0;
        font-size: 12px;
        font-weight: 600;
        color: #ffffff;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    body.light-mode .header-account-trigger__name {
        color: #111827;
    }

    .header-account-trigger__balance {
        order: 2;
        display: block !important;
        width: auto;
        max-width: 100%;
        margin: 0;
        padding: 0;
        font-size: 12px;
        font-weight: 700;
        color: #4ade80 !important;
        letter-spacing: 0.01em;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.light-mode .header-account-trigger__balance {
        color: #16a34a !important;
    }

    /* Sağ: ok */
    .header-account-trigger__chev {
        flex: 0 0 auto;
        display: block;
        align-self: center;
        margin: 0 0 0 auto;
        padding: 0 0 0 4px;
        font-size: 11px;
        line-height: 1;
        color: #9ca3af;
        opacity: 0.9;
    }

    @media (min-width: 1025px) and (max-width: 1180px) {
        #hamburgerIcon.header-account-trigger,
        button.header-account-trigger#hamburgerIcon {
            max-width: min(220px, 38vw) !important;
        }
    }
}

/* Header Profil GIF — yuvarlak, tam doldur */
.header-account-trigger__avatar:has(> img[src*="/avatar/animated/"]),
.header-account-trigger__avatar:has(> img[src$=".gif"]),
.header-account-trigger__avatar.seller-avatar-wrap:has(img[src*="/avatar/animated/"]),
.header-account-trigger__avatar.seller-avatar-wrap:has(img[src$=".gif"]) {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
}

.header-account-trigger__avatar img[src*="/avatar/animated/"],
.header-account-trigger__avatar img[src$=".gif"],
.header-account-trigger__avatar.seller-avatar-wrap img[src*="/avatar/animated/"],
.header-account-trigger__avatar.seller-avatar-wrap img[src$=".gif"] {
    width: 100%;
    height: 100%;
    border-radius: 50% !important;
    object-fit: cover;
    object-position: center center;
}

@media (min-width: 1025px) {
    .header-account-trigger__avatar:has(> img[src*="/avatar/animated/"]),
    .header-account-trigger__avatar:has(> img[src$=".gif"]),
    .header-account-trigger__avatar.seller-avatar-wrap:has(img[src*="/avatar/animated/"]),
    .header-account-trigger__avatar.seller-avatar-wrap:has(img[src$=".gif"]) {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }
}
