/* inline-feedback.css - Styles pour le bouton de feedback intégré dans les messages */

/* BOUTON FEEDBACK INTÉGRÉ DANS LES MESSAGES */
.inline-feedback-button {
    position: absolute;
    bottom: 6px;
    right: 45px; /* À côté du bouton copier */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    z-index: 100;
}

/* Afficher le bouton au survol du message */
.message.assistant:hover .inline-feedback-button {
    opacity: 1;
    visibility: visible;
}

.inline-feedback-button:hover {
    background: #f8f9fa;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.inline-feedback-button.feedback-sent {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
    opacity: 1;
    visibility: visible;
}

.inline-feedback-button.feedback-sent:hover {
    background: #c3e6cb;
}

/* Ajustement pour le message bubble - espace pour les boutons */
.message.assistant .message-bubble {
    position: relative;
    padding-bottom: 35px; /* Espace pour les boutons */
}

/* POPUP DE FEEDBACK INTÉGRÉE */
.inline-feedback-popup {
    position: absolute;
    bottom: 40px;
    right: 0px;
    width: 320px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    padding: 0;
    z-index: 1000;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.inline-feedback-popup.show {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header de la popup */
.inline-feedback-popup-header {
    background: #303D4E;
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inline-feedback-popup-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.inline-feedback-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.inline-feedback-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Corps de la popup */
.inline-feedback-popup-body {
    padding: 20px;
}

/* Section de notation */
.inline-rating-section {
    margin-bottom: 18px;
    text-align: center;
}

.inline-rating-section p {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.inline-rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.inline-rating-star {
    font-size: 24px;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
}

.inline-rating-star:hover {
    color: #ffd700;
    transform: scale(1.2);
    background: rgba(255, 215, 0, 0.1);
}

.inline-rating-star.active {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Section d'amélioration */
.inline-improvements-section {
    margin-bottom: 15px;
}

.inline-improvements-section p {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.inline-improvement-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.inline-improvement-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.inline-improvement-options label:hover {
    background: #f8f9fa;
    color: #333;
}

.inline-improvement-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: pointer;
}

/* Section commentaire */
.inline-comment-section {
    margin-bottom: 15px;
}

.inline-comment-section textarea {
    width: 100%;
    height: 70px;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.2s ease;
    background: #fafbfc;
}

.inline-comment-section textarea:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.inline-comment-section textarea::placeholder {
    color: #adb5bd;
}

/* Bouton de soumission */
.inline-feedback-submit-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.inline-feedback-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.inline-feedback-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Message de succès */
.inline-feedback-success {
    text-align: center;
    padding: 25px 20px;
    display: none;
}

.inline-feedback-success.show {
    display: block;
}

.inline-success-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #28a745;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.inline-feedback-success p {
    margin: 0;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

.inline-feedback-success strong {
    color: #28a745;
    font-weight: 600;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .inline-feedback-popup {
        width: 300px;
        right: -50px; /* Ajuster le positionnement sur mobile */
    }
    
    .inline-improvement-options {
        grid-template-columns: 1fr; /* Une colonne sur mobile */
    }
    
    .inline-rating-star {
        font-size: 22px; /* Étoiles légèrement plus petites */
    }
    
    .inline-feedback-button {
        right: 40px; /* Ajuster la position sur mobile */
        padding: 5px 6px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .inline-feedback-popup {
        width: 280px;
        right: -80px;
        bottom: 35px;
    }
    
    .inline-feedback-popup-header,
    .inline-feedback-popup-body {
        padding: 12px;
    }
    
    .inline-rating-star {
        font-size: 20px;
        gap: 6px;
    }
    
    .inline-rating-stars {
        gap: 6px;
    }
}

/* Animation pour l'apparition des étoiles */
.inline-rating-star {
    animation: starPop 0.3s ease;
    animation-fill-mode: backwards;
}

.inline-rating-star:nth-child(1) { animation-delay: 0s; }
.inline-rating-star:nth-child(2) { animation-delay: 0.05s; }
.inline-rating-star:nth-child(3) { animation-delay: 0.1s; }
.inline-rating-star:nth-child(4) { animation-delay: 0.15s; }
.inline-rating-star:nth-child(5) { animation-delay: 0.2s; }

@keyframes starPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* États de focus pour l'accessibilité */
.inline-feedback-button:focus,
.inline-rating-star:focus,
.inline-feedback-submit-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Survol des checkboxes */
.inline-improvement-options label:hover input[type="checkbox"] {
    transform: scale(1.1);
}

/* Overlay pour fermer la popup en cliquant à l'extérieur */
.inline-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: none;
}

.inline-feedback-overlay.show {
    display: block;
}