/* NOVA Floating Chat Styles */
#nova-floating-chat {
    position: fixed;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Position par défaut - Bas à droite */
#nova-floating-chat {
    bottom: 20px;
    right: 20px;
}

/* Position bas à gauche */
#nova-floating-chat.nova-position-left {
    right: auto;
    left: 20px;
}

/* Bulle flottante */
.nova-chat-bubble {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: nova-float 3s ease-in-out infinite;
}

.nova-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.nova-bubble-icon {
    font-size: 24px;
    line-height: 1;
}

.nova-bubble-text {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    opacity: 0.9;
}

.nova-bubble-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
}

.nova-bubble-notification.has-notification {
    display: block;
    animation: nova-pulse 2s infinite;
}

/* Fenêtre de chat */
.nova-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#nova-floating-chat.nova-floating-open .nova-chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Position gauche */
#nova-floating-chat.nova-position-left .nova-chat-window {
    right: auto;
    left: 0;
}

/* En-tête */
.nova-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nova-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nova-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nova-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.nova-status {
    font-size: 12px;
    opacity: 0.8;
}

.nova-header-actions {
    display: flex;
    gap: 8px;
}

.nova-minimize-btn, .nova-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.nova-minimize-btn:hover, .nova-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.nova-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.nova-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.nova-ai-message {
    align-items: flex-start;
}

.nova-user-message {
    align-items: flex-end;
}

.nova-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.nova-ai-message .nova-message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nova-user-message .nova-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.nova-message-content p {
    margin: 0;
    line-height: 1.4;
}

.nova-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Input */
.nova-chat-input {
    padding: 0;
    border-top: 1px solid #e9ecef;
}

.nova-input-container {
    display: flex;
    align-items: flex-end;
    padding: 16px;
    gap: 12px;
}

#novaMessageInput {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

#novaMessageInput:focus {
    border-color: #667eea;
}

.nova-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nova-send-btn:hover {
    transform: scale(1.05);
}

.nova-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.nova-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

.nova-chat-footer small {
    color: #6c757d;
}

.nova-chat-footer a {
    color: #667eea;
    text-decoration: none;
}

.nova-chat-footer a:hover {
    text-decoration: underline;
}

/* Animation de frappe */
.nova-typing {
    display: inline-flex;
    gap: 4px;
}

.nova-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: nova-typing 1.4s infinite ease-in-out;
}

.nova-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.nova-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Animations */
@keyframes nova-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes nova-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes nova-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    #nova-floating-chat {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .nova-chat-window {
        width: calc(100vw - 20px);
        height: 70vh;
        right: 0;
        left: 0;
        margin: 0 auto;
    }
    
    .nova-chat-bubble {
        width: 50px;
        height: 50px;
    }
    
    .nova-bubble-icon {
        font-size: 20px;
    }
    
    .nova-bubble-text {
        font-size: 9px;
    }
}

/* États fermé/ouvert */
.nova-floating-closed .nova-chat-window {
    display: none;
}

.nova-floating-open .nova-chat-bubble {
    transform: scale(0.9);
    opacity: 0.7;
}