/* Rating Feedback Plugin - Modern Western Style */
/* 欧美现代风格 - 圆角磨砂玻璃卡片设计 */

/* ========================================
   CSS Variables - Design Tokens
   ======================================== */
:root {
    --rfp-primary: #2563eb;
    --rfp-primary-hover: #1d4ed8;
    --rfp-primary-light: rgba(37, 99, 235, 0.1);
    --rfp-success: #10b981;
    --rfp-error: #ef4444;
    --rfp-warning: #f59e0b;

    --rfp-text-primary: #1e293b;
    --rfp-text-secondary: #64748b;
    --rfp-text-muted: #94a3b8;

    --rfp-bg-glass: rgba(255, 255, 255, 0.95);
    --rfp-bg-glass-hover: rgba(255, 255, 255, 0.98);
    --rfp-border-glass: rgba(255, 255, 255, 0.8);
    --rfp-shadow-glass: rgba(0, 0, 0, 0.1);

    --rfp-border-radius: 16px;
    --rfp-border-radius-sm: 10px;
    --rfp-border-radius-lg: 24px;

    --rfp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --rfp-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --rfp-shadow-medium: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --rfp-shadow-large: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Form Container - Glassmorphism Card
   ======================================== */
.rfp-form-container {
    max-width: 560px;
    margin: 24px auto;
    padding: 40px 36px;
    background: var(--rfp-bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--rfp-border-glass);
    border-radius: var(--rfp-border-radius-lg);
    box-shadow: var(--rfp-shadow-large),
                inset 0 1px 1px rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

/* 磨砂玻璃背景装饰 */
.rfp-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.08) 0%,
        rgba(139, 92, 246, 0.05) 50%,
        rgba(236, 72, 153, 0.05) 100%);
    border-radius: var(--rfp-border-radius-lg) var(--rfp-border-radius-lg) 0 0;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   Form Title
   ======================================== */
.rfp-form-title {
    position: relative;
    margin: 0 0 32px 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--rfp-text-primary);
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.rfp-form-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--rfp-primary), #8b5cf6);
    border-radius: 2px;
    margin: 16px auto 0;
}

/* ========================================
   Form Layout
   ======================================== */
.rfp-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 1;
}

.rfp-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========================================
   Labels
   ======================================== */
.rfp-label {
    font-weight: 600;
    color: var(--rfp-text-primary);
    font-size: 14px;
    letter-spacing: 0.01em;
}

/* ========================================
   Input & Textarea Fields
   ======================================== */
.rfp-input,
.rfp-textarea {
    padding: 14px 18px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--rfp-border-radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--rfp-text-primary);
    background: rgba(255, 255, 255, 0.8);
    transition: var(--rfp-transition);
    -webkit-appearance: none;
    appearance: none;
}

.rfp-input::placeholder,
.rfp-textarea::placeholder {
    color: var(--rfp-text-muted);
}

.rfp-input:hover,
.rfp-textarea:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

.rfp-input:focus,
.rfp-textarea:focus {
    outline: none;
    border-color: var(--rfp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--rfp-primary-light),
                var(--rfp-shadow-soft);
}

.rfp-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ========================================
   Description Text
   ======================================== */
.rfp-description-text {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.04) 0%,
        rgba(139, 92, 246, 0.03) 100%);
    border-radius: var(--rfp-border-radius);
    margin: 8px 0;
}

.rfp-description-text p {
    margin: 0 0 8px 0;
    color: var(--rfp-text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.rfp-description-text p:last-child {
    margin-bottom: 0;
}

.rfp-description-text strong {
    color: var(--rfp-text-primary);
    font-weight: 600;
}

/* ========================================
   Star Rating System
   ======================================== */
.rfp-rating-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rfp-checkbox-rating {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--rfp-border-radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.rfp-rating-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--rfp-border-radius-sm);
    transition: var(--rfp-transition);
    cursor: pointer;
}

.rfp-rating-row:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Custom Checkbox */
.rfp-rating-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--rfp-primary);
    border-radius: 6px;
    flex-shrink: 0;
}

/* Star Labels */
.rfp-rating-label {
    display: flex;
    gap: 4px;
    font-size: 22px;
    cursor: pointer;
    user-select: none;
    transition: var(--rfp-transition);
}

.rfp-star {
    transition: var(--rfp-transition);
    text-shadow: none;
}

.rfp-star.active {
    color: #fbbf24;
    text-shadow: 0 1px 2px rgba(251, 191, 36, 0.3);
}

.rfp-star.inactive {
    color: #e2e8f0;
}

/* Selected State */
.rfp-rating-checkbox:checked + .rfp-rating-label .rfp-star.active {
    color: #f59e0b;
    text-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.rfp-rating-checkbox:checked ~ .rfp-rating-row {
    /* Visual feedback for selected rating */
}

/* ========================================
   Submit Button - Modern Design
   ======================================== */
.rfp-submit-btn {
    position: relative;
    background: linear-gradient(135deg, var(--rfp-primary) 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--rfp-border-radius-sm);
    cursor: pointer;
    transition: var(--rfp-transition);
    overflow: hidden;
    margin-top: 8px;
}

.rfp-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 50%);
    pointer-events: none;
}

