/**
 * Estilos para el sistema de soporte - Frontend
 */

/* Badge de mensajes no leídos */
.rz-unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    vertical-align: middle;
}

/* Icono "NEW" estilo comic/pop art */
.rz-new-icon {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1;
    animation: pulse-new 2s ease-in-out infinite;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Animación de pulso para el badge NEW */
@keyframes pulse-new {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(251, 191, 36, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 6px rgba(251, 191, 36, 0.6);
    }
}

/* Contador de mensajes no leídos */
.rz-unread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    line-height: 1;
}

/* Variante alternativa: Badge estilo "notificación" */
.rz-unread-badge.rz-badge-notification {
    position: relative;
}

.rz-unread-badge.rz-badge-notification::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Variante: Badge estilo "estallido" */
.rz-unread-badge.rz-badge-burst .rz-new-icon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #dc2626 100%);
    position: relative;
    overflow: visible;
}

.rz-unread-badge.rz-badge-burst .rz-new-icon::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: burst-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes burst-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Estilo para fila con mensajes no leídos */
tr[style*="background-color: #fef3c7"] {
    border-left: 3px solid #fbbf24 !important;
}

/* Hover en fila con mensajes no leídos */
tr[style*="background-color: #fef3c7"]:hover {
    background-color: #fde68a !important;
}

/* Responsive: ajustar tamaño del badge en móviles */
@media (max-width: 768px) {
    .rz-new-icon {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .rz-unread-count {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
    }
}

/* Modo oscuro (si está activo) */
@media (prefers-color-scheme: dark) {
    .rz-new-icon {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        box-shadow: 0 2px 6px rgba(251, 191, 36, 0.5);
    }
    
    tr[style*="background-color: #fef3c7"] {
        background-color: rgba(251, 191, 36, 0.15) !important;
        border-left-color: #fbbf24 !important;
    }
    
    tr[style*="background-color: #fef3c7"]:hover {
        background-color: rgba(251, 191, 36, 0.25) !important;
    }
}

/* Tabla responsive para móvil */
.rz-tickets-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rz-tickets-list table,
.rz-tickets-table {
    min-width: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    .rz-tickets-list {
        overflow-x: visible;
    }
    
    .rz-tickets-list table,
    .rz-tickets-table,
    .rz-tickets-list thead,
    .rz-tickets-list tbody,
    .rz-tickets-list th,
    .rz-tickets-list td,
    .rz-tickets-list tr {
        display: block;
    }
    
    .rz-tickets-list thead tr,
    .rz-tickets-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .rz-tickets-list tr,
    .rz-tickets-table tbody tr {
        border: 1px solid #e5e7eb !important;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 12px;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        display: block !important;
    }
    
    .rz-tickets-list td,
    .rz-tickets-table td {
        border: none !important;
        border-bottom: 1px solid #f3f4f6 !important;
        position: relative;
        padding: 10px 10px 10px 40% !important;
        text-align: left;
        display: block !important;
    }
    
    .rz-tickets-list td:last-child,
    .rz-tickets-table td:last-child {
        border-bottom: none !important;
    }
    
    .rz-tickets-list td:before,
    .rz-tickets-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #374151;
    }
    
    .rz-tickets-list td:first-child:before,
    .rz-tickets-table td:first-child:before {
        content: 'ID:';
    }
    
    .rz-tickets-list td:nth-child(2):before,
    .rz-tickets-table td:nth-child(2):before {
        content: 'Asunto:';
    }
    
    .rz-tickets-list td:nth-child(3):before,
    .rz-tickets-table td:nth-child(3):before {
        content: 'Categoría:';
    }
    
    .rz-tickets-list td:nth-child(4):before,
    .rz-tickets-table td:nth-child(4):before {
        content: 'Estado:';
    }
    
    .rz-tickets-list td:nth-child(5):before,
    .rz-tickets-table td:nth-child(5):before {
        content: 'Fecha:';
    }
    
    .rz-tickets-list td:nth-child(6):before,
    .rz-tickets-table td:nth-child(6):before {
        content: 'Acciones:';
    }
}
