/* ═══════════════════════════════════════════════════════════════════════════
   TEDUCAS Profile Menu / Popover Styles (BEM + Legacy Compatibility)
   ═══════════════════════════════════════════════════════════════════════════ */
.teducas-profile,
.teducas-profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.teducas-profile__trigger,
.teducas-profile-trigger,
button.teducas-profile__trigger,
button.teducas-profile-trigger,
.teducas-profile .teducas-profile__trigger,
.teducas-profile .teducas-profile-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    padding: 4px;
    font-family: inherit;
    color: inherit;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}

.teducas-profile__avatar-wrap,
.teducas-profile-avatar-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.teducas-profile__avatar-wrap .avatar,
.teducas-profile__avatar-wrap img,
.teducas-profile-avatar-wrap .avatar,
.teducas-profile-avatar-wrap img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.teducas-profile__avatar-initials,
.teducas-profile-avatar-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    line-height: 1;
}

.teducas-profile__avatar-wrap img.avatar + .teducas-profile__avatar-initials,
.teducas-profile__avatar-wrap img + .teducas-profile__avatar-initials,
.teducas-profile-avatar-wrap img.avatar + .teducas-profile-avatar-initials,
.teducas-profile-avatar-wrap img + .teducas-profile-avatar-initials {
    display: none;
}

.teducas-profile__chevron,
.teducas-profile-chevron {
    transition: transform 0.2s ease;
    color: inherit;
    flex-shrink: 0;
}

.teducas-profile--open .teducas-profile__chevron,
.teducas-profile.is-open .teducas-profile__chevron,
.teducas-profile-menu.is-open .teducas-profile-chevron,
.teducas-profile[data-force-open="true"] .teducas-profile__chevron,
.teducas-profile[data-force-open="true"] .teducas-profile-chevron {
    transform: rotate(180deg);
}

.teducas-profile__popover,
.teducas-profile-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    overflow: hidden;
}

.teducas-profile--open .teducas-profile__popover,
.teducas-profile.is-open .teducas-profile__popover,
.teducas-profile-menu.is-open .teducas-profile-popover,
.teducas-profile[data-force-open="true"] .teducas-profile__popover,
.teducas-profile[data-force-open="true"] .teducas-profile-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.teducas-profile__popover-profile,
.teducas-profile-popover-profile {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e4e7;
}

.teducas-profile__info,
.teducas-profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teducas-profile__avatar-lg,
.teducas-profile-avatar-lg {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    border: 2px solid #e4e4e7;
}

.teducas-profile__avatar-lg .avatar,
.teducas-profile__avatar-lg img,
.teducas-profile-avatar-lg .avatar,
.teducas-profile-avatar-lg img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.teducas-profile__avatar-initials-lg,
.teducas-profile-avatar-initials-lg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #09090b;
    line-height: 1;
}

.teducas-profile__avatar-lg img.avatar + .teducas-profile__avatar-initials-lg,
.teducas-profile__avatar-lg img + .teducas-profile__avatar-initials-lg,
.teducas-profile-avatar-lg img.avatar + .teducas-profile-avatar-initials-lg,
.teducas-profile-avatar-lg img + .teducas-profile-avatar-initials-lg {
    display: none;
}

.teducas-profile__meta,
.teducas-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.teducas-profile__name,
.teducas-profile-name-lg {
    font-size: 14px;
    font-weight: 600;
    color: #09090b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teducas-profile__email,
.teducas-profile-email {
    font-size: 12px;
    color: #71717a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teducas-profile__switch,
.teducas-profile-switch {
    margin-top: 12px;
}

.teducas-profile__switch-btn,
.teducas-profile-switch-btn,
button.teducas-profile__switch-btn,
button.teducas-profile-switch-btn,
.teducas-profile .teducas-profile__switch-btn,
.teducas-profile .teducas-profile-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    background-color: #f4f4f5;
    color: #18181b;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}

.teducas-profile__switch-btn:hover,
.teducas-profile-switch-btn:hover,
button.teducas-profile__switch-btn:hover,
button.teducas-profile-switch-btn:hover,
.teducas-profile .teducas-profile__switch-btn:hover,
.teducas-profile .teducas-profile-switch-btn:hover {
    background-color: #e4e4e7;
    color: #09090b;
    border-color: #d4d4d8;
}

.teducas-profile__menu-wrap,
.teducas-profile-popover-menu-wrap {
    padding: 4px 0;
}

.teducas-profile__menu,
.teducas-profile-popover-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.teducas-profile__menu li,
.teducas-profile-popover-menu li {
    margin: 0;
    padding: 0;
}

.teducas-profile__item,
.teducas-profile__menu li a,
.teducas-profile-popover-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #18181b;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.teducas-profile__item:hover,
.teducas-profile__menu li a:hover,
.teducas-profile-popover-menu li a:hover {
    background: #f4f4f5;
    color: #09090b;
}

.teducas-profile__item svg,
.teducas-profile__menu li a svg,
.teducas-profile-popover-menu li a svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    color: inherit;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.teducas-profile__item i,
.teducas-profile__menu li a i,
.teducas-profile-popover-menu li a i {
    width: 20px;
    height: 20px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.6;
    color: inherit;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.teducas-profile__item:hover svg,
.teducas-profile__item:hover i,
.teducas-profile__menu li a:hover svg,
.teducas-profile__menu li a:hover i,
.teducas-profile-popover-menu li a:hover svg,
.teducas-profile-popover-menu li a:hover i {
    opacity: 1;
    color: #09090b;
}

.teducas-profile__login-btn,
.teducas-profile-login-btn,
button.teducas-profile__login-btn,
button.teducas-profile-login-btn,
a.teducas-profile__login-btn,
a.teducas-profile-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #09090b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #09090b;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.teducas-profile__login-btn:hover,
.teducas-profile-login-btn:hover,
button.teducas-profile__login-btn:hover,
button.teducas-profile-login-btn:hover,
a.teducas-profile__login-btn:hover,
a.teducas-profile-login-btn:hover {
    background-color: #27272a;
    color: #ffffff;
    border-color: #27272a;
}

.teducas-profile__badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 9999px;
    background: #f4f4f5;
    color: #71717a;
    line-height: 1.2;
}

.teducas-profile__item:hover .teducas-profile__badge {
    background: #e4e4e7;
    color: #18181b;
}

@media (max-width: 767px) {
    .teducas-profile__popover,
    .teducas-profile-popover {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease, visibility 0.3s ease;
    }

    .teducas-profile--open .teducas-profile__popover,
    .teducas-profile.is-open .teducas-profile__popover,
    .teducas-profile-menu.is-open .teducas-profile-popover,
    .teducas-profile[data-force-open="true"] .teducas-profile__popover,
    .teducas-profile[data-force-open="true"] .teducas-profile-popover {
        transform: translateY(0);
    }
}

