/**
 * FEEDBACK-WIDGET.CSS
 * 
 * Sistema de Feedback Premium - Totalmente integrado ao design atual
 * 
 * Features:
 * - Compatível com temas light/dark
 * - Glassmorphism consistente
 * - Animações premium
 * - Responsivo mobile-first
 * - Acessibilidade A11y
 * 
 * @author BluePartner Dashboard Premium
 * @version 1.0
 */

/* ========================================
   🎯 BOTÃO FLUTUANTE - Fixed Position
======================================== */

.feedback-widget-button {
    /* Positioning */
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    
    /* Visual - Glassmorphism Premium */
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur-premium, blur(30px));
    -webkit-backdrop-filter: var(--glass-blur-premium, blur(30px));
    border: 1px solid var(--card-border);
    border-radius: 50%;
    
    /* Shadow & Glow */
    box-shadow: 
        0 8px 32px var(--shadow, rgba(0, 0, 0, 0.3)),
        0 4px 16px var(--glow, rgba(0, 217, 255, 0.2)),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Typography */
    color: var(--accent-solid, #00D9FF);
    font-size: 24px;
    
    /* Interaction */
    cursor: pointer;
    user-select: none;
    
    /* Animation */
    transition: all var(--duration-fast, 0.4s) var(--ease-out-premium, cubic-bezier(0.25, 0.46, 0.45, 0.94));
    transform: translate3d(0, 0, 0);
    will-change: transform, box-shadow;
    
    /* Pulse Animation */
    animation: feedback-pulse 3s ease-in-out infinite;
}

/* Ícone dentro do botão */
.feedback-widget-button svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    filter: drop-shadow(0 2px 4px var(--glow, rgba(0, 217, 255, 0.3)));
    transition: transform var(--duration-fast, 0.4s) var(--ease-back, cubic-bezier(0.68, -0.55, 0.265, 1.55));
}

/* Hover State */
.feedback-widget-button:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 
        0 16px 48px var(--shadow, rgba(0, 0, 0, 0.4)),
        0 8px 32px var(--glow, rgba(0, 217, 255, 0.4)),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: var(--accent-solid, #00D9FF);
}

.feedback-widget-button:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* Active State */
.feedback-widget-button:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px var(--shadow, rgba(0, 0, 0, 0.3)),
        0 4px 16px var(--glow, rgba(0, 217, 255, 0.3));
}

