/* Estilos customizados para Chat PHP */

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-enter {
    animation: fadeInUp 0.3s ease-out;
}

/* Mensagens */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 20px;
    margin-bottom: 8px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-left: auto;
    border-bottom-right-radius: 8px;
}

.message-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    margin-right: auto;
    border-bottom-left-radius: 8px;
}

.message-other {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    margin-right: auto;
    border-bottom-left-radius: 8px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
    text-align: right;
}

/* Avatar */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.avatar-user { background: #667eea; }
.avatar-admin { background: #f093fb; }
.avatar-other { background: #4facfe; }

/* Conversas na sidebar */
.conversation-item {
    padding: 12px 16px;
    border-bottom: 1px solid #374151;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #374151;
}

.conversation-item.active {
    background-color: #1f2937;
    border-left: 4px solid #3b82f6;
}

.conversation-badge {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Badge Admin */
.badge-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* Links nas mensagens */
.message a.link {
    color: #fff;
    text-decoration: underline;
    word-break: break-all;
}

/* Responsivo */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
    
    .message {
        max-width: 85%;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificação */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
