/* User Hover Card System */

.user-hover-card {
    position: absolute;
    z-index: 9999;
    width: 520px;
    background: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.user-hover-card.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header Section */
.hover-card-header {
    padding: 20px;
    background: #2c3e50;
    border-bottom: 1px solid #34495e;
}

.hover-card-user-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.hover-card-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.hover-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37);
    padding: 2px;
}

.hover-card-avatar .online-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #00ff00;
    border: 2px solid #2c3e50;
    border-radius: 50%;
}

.hover-card-details {
    flex: 1;
    min-width: 0;
}

.hover-card-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 8px;
}

.hover-card-left-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hover-card-right-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    flex-shrink: 0;
}

.hover-card-username {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.hover-card-bundle {
    font-size: 13px;
    color: #f39c12;
    font-weight: 600;
    margin: 0;
}

.hover-card-dates {
    color: #e8eaed;
    font-size: 12px;
    line-height: 1.3;
}

.hover-card-dates div {
    margin: 0;
}

/* Role Badges */
.hover-card-role-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.role-admin {
    background: #28a745;
    color: white;
}

.role-badge.role-staff {
    background: #007bff;
    color: white;
}

.role-badge.role-moderator {
    background: #6f42c1;
    color: white;
}

.hover-card-user-title {
    color: #e8eaed;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* User tier styling */
.hover-card-user-tier {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.hover-card-tier-info {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Tier-specific styling for hover card */
.hover-card-user-title.hover-card-tier {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-card-tier-info {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Stats Section */
.hover-card-stats {
    padding: 16px 20px;
    background: #34495e;
    border-top: 1px solid #3c5569;
}

.hover-card-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hover-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hover-stat-label {
    font-size: 13px;
    color: #e8eaed;
    font-weight: 500;
}

.hover-stat-number {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

/* Badges Section */
.hover-card-badges {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.hover-card-badges-title {
    color: #ffd700;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hover-card-badges-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hover-card-badge {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    color: #ffd700;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Actions Section */
.hover-card-actions {
    padding: 16px 20px;
    background: #2c3e50;
    border-top: 1px solid #34495e;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hover-action-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #3c5569;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.hover-action-btn:hover {
    background: #4a5568;
    border-color: #5a6578;
    text-decoration: none;
    color: #ffffff;
}

.hover-action-btn.following {
    background: #28a745;
    border-color: #1e7e34;
    color: white;
}

.hover-action-btn.following:hover {
    background: #218838;
    border-color: #1c7430;
    color: white;
}

/* Loading State */
.hover-card-loading {
    padding: 2rem;
    text-align: center;
    color: #8b949e;
}

.hover-card-loading i {
    font-size: 1.5rem;
    color: #ffd700;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .user-hover-card {
        width: 280px;
    }
    
    .hover-card-header {
        padding: 1rem;
    }
    
    .hover-card-stats,
    .hover-card-badges,
    .hover-card-actions {
        padding: 0.75rem 1rem;
    }
    
    .hover-card-actions {
        flex-direction: column;
    }
}

/* Animation for card entrance */
.user-hover-card.entering {
    animation: cardEntrance 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hover states for username triggers */
.username-hoverable {
    position: relative;
    cursor: pointer;
    transition: color 0.2s ease;
}

.username-hoverable:hover {
    color: #ffed4e !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Arrow pointer for card positioning */
.user-hover-card::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffd700;
}

.user-hover-card.position-bottom::after {
    top: auto;
    bottom: -8px;
    border-bottom: none;
    border-top: 8px solid #ffd700;
}

.user-hover-card.position-left::after {
    top: 20px;
    left: -8px;
    transform: none;
    border-left: none;
    border-right: 8px solid #ffd700;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.user-hover-card.position-right::after {
    top: 20px;
    right: -8px;
    left: auto;
    transform: none;
    border-right: none;
    border-left: 8px solid #ffd700;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}