/* Focus State (Accessibility) */
.feedback-widget-button:focus {
    outline: 3px solid var(--accent-solid, #00D9FF);
    outline-offset: 4px;
}

/* Pulse Animation */
@keyframes feedback-pulse {
    0%, 100% {
        box-shadow: 
            0 8px 32px var(--shadow, rgba(0, 0, 0, 0.3)),
            0 4px 16px var(--glow, rgba(0, 217, 255, 0.2)),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 12px 40px var(--shadow, rgba(0, 0, 0, 0.35)),
            0 6px 24px var(--glow, rgba(0, 217, 255, 0.4)),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

/* ========================================
   💬 MODAL DE FEEDBACK - Painel Lateral Direito
======================================== */

.feedback-widget-modal {
    /* Positioning - FORÇA FULLSCREEN */
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    
    /* Layout - ALINHA À DIREITA */
    display: none !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    flex-direction: row !important;
    
    /* Background Overlay */
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    
    /* Animation */
    opacity: 0;
    transition: opacity var(--duration-normal, 0.5s) var(--ease-out-premium, ease-out);
}

.feedback-widget-modal.show {
    display: flex !important;
    opacity: 1;
}

/* Modal Content - Painel Lateral DIREITO */
.feedback-modal-content {
    /* Layout - PAINEL FIXO À DIREITA */
    position: relative !important;
    width: 450px !important;
    max-width: 90vw !important;
    height: 100vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    margin-left: auto !important; /* FORÇA À DIREITA */
    
    /* Visual - Glassmorphism Premium */
    background: var(--card-bg) !important;
    backdrop-filter: var(--glass-blur-premium, blur(30px)) !important;
    -webkit-backdrop-filter: var(--glass-blur-premium, blur(30px)) !important;
    border-left: 1px solid var(--card-border) !important;
    border-right: none !important;
    border-radius: 0 !important; /* Sem border-radius nas laterais */
    
    /* Spacing */
    padding: 32px !important;
    
    /* Shadow - Sombra à esquerda (pois painel está à direita) */
    box-shadow: 
        -8px 0 32px var(--shadow, rgba(0, 0, 0, 0.4)),
        -4px 0 16px var(--glow, rgba(0, 217, 255, 0.15)),
        inset 1px 0 0 rgba(255, 255, 255, 0.1) !important;
    
    /* Animation - Desliza DA DIREITA */
    transform: translateX(100%) !important;
    opacity: 0;
    transition: all var(--duration-normal, 0.5s) var(--ease-out-premium, cubic-bezier(0.25, 0.46, 0.45, 0.94)) !important;
}

.feedback-widget-modal.show .feedback-modal-content {
    transform: translateX(0) !important;
    opacity: 1;
}

/* Modal Header */
.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.feedback-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    
    font-family: var(--font-family-display, 'Inter', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.feedback-modal-title svg {
    width: 28px;
    height: 28px;
    fill: var(--accent-solid, #00D9FF);
    filter: drop-shadow(0 2px 8px var(--glow, rgba(0, 217, 255, 0.3)));
}

/* Close Button */
.feedback-modal-close {
    width: 36px;
    height: 36px;
    padding: 0;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    
    cursor: pointer;
    transition: all var(--duration-fast, 0.4s) ease;
}

.feedback-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #EF4444;
    transform: rotate(90deg);
}

/* ========================================
   📝 FORMULÁRIO DE FEEDBACK
======================================== */

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.feedback-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.025em;
}

/* Type Selection - Radio Buttons */
.feedback-type-options {
    display: grid; /* Mudado para GRID para controle exato */
    grid-template-columns: repeat(4, 1fr); /* 4 colunas IGUAIS */
    gap: 12px;
}

.feedback-type-option {
    /* Removido flex: 1 e min-width */
    width: 100%; /* Ocupa toda a célula do grid */
}

.feedback-type-option input[type="radio"] {
    display: none;
}

.feedback-type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    width: 100%; /* FORÇA largura total */
    padding: 12px 16px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center; /* Centraliza texto */
    
    cursor: pointer;
    transition: all var(--duration-fast, 0.4s) ease;
    
    /* Garante que o texto não quebre */
    white-space: nowrap;
}

.feedback-type-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-solid, #00D9FF);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.feedback-type-option input[type="radio"]:checked + .feedback-type-label {
    background: linear-gradient(135deg, var(--accent-solid, #00D9FF) 0%, rgba(0, 217, 255, 0.8) 100%);
    border-color: var(--accent-solid, #00D9FF);
    color: white;
    box-shadow: 0 4px 15px var(--glow, rgba(0, 217, 255, 0.3));
}

/* Rating Stars */
.feedback-rating {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feedback-star {
    width: 32px;
    height: 32px;
    
    background: none;
    border: none;
    padding: 0;
    
    color: var(--text-secondary);
    font-size: 28px;
    
    cursor: pointer;
    transition: all var(--duration-fast, 0.4s) var(--ease-back, cubic-bezier(0.68, -0.55, 0.265, 1.55));
    filter: grayscale(1);
}

.feedback-star:hover,
.feedback-star.active {
    color: #FFD700;
    filter: grayscale(0) drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5));
    transform: scale(1.2) rotate(15deg);
}

/* Text Inputs */
.feedback-input,
.feedback-textarea {
    width: 100%;
    padding: 14px 16px;
    
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    
    transition: all var(--duration-fast, 0.4s) ease;
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.feedback-input:focus,
.feedback-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-solid, #00D9FF);
    box-shadow: 0 0 0 3px var(--glow, rgba(0, 217, 255, 0.2));
}

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

/* Checkbox */
.feedback-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-checkbox {
    width: 20px;
    height: 20px;
    
    border: 2px solid var(--card-border);
    border-radius: 4px;
    
    cursor: pointer;
    transition: all var(--duration-fast, 0.4s) ease;
}

.feedback-checkbox:checked {
    background: var(--accent-solid, #00D9FF);
    border-color: var(--accent-solid, #00D9FF);
}

.feedback-checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ========================================
   🎯 BOTÕES DO MODAL
======================================== */

.feedback-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.feedback-btn {
    flex: 1 1 50%; /* FORÇA TAMANHOS IGUAIS - 50% cada */
    min-width: 0;
    padding: 14px 24px;
    
    border: none;
    border-radius: 10px;
    
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    cursor: pointer;
    transition: all var(--duration-fast, 0.4s) var(--ease-out-premium, ease-out);
    
    /* Garante centralização do texto */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Cancel Button */
.feedback-btn-cancel {
    flex: 1 1 50% !important; /* FORÇA 50% */
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-secondary) !important;
}

.feedback-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--text-secondary) !important;
    color: var(--text-primary) !important;
}

/* Submit Button */
.feedback-btn-submit {
    flex: 1 1 50% !important; /* FORÇA 50% */
    background: linear-gradient(135deg, var(--accent-solid, #00D9FF) 0%, rgba(0, 217, 255, 0.8) 100%) !important;
    border: 1px solid var(--accent-solid, #00D9FF) !important;
    color: white !important;
    box-shadow: 0 4px 15px var(--glow, rgba(0, 217, 255, 0.3)) !important;
}

.feedback-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow, rgba(0, 217, 255, 0.4)) !important;
}

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

/* Loading State */
.feedback-btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.feedback-btn-submit.loading::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    
    width: 16px;
    height: 16px;
    
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    
    animation: feedback-spin 0.6s linear infinite;
}

@keyframes feedback-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ========================================
   🌓 TEMA DARK - Ajustes Específicos
======================================== */

[data-theme="dark"] .feedback-widget-button {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 217, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .feedback-input,
[data-theme="dark"] .feedback-textarea {
    background: rgba(255, 255, 255, 0.08);
}

/* ========================================
   🌅 TEMA LIGHT - Ajustes Específicos
======================================== */

[data-theme="light"] .feedback-widget-button {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3B82F6;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .feedback-widget-button:hover {
    border-color: #3B82F6;
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Modal Overlay - Tema Light */
[data-theme="light"] .feedback-widget-modal {
    background: rgba(15, 23, 42, 0.4) !important; /* Fundo mais claro no tema light */
    backdrop-filter: blur(8px) !important;
}

/* Modal Content - Tema Light */
[data-theme="light"] .feedback-modal-content {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
    box-shadow: 
        -24px 0 64px rgba(0, 0, 0, 0.15),
        -12px 0 32px rgba(59, 130, 246, 0.1),
        inset 1px 0 0 rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .feedback-modal-title {
    color: #0F172A;
}

[data-theme="light"] .feedback-modal-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748B;
}

[data-theme="light"] .feedback-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
    color: #EF4444;
}

[data-theme="light"] .feedback-form-label {
    color: #0F172A;
}

[data-theme="light"] .feedback-type-label {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(59, 130, 246, 0.2);
    color: #475569;
}

[data-theme="light"] .feedback-type-label:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: #3B82F6;
    color: #0F172A;
}

[data-theme="light"] .feedback-type-option input[type="radio"]:checked + .feedback-type-label {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #3B82F6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .feedback-star {
    color: #94A3B8;
}

[data-theme="light"] .feedback-input,
[data-theme="light"] .feedback-textarea {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(59, 130, 246, 0.2);
    color: #0F172A;
}

[data-theme="light"] .feedback-input::placeholder,
[data-theme="light"] .feedback-textarea::placeholder {
    color: #94A3B8;
}

[data-theme="light"] .feedback-input:focus,
[data-theme="light"] .feedback-textarea:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .feedback-checkbox {
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .feedback-checkbox:checked {
    background: #3B82F6;
    border-color: #3B82F6;
}

[data-theme="light"] .feedback-checkbox-label {
    color: #475569;
}

[data-theme="light"] .feedback-btn-cancel {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #64748B !important;
}

[data-theme="light"] .feedback-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #64748B !important;
    color: #0F172A !important;
}

[data-theme="light"] .feedback-btn-submit {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    border-color: #3B82F6 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="light"] .feedback-btn-submit:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

/* Modal Header - Tema Light */
[data-theme="light"] .feedback-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

/* ========================================
   📱 RESPONSIVIDADE MOBILE
======================================== */

@media (max-width: 768px) {
    /* Botão menor no mobile */
    .feedback-widget-button {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }
    
    .feedback-widget-button svg {
        width: 24px;
        height: 24px;
    }
    
    /* Modal responsivo no mobile - mantém border-radius */
    .feedback-modal-content {
        max-width: 95vw;
        min-width: 0;
        max-height: 90vh;
        padding: 24px;
        border-radius: 16px;
    }
    
    /* Ajustes de layout - Grid 2x2 no mobile */
    .feedback-type-options {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas no mobile */
        gap: 8px;
    }
    
    .feedback-type-option {
        width: 100%;
    }
    
    .feedback-modal-actions {
        flex-direction: column-reverse;
    }
    
    .feedback-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .feedback-modal-title {
        font-size: 1.25rem;
    }
    
    .feedback-rating {
        justify-content: center;
    }
}

/* ========================================
   ♿ ACESSIBILIDADE A11y
======================================== */

/* Modo de Alto Contraste */
@media (prefers-contrast: high) {
    .feedback-widget-button {
        border: 3px solid var(--accent-solid, #00D9FF);
    }
    
    .feedback-input,
    .feedback-textarea {
        border: 2px solid var(--card-border);
    }
}

/* Preferência por Movimento Reduzido */
@media (prefers-reduced-motion: reduce) {
    .feedback-widget-button,
    .feedback-modal-content,
    .feedback-btn,
    .feedback-type-label,
    .feedback-star,
    .feedback-input,
    .feedback-textarea {
        transition: none;
        animation: none;
    }
    
    .feedback-widget-button:hover svg {
        transform: none;
    }
}

/* ========================================
   🎯 ESTADOS DE VALIDAÇÃO
======================================== */

.feedback-input.error,
.feedback-textarea.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.feedback-error-message {
    font-size: 0.85rem;
    color: #EF4444;
    margin-top: 4px;
}

/* Success Message */
.feedback-success-message {
    padding: 16px;
    
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid #10B981;
    border-radius: 10px;
    
    color: #10B981;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

/* ========================================
   🎨 CUSTOM SCROLLBAR (Modal)
======================================== */

.feedback-modal-content::-webkit-scrollbar {
    width: 8px;
}

.feedback-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.feedback-modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-solid, #00D9FF);
    border-radius: 10px;
}

.feedback-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.8);
}
