/**
 * Chat Message Delete Button Styles
 * Glass-morphism design to match existing UI
 */

.message-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    color: rgba(255, 255, 255, 0.8);
}

.message-delete-btn:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    transform: scale(1.1);
    opacity: 1 !important;
}

.message-delete-btn:active {
    transform: scale(0.95);
}

/* Show delete button on message hover */
.ai-message:hover .message-delete-btn {
    opacity: 0.7;
}

.ai-message .message-delete-btn:hover {
    opacity: 1 !important;
}

/* Ensure message content has relative positioning */
.ai-message-content {
    position: relative;
}

/* For user messages (different layout) */
.ai-message.user .message-delete-btn {
    left: 8px;
    right: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .message-delete-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        opacity: 0.5; /* More visible on mobile */
    }
    
    .ai-message:hover .message-delete-btn {
        opacity: 0.8;
    }
}

/* For streaming messages, hide delete button */
.ai-message.streaming .message-delete-btn {
    display: none;
}

/* For typing indicator, hide delete button */
.ai-message.typing-indicator .message-delete-btn,
.ai-welcome-message .message-delete-btn {
    display: none;
}

/* Animation for button appearance */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

.ai-message:hover .message-delete-btn {
    animation: fadeInScale 0.2s ease-out;
}

/* Delete Success Notification with Undo */
.delete-success-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideInUp 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.undo-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #4ade80;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.undo-btn:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: #4ade80;
    transform: translateY(-1px);
}

.undo-btn:active {
    transform: translateY(0);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile adjustments for notification */
@media (max-width: 768px) {
    .delete-success-notification {
        left: 10px;
        right: 10px;
        transform: none;
        bottom: 10px;
    }
}