/**
 * User Bio Tooltips
 */

.user-tooltip {
    position: absolute;
    background: #2c3e50;
    color: #ecf0f1;
    border: 1px solid #34495e;
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
    word-wrap: break-word;
    transform: translateY(10px);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Enhanced styling for avatar hover tooltips */
.user-tooltip.avatar-hover {
    min-width: 250px;
    padding: 16px;
}

.user-tooltip.avatar-hover .tooltip-avatar-large {
    flex-shrink: 0;
}

.user-tooltip .tooltip-avatar,
.user-tooltip .tooltip-avatar-large {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-tooltip .tooltip-avatar img,
.user-tooltip .tooltip-avatar-large img {
    border: 2px solid #34495e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.user-tooltip .tooltip-avatar-large img {
    transform: scale(1.1);
}

.user-tooltip .tooltip-content {
    flex: 1;
    min-width: 0; /* Allow content to shrink */
}

/* Fallback for tooltips without avatars - Remove :has() selector for better browser compatibility */
.user-tooltip:not(.avatar-hover) .tooltip-content {
    display: block;
}

.user-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #2c3e50;
}

.user-tooltip .tooltip-username {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 6px;
    font-size: 14px;
    display: block;
}

.user-tooltip .tooltip-bio {
    color: #bdc3c7;
    font-style: italic;
    line-height: 1.3;
}

.user-tooltip .tooltip-loading {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 8px;
}

.user-tooltip .tooltip-error {
    color: #e74c3c;
    font-style: italic;
    text-align: center;
    padding: 8px;
}

/* Hover triggers */
.user-tooltip-trigger {
    position: relative;
    cursor: pointer;
}

.user-tooltip-trigger:hover {
    text-decoration: underline;
}

/* Special styling for avatar triggers */
.user-tooltip-trigger img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-tooltip-trigger img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Position tooltip above trigger when near bottom of screen */
.user-tooltip.position-above {
    transform: translateY(-10px);
}

.user-tooltip.position-above.show {
    transform: translateY(0);
}

.user-tooltip.position-above::before {
    top: auto;
    bottom: -6px;
    border-bottom: none;
    border-top: 6px solid #2c3e50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-tooltip {
        max-width: 280px;
        font-size: 12px;
        padding: 10px;
        gap: 8px;
    }
    
    .user-tooltip.avatar-hover {
        min-width: 220px;
        padding: 12px;
    }
    
    .user-tooltip .tooltip-username {
        font-size: 13px;
    }
    
    .user-tooltip .tooltip-avatar img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .user-tooltip .tooltip-avatar-large img {
        width: 60px !important;
        height: 60px !important;
    }
}