/* ========================================
   CSS SISTEMA DE ROLES
   Agregar a foro-profesional.css o foro.css
   ======================================== */

/* ========================================
   BADGES DE ROL
   ======================================== */

.rol-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
    white-space: nowrap;
}

.rol-badge .rol-icon {
    font-size: 0.875rem;
}

.rol-badge .rol-text {
    text-transform: capitalize;
}

/* Admin - Dorado */
.rol-admin {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* Moderador - Azul/Púrpura */
.rol-moderador {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ========================================
   BADGES DE LOGROS
   ======================================== */

.badges-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #f59e0b;
    margin-left: 0.5rem;
    cursor: help;
    transition: all 0.15s ease;
}

.badges-count:hover {
    background: rgba(245, 158, 11, 0.3);
    transform: scale(1.05);
}

/* ========================================
   HEADER DEL USUARIO
   ======================================== */

.usuario-badge-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.usuario-badge-header.rol-admin {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 165, 0, 0.9));
    color: #000;
}

.usuario-badge-header.rol-moderador {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.9));
    color: #fff;
}

.badge-icon {
    font-size: 1.25rem;
}

/* ========================================
   PANEL DE MODERACIÓN
   ======================================== */

.panel-moderacion {
    position: fixed;
    top: 5rem;
    right: 1rem;
    width: 20rem;
    max-height: calc(100vh - 6rem);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.panel-moderacion.collapsed {
    transform: translateX(calc(100% + 1rem));
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(114, 214, 255, 0.1), rgba(139, 92, 246, 0.1));
}

.panel-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    color: var(--color-primary);
}

.btn-cerrar-panel {
    background: var(--bg-tertiary);
    border: none;
    color: var(--color-text);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-cerrar-panel:hover {
    background: var(--color-error);
    color: white;
}

.panel-content {
    padding: var(--spacing-lg);
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

.mod-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.stat-value {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

/* ========================================
   BOTONES DE MODERACIÓN
   ======================================== */

.btn-mod {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-mod-eliminar:hover {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
}

.btn-mod-fijar:hover {
    background: var(--color-warning);
    color: var(--bg-primary);
    border-color: var(--color-warning);
}

/* ========================================
   MENSAJES FIJADOS
   ======================================== */

.mensaje-fijado {
    border-left: 3px solid var(--color-warning);
    background: rgba(245, 158, 11, 0.05);
    position: relative;
}

.icono-fijado {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.25rem;
    opacity: 0.7;
    z-index: 1;
}

/* ========================================
   MENSAJE INFO (nombre + badges)
   ======================================== */

.mensaje-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* ========================================
   COLORES DISTINTIVOS
   ======================================== */

/* Los colores se aplican inline vía style="background: hsl(...)"
   pero aquí están los estilos base del avatar */

.avatar {
    /* El color viene del backend como HSL */
    /* Ejemplo: background: hsl(240, 65%, 50%) */
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 48rem) {
    .usuario-badge-header {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .badge-icon {
        font-size: 1rem;
    }
    
    .panel-moderacion {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        top: 4rem;
    }
    
    .mod-stats {
        grid-template-columns: 1fr;
    }
    
    .rol-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .badges-count {
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
    }
    
    .btn-mod {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   ANIMACIONES SUAVES
   ======================================== */

.mensaje-item[data-rol="admin"],
.mensaje-item[data-rol="moderador"] {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   EFECTOS HOVER
   ======================================== */

.mensaje-item[data-rol="admin"]:hover {
    border-left-color: #ffd700;
}

.mensaje-item[data-rol="moderador"]:hover {
    border-left-color: #3b82f6;
}

/* ========================================
   TOGGLE PANEL (Botón flotante)
   ======================================== */

.btn-toggle-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 998;
    transition: all 0.3s ease;
}

.btn-toggle-panel:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-toggle-panel:active {
    transform: scale(0.95);
}

/* ========================================
   ESTADOS ESPECIALES
   ======================================== */

/* Usuario baneado (opcional, por si implementas ban visual) */
.mensaje-item[data-baneado="true"] {
    opacity: 0.5;
    filter: grayscale(0.5);
}

/* Mensaje del usuario actual */
.mensaje-item[data-es-mio="true"] {
    background: rgba(114, 214, 255, 0.03);
}