/* =============================================
   SYSTÈME DE FEEDBACK - Styles externalisés
   ============================================= */

/* Bouton flottant */
.feedback-floating-btn {
    position: fixed;
    bottom: 78px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.feedback-floating-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}

.feedback-floating-btn:active {
    transform: scale(0.95);
}

.feedback-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.4);
    animation: feedback-pulse 2s infinite;
}

@keyframes feedback-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Modal */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000000;
    animation: feedbackFadeIn 0.3s ease-out;
}

.feedback-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes feedbackFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.feedback-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: feedbackSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

@keyframes feedbackSlideUp {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header */
.feedback-modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feedback-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    animation: feedback-heart-beat 1.5s infinite;
}

@keyframes feedback-heart-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.feedback-status {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: feedback-blink 2s infinite;
}

@keyframes feedback-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.feedback-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.feedback-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body */
.feedback-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.feedback-welcome-msg {
    margin-bottom: 1.5rem;
}

.feedback-bot-msg {
    display: flex;
    gap: 0.75rem;
    animation: feedbackSlideIn 0.5s ease-out;
}

@keyframes feedbackSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.feedback-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    animation: feedback-subtle-glow 3s infinite;
}

@keyframes feedback-subtle-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
}

.feedback-bot-bubble {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 15px;
    border-top-left-radius: 5px;
    flex: 1;
}

.feedback-bot-bubble p {
    margin: 0 0 0.75rem;
}

.feedback-bot-bubble p:last-child {
    margin-bottom: 0;
}

.feedback-bot-bubble ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.feedback-bot-bubble li {
    margin: 0.25rem 0;
}

/* Type selector */
.feedback-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feedback-type-btn {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #6b7280;
}

.feedback-type-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.feedback-type-btn.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    transform: scale(1.05);
}

/* Formulaire */
.feedback-form {
    animation: feedbackSlideIn 0.5s ease-out 0.2s both;
}

.feedback-input-group {
    margin-bottom: 1rem;
    position: relative;
}

.feedback-textarea,
.feedback-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    resize: vertical;
}

.feedback-textarea:focus,
.feedback-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.feedback-char-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.feedback-submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feedback-submit-btn:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #0e7490 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
}

.feedback-submit-btn:active {
    transform: translateY(0);
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message de succès */
.feedback-success-msg {
    text-align: center;
    animation: feedbackSlideIn 0.5s ease-out;
}

.feedback-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: feedbackSuccessPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes feedbackSuccessPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.feedback-success-msg h4 {
    color: #10b981;
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.feedback-success-msg p {
    color: #6b7280;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.feedback-new-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-new-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .feedback-floating-btn {
        width: 56px;
        height: 56px;
        bottom: 68px;
        right: 15px;
        font-size: 22px;
    }

    .feedback-modal.active {
        align-items: flex-start;
        padding-top: 64px;
        padding-bottom: 12px;
    }
    
    .feedback-modal-content {
        width: 95%;
        max-height: calc(100dvh - 76px);
        border-radius: 15px;
    }
    
    .feedback-modal-header {
        padding: 1.25rem;
    }
    
    .feedback-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .feedback-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .feedback-modal-body {
        padding: 1.25rem;
    }

    .feedback-form {
        padding-bottom: 0.75rem;
    }

    .feedback-submit-btn {
        position: sticky;
        bottom: 0;
        z-index: 1;
    }
    
    .feedback-type-selector {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
