/* ============================================
   messages.css - Estilos para la bandeja de mensajes
   ============================================ */

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    gap: 16px;
    flex-wrap: wrap;
}

.message-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-color: var(--primary-color);
}

.message-item.unread {
    background: #f8f9ff;
    border-left: 4px solid var(--primary-color);
}

.message-status {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unread-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.message-sender {
    flex: 2;
    min-width: 150px;
}

.message-sender strong {
    display: block;
    font-size: 16px;
    color: var(--text-main);
}

.message-motivo {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-block;
    background: #f0f4ff;
    padding: 2px 12px;
    border-radius: 20px;
    margin-top: 4px;
}

.message-date {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.message-actions button {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-read {
    color: var(--primary-color);
    background: #f0f4ff;
}

.btn-read:hover {
    background: var(--primary-color);
    color: white;
}

.btn-delete {
    color: #e74c3c;
    background: #fde8e8;
}

.btn-delete:hover {
    background: #e74c3c;
    color: white;
}

/* Modal de lectura */
#modalMessageBody {
    margin-top: 12px;
    line-height: 1.6;
}

#modalMessageBody .detail-row {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

#modalMessageBody .detail-row strong {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 500;
}

#modalMessageBody .detail-row span {
    color: var(--text-main);
}

#modalMessageBody .message-text {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .message-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    .message-sender {
        min-width: unset;
    }
    .message-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
    .message-status {
        width: auto;
        align-self: flex-start;
    }
    #modalMessageBody .detail-row {
        flex-direction: column;
        gap: 4px;
    }
    #modalMessageBody .detail-row strong {
        width: auto;
    }
}