/**
 * Feedback Widget - Floating button and panel
 */

/* ============================================
   FEEDBACK BUTTON (Floating)
   ============================================ */

.feedback-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(43,76,126,0.3), 0 0 0 1px rgba(0,0,0,0.1);
    transition: all var(--transition-base);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(43,76,126,0.4);
}

.feedback-button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* ============================================
   FEEDBACK PANEL
   ============================================ */

.feedback-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.1);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.feedback-header h3 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.feedback-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Body */
.feedback-body {
    padding: var(--space-6);
    max-height: 70vh;
    overflow-y: auto;
}

.feedback-intro {
    margin-bottom: var(--space-5);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.feedback-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.feedback-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

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

.char-count {
    display: block;
    text-align: right;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--neutral-500);
}

.feedback-body .form-group {
    margin-bottom: var(--space-5);
}

.feedback-body label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.feedback-body small {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--neutral-500);
}

/* Actions */
.feedback-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-cancel {
    background: var(--neutral-100);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--neutral-200);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(43,76,126,0.3);
}

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

/* Success message */
.feedback-success {
    text-align: center;
    padding: var(--space-10) var(--space-6);
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
    background: var(--success-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.feedback-success h4 {
    margin: 0 0 var(--space-2);
    color: var(--text-primary);
    font-size: var(--text-2xl);
}

.feedback-success p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-base);
}

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

@media (max-width: 768px) {
    .feedback-panel {
        bottom: 90px;
        right: 12px;
        width: calc(100vw - 24px);
    }

    .feedback-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}
