/**
 * Floating Feedback Button Styles
 * 全站悬浮反馈按钮样式
 */

/* ==================== Floating Button ==================== */

.feedback-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #1E2D3D;
    color: #fff;
    border: none;
    border-radius: 28px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.feedback-float-btn:hover {
    background: #2d3f54;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.feedback-float-btn:active {
    transform: translateY(0);
}

.feedback-float-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.feedback-float-label {
    display: inline;
}

/* Mobile: icon-only */
@media (max-width: 640px) {
    .feedback-float-btn {
        bottom: 16px;
        right: 16px;
        padding: 14px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        justify-content: center;
    }
    .feedback-float-label {
        display: none;
    }
    .feedback-float-icon {
        width: 22px;
        height: 22px;
    }
}

/* ==================== Tooltip ==================== */

.feedback-tooltip {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9989;
    background: #1E2D3D;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.feedback-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #1E2D3D;
    transform: rotate(45deg);
}

.feedback-tooltip--show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .feedback-tooltip {
        bottom: 76px;
        right: 16px;
    }
}

/* ==================== Modal Overlay ==================== */

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-modal--visible {
    opacity: 1;
    pointer-events: auto;
}

.feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ==================== Dialog ==================== */

.feedback-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90vw;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-modal--visible .feedback-modal-dialog {
    transform: translateY(0) scale(1);
}

.feedback-modal-header {
    padding: 24px 24px 0;
    position: relative;
}

.feedback-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E2D3D;
    margin: 0 0 4px;
}

.feedback-modal-header p {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.feedback-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.feedback-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ==================== Form ==================== */

.feedback-form {
    padding: 20px 24px 24px;
}

.feedback-form-group {
    margin-bottom: 16px;
}

.feedback-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.feedback-type-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feedback-type-option {
    position: relative;
    cursor: pointer;
}

.feedback-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback-type-label {
    display: block;
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    cursor: pointer;
}

.feedback-type-option input:checked + .feedback-type-label {
    border-color: #4A6FA5;
    background: #eef2ff;
    color: #4A6FA5;
}

.feedback-type-option:hover .feedback-type-label {
    border-color: #c4c9d1;
}

.feedback-form-group input[type="email"],
.feedback-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #1E2D3D;
    transition: border-color 0.2s;
    background: #f9fafb;
    resize: vertical;
}

.feedback-form-group input[type="email"]:focus,
.feedback-form-group textarea:focus {
    outline: none;
    border-color: #4A6FA5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.feedback-form-group input[type="email"]::placeholder,
.feedback-form-group textarea::placeholder {
    color: #c4c9d1;
}

/* ==================== Actions ==================== */

.feedback-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.feedback-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn--cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.feedback-btn--cancel:hover {
    background: #e5e7eb;
}

.feedback-btn--submit {
    background: #4A6FA5;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-btn--submit:hover {
    background: #3d5d8a;
}

.feedback-btn--submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: feedback-spin 0.8s linear infinite;
}

@keyframes feedback-spin {
    to { transform: rotate(360deg); }
}

/* ==================== Success State ==================== */

.feedback-success {
    padding: 40px 24px;
    text-align: center;
}

.feedback-success-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.feedback-success h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E2D3D;
    margin: 0 0 8px;
}

.feedback-success p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 20px;
    line-height: 1.5;
}

.feedback-btn--close {
    background: #4A6FA5;
    color: #fff;
    padding: 10px 28px;
}

.feedback-btn--close:hover {
    background: #3d5d8a;
}

/* ==================== Mobile ==================== */

@media (max-width: 480px) {
    .feedback-modal-dialog {
        width: 94vw;
        border-radius: 14px;
    }

    .feedback-modal-header {
        padding: 20px 20px 0;
    }

    .feedback-modal-header h3 {
        font-size: 1.1rem;
    }

    .feedback-form {
        padding: 16px 20px 20px;
    }

    .feedback-type-selector {
        flex-direction: column;
    }

    .feedback-type-label {
        text-align: center;
    }
}