.rfp-submit-btn:hover {
    background: linear-gradient(135deg, var(--rfp-primary-hover) 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.4),
                0 4px 8px -2px rgba(37, 99, 235, 0.2);
}

.rfp-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.3);
}

.rfp-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.rfp-btn-loading {
    display: none;
}

.rfp-submit-btn.loading .rfp-btn-text {
    display: none;
}

.rfp-submit-btn.loading .rfp-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rfp-submit-btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: rfp-spin 0.8s linear infinite;
}

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

/* ========================================
   Messages - Success & Error
   ======================================== */
.rfp-message {
    padding: 16px 20px;
    border-radius: var(--rfp-border-radius-sm);
    font-weight: 500;
    text-align: center;
    margin-top: 8px;
    animation: rfp-fadeIn 0.3s ease;
}

@keyframes rfp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rfp-message.success {
    background: linear-gradient(135deg,
        rgba(16, 185, 129, 0.1) 0%,
        rgba(16, 185, 129, 0.05) 100%);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.rfp-message.error {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.1) 0%,
        rgba(239, 68, 68, 0.05) 100%);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========================================
   Accessibility
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rfp-rating-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--rfp-primary-light);
    border-radius: 6px;
}

.rfp-input:focus-visible,
.rfp-textarea:focus-visible,
.rfp-submit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--rfp-primary-light);
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media (max-width: 768px) {
    .rfp-form-container {
        margin: 16px;
        padding: 32px 28px;
        border-radius: var(--rfp-border-radius);
    }

    .rfp-form-container::before {
        height: 60px;
        border-radius: var(--rfp-border-radius) var(--rfp-border-radius) 0 0;
    }

    .rfp-form-title {
        font-size: 24px;
        margin-bottom: 28px;
    }

    .rfp-form {
        gap: 20px;
    }

    .rfp-rating-label {
        font-size: 20px;
    }

    .rfp-rating-checkbox {
        padding: 14px;
    }

    .rfp-rating-row {
        padding: 8px 12px;
    }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media (max-width: 480px) {
    .rfp-form-container {
        margin: 12px;
        padding: 24px 20px;
        border-radius: var(--rfp-border-radius);
    }

    .rfp-form-container::before {
        height: 50px;
        border-radius: var(--rfp-border-radius) var(--rfp-border-radius) 0 0;
    }

    .rfp-form-title {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .rfp-form-title::after {
        width: 50px;
        height: 3px;
        margin-top: 12px;
    }

    .rfp-form {
        gap: 18px;
    }

    .rfp-description-text {
        padding: 16px;
    }

    .rfp-description-text p {
        font-size: 14px;
    }

    .rfp-input,
    .rfp-textarea {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .rfp-rating-label {
        font-size: 18px;
        gap: 3px;
    }

    .rfp-rating-checkbox {
        padding: 12px;
        gap: 4px;
    }

    .rfp-rating-row {
        padding: 10px;
        gap: 12px;
    }

    .rfp-rating-checkbox {
        width: 20px;
        height: 20px;
    }

    .rfp-submit-btn {
        padding: 14px 28px;
        font-size: 15px;
        width: 100%;
    }

    .rfp-message {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* ========================================
   Responsive Design - Small Mobile
   ======================================== */
@media (max-width: 360px) {
    .rfp-form-container {
        margin: 8px;
        padding: 20px 16px;
    }

    .rfp-form-title {
        font-size: 20px;
    }

    .rfp-rating-label {
        font-size: 16px;
    }

    .rfp-star {
        font-size: 18px;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .rfp-form-container {
        --rfp-bg-glass: rgba(30, 41, 59, 0.95);
        --rfp-border-glass: rgba(255, 255, 255, 0.15);
        --rfp-text-primary: #f1f5f9;
        --rfp-text-secondary: #94a3b8;
        --rfp-text-muted: #64748b;
    }

    .rfp-input,
    .rfp-textarea {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--rfp-text-primary);
    }

    .rfp-input:hover,
    .rfp-textarea:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .rfp-input:focus,
    .rfp-textarea:focus {
        background: rgba(255, 255, 255, 0.08);
    }

    .rfp-checkbox-rating {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .rfp-star.inactive {
        color: #475569;
    }

    .rfp-message.success {
        background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.2) 0%,
            rgba(16, 185, 129, 0.1) 100%);
        color: #6ee7b7;
    }

    .rfp-message.error {
        background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.2) 0%,
            rgba(239, 68, 68, 0.1) 100%);
        color: #fca5a5;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .rfp-form-container {
        background: #fff;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .rfp-submit-btn {
        background: #333;
    }
}
