/**
 * Feedback Widget - Bouton flottant et modal de feedback
 * Design cohérent avec la charte graphique Bubul
 */

/* ===== BOUTON FLOTTANT ===== */

.feedback-floating-btn {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-full);
    background: var(--gradient-main);
    border: none;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    z-index: var(--z-index-fixed);
}

.feedback-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.feedback-floating-btn:active {
    transform: translateY(0);
}

.feedback-floating-btn svg {
    width: 24px;
    height: 24px;
    color: var(--color-white) !important;
}

.feedback-floating-btn svg .duoicon-primary-layer,
.feedback-floating-btn svg .duoicon-secondary-layer {
    color: var(--color-white);
    opacity: 1;
}

/* ===== MODAL OVERLAY ===== */

.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-index-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--spacing-md);
}

.feedback-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MODAL ===== */

.feedback-modal {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.feedback-modal-overlay.active .feedback-modal {
    transform: scale(1) translateY(0);
}

/* ===== MODAL HEADER ===== */

.feedback-modal-header {
    background: linear-gradient(135deg, #0A6BC4 0%, #0C81E4 50%, #3AB8E8 100%);
    padding: 50px 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

/* Formes décoratives (cercles subtils) */
.feedback-modal-header::before,
.feedback-modal-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.feedback-modal-header::before {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -50px;
}

.feedback-modal-header::after {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: -30px;
}

.feedback-modal-header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    position: relative;
    z-index: 1;
}

.feedback-header-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-header-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-white) !important;
}

.feedback-header-icon svg .duoicon-primary-layer,
.feedback-header-icon svg .duoicon-secondary-layer {
    color: var(--color-white) !important;
    opacity: 1;
}

.feedback-modal-header h3 {
    margin: 0 0 4px 0;
    font-size: var(--font-size-xl);
    color: var(--color-white);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-secondary);
}

.feedback-modal-header p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
}

.feedback-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--color-white);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    position: relative;
    z-index: 2;
}

.feedback-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.feedback-close-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== MODAL BODY ===== */

.feedback-modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    flex: 1;
}

.feedback-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
}

/* ===== FORMULAIRE ===== */

.feedback-form-content {
    margin-bottom: var(--spacing-lg);
}

.feedback-form-content .mb-3 {
    margin-bottom: var(--spacing-lg);
}

.feedback-form-content label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-black);
    font-size: var(--font-size-sm);
}

.feedback-form-content .form-control,
.feedback-form-content .form-select {
    width: 100%;
    padding: 12px 16px;
    border: var(--border-width-thin) solid var(--color-gray);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
    background: var(--color-white);
    color: var(--color-black);
}

.feedback-form-content .form-control:focus,
.feedback-form-content .form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(12, 129, 228, 0.1);
}

.feedback-form-content textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.feedback-form-content .invalid-feedback {
    display: block;
    margin-top: var(--spacing-sm);
    color: var(--color-error);
    font-size: var(--font-size-sm);
}

/* ===== FOOTER FORMULAIRE ===== */

.feedback-form-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    padding-top: var(--spacing-lg);
    border-top: var(--border-width-thin) solid var(--color-gray-light);
}

/* ===== REWARD BOX ===== */

.feedback-reward-box {
    margin: 0 var(--spacing-xl) var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(12, 129, 228, 0.04);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.reward-icon-inline {
    flex-shrink: 0;
    color: var(--color-primary);
}

.feedback-reward-box p {
    margin: 0;
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

/* ===== ALERTS ===== */

.feedback-modal-body .alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.feedback-modal-body .alert-success {
    background-color: rgba(48, 147, 68, 0.1);
    border-left: var(--border-width-thick) solid var(--color-success);
    color: var(--color-success);
}

.feedback-modal-body .alert-danger {
    background-color: rgba(209, 0, 0, 0.1);
    border-left: var(--border-width-thick) solid var(--color-error);
    color: var(--color-error);
}

.feedback-modal-body .btn-close {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.feedback-modal-body .btn-close:hover {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .feedback-floating-btn {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 48px;
        height: 48px;
    }

    .feedback-floating-btn svg {
        width: 20px;
        height: 20px;
    }

    .feedback-modal {
        max-height: 95vh;
        margin: var(--spacing-sm);
    }

    .feedback-modal-header,
    .feedback-modal-body {
        padding: var(--spacing-lg);
    }

    .feedback-form-footer {
        flex-direction: column-reverse;
    }

    .feedback-form-footer .btn {
        width: 100%;
        justify-content: center;
    }
}
