/* TalkingPoints Header Styles */
#grv-tp-header-container {
    margin-top: 1em;
    min-height: 64px;
}

/* Logged Out State Styles */
.grv-tp-welcome-message {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 1.5em;
    padding: 1.5em 2em;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid rgb(var(--primary-color));
}

.box-container {
    padding: 0 2.5em 0 2.5em;
}

.grv-tp-welcome-message p {
    margin: 0;
    font-size: 1.4em;
    color: #333;
}

.grv-tp-login-button {
    padding: 5px 20px;
    background: rgb(var(--primary-color));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.grv-tp-login-button:hover {
    opacity: 0.9;
}

/* Logged In State Styles */
.tp-user-profile-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tp-user-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1em;
}

.tp-avatar-img {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tp-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.tp-user-greeting {
    font-size: 1.8em;
    font-weight: 700;
    color: #000;
}

.tp-user-email {
    font-size: 1.6em;
    color: #666;
}


.tp-user-actions {
    display: flex;
    gap: 0.5em;
}

.tp-user-btn {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
}

.tp-settings-btn {
    background: rgb(var(--primary-color));
    color: white;
}

.tp-settings-btn:hover {
    opacity: 0.9;
}

.tp-signout-btn {
    background: rgb(var(--primary-color));
    color: white;
}

.tp-signout-btn:hover {
    opacity: 0.9;
}

/* Avatar with circular progress ring */
.tp-avatar-ring-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.tp-avatar-ring-wrapper .tp-avatar-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    z-index: 1;
}

.tp-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
}

.tp-progress-ring__fill {
    transition: stroke-dashoffset 0.6s ease;
}

/* Badge row sits under the handle in tp-user-info */
.tp-avatar-badges-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 4px;
}

/* Achievement badges container overlaps slightly behind the tier icon */
.tp-avatar-badges-row #grv-tp-user-badges {
    display: inline-flex;
    align-items: center;
    margin-left: -6px;
}

/* Each subsequent achievement badge overlaps the previous */
.tp-avatar-badges-row .tp-achievement-badge + .tp-achievement-badge {
    margin-left: -8px;
}

/* Tier Badge Overlay — now inline in the badge row */
.tp-tier-badge-overlay {
    position: relative;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
}

.tp-tier-badge-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
    z-index: 0;
}

.tp-tier-badge-overlay .tp-tier-overlay__img {
    position: relative;
    z-index: 1;
    transition: transform 0.15s ease;
}

.tp-tier-badge-overlay:hover::before,
.tp-tier-badge-overlay:hover .tp-tier-overlay__img {
    transform: scale(1.3);
}

.tp-tier-overlay__img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    display: block;
}


/* Tier Badge Overlay Tooltip */
.tp-tier-badge-overlay {
    cursor: pointer;
}

.tp-tier-overlay-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #4a4a4a;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.tp-tier-overlay-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #4a4a4a;
}

.tp-tier-badge-overlay:hover .tp-tier-overlay-tooltip,
.tp-achievement-badge:hover .tp-tier-overlay-tooltip {
    display: block;
}

/* Scope the hover-scale to the icon only so the tooltip keeps its size */
#grv-tp-user-badges .tp-achievement-badge {
    transform: none !important;
}

/* +N overflow button */
.tp-badge-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    margin-left: -6px;
    border-radius: 50%;
    background: #4a4a4a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s ease;
}

.tp-badge-more:hover {
    transform: scale(1.2);
}

/* Overflow tooltip — matches avatar popup style */
.tp-badge-more__tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 20;
    white-space: nowrap;
}

.tp-badge-more__tooltip--open {
    display: block;
}

.tp-badge-more__arrow {
    position: absolute;
    bottom: 100%;
    right: 8px;
    border: 7px solid transparent;
    border-bottom-color: #fff;
}

.tp-badge-more__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-badge-more__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-badge-more__icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.tp-badge-more__emoji {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tp-badge-more__name {
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

#grv-tp-user-badges .tp-achievement-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

#grv-tp-user-badges .tp-achievement-badge img {
    width: 25px;
    height: 25px;
    transition: transform 0.15s ease;
}

#grv-tp-user-badges .tp-achievement-badge:hover img {
    transform: scale(1.3);
}
