/* ==========================================================================
   FEEDBACK WIDGET STYLES
   ========================================================================== */

/* Floating Button */
.feedback-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
}

.feedback-widget-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.5);
}

.feedback-widget-button:active {
    transform: scale(0.95);
}

.feedback-widget-button svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Modal Overlay */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Modal Content Container */
.feedback-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

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

/* Header */
.feedback-header {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    border-radius: 16px 16px 0 0;
    background: #ffffff;
}

.feedback-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.feedback-header h3 svg {
    color: #10b981;
    width: 22px;
    height: 22px;
}

.feedback-header p {
    margin: 8px 0 0 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.feedback-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Form Body */
.feedback-body {
    padding: 24px;
    background: #fafbfc;
}

/* Field Groups */
.feedback-group {
    margin-bottom: 20px;
}

.feedback-label {
    display: block;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-label svg {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.feedback-label span.required {
    color: #ef4444;
}

/* Input Fields */
.feedback-input,
.feedback-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: white;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.feedback-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.feedback-input:focus,
.feedback-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: #94a3b8;
}

/* Radio Cards (Feedback Type) */
.feedback-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.feedback-type-label {
    position: relative;
    cursor: pointer;
}

.feedback-type-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.feedback-type-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
}

.feedback-type-card svg {
    width: 18px;
    height: 18px;
}

.feedback-type-radio:checked~.feedback-type-card {
    border-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

/* Icon Colors */
.type-icon-bug {
    color: #ef4444;
}

.type-icon-idea {
    color: #f59e0b;
}

.type-icon-question {
    color: #3b82f6;
}

.type-icon-other {
    color: #64748b;
}

/* Char counter */
.feedback-length {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Footer & Buttons */
.feedback-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 16px 16px;
    background: white;
}

.feedback-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

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

.feedback-btn-cancel {
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.feedback-btn-cancel:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.feedback-btn-submit {
    background: #3b82f6;
    /* Usiamo il blu di base che hai nello screen, se preferisci verde metti #10b981 */
    color: white;
}

.feedback-btn-submit:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.feedback-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-btn-submit.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Helper Text */
.feedback-help-text {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Dark mode compatibility per Forfettario Smart (se gestita in dark mode) */
body.dark-mode .feedback-modal-content {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .feedback-header,
body.dark-mode .feedback-footer,
body.dark-mode .feedback-body {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .feedback-header h3,
body.dark-mode .feedback-label {
    color: #f8fafc;
}

body.dark-mode .feedback-header p {
    color: #cbd5e1;
}

body.dark-mode .feedback-type-card,
body.dark-mode .feedback-input,
body.dark-mode .feedback-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .feedback-close {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .feedback-close:hover {
    background: #475569;
    color: #f8fafc;
}

body.dark-mode .feedback-type-radio:checked~.feedback-type-card {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

body.dark-mode .feedback-btn-cancel {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-mode .feedback-btn-cancel:hover {
    background: #334155;
}