/**
 * Feedback Widget Styling - WCAG AA Compliant
 * Path: public_html/css/feedback-widget.css
 * Version: 1.2.5
 * 
 * Changelog v1.2.0:
 * - Removed green left border, updated to card style matching new layout
 * - Updated border-radius to match other cards (16px)
 * - Added box-shadow for consistency with other sidebar elements
 * 
 * Changelog v1.1.0:
 * - Added honeypot field for bot prevention
 */

.feedback-widget {
    background-color: #ffffff;
    border-left: none;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.feedback-widget h3 {
    color: #1e293b;
    margin: 0 0 16px 0;
    font-size: 1em;
}

.feedback-section {
    margin-bottom: 20px;
}

.feedback-label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.optional {
    color: #666;
    font-weight: 300;
    font-size: 0.8rem;
}

/* Fieldset styling for radio groups */
.feedback-section fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.feedback-section legend {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9rem;
    padding: 0;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
}

.star {
    font-size: 1.4rem;
    color: #767676;
    transition: color 0.2s ease;
    cursor: pointer;
    user-select: none;
    border-radius: 2px;
    padding: 2px;
}

.star:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    background-color: rgba(52, 152, 219, 0.1);
}

.star:hover {
    color: #ffc107;
}

.star.selected {
    color: #ffc107;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
    color-scheme: light;
    width: 16px;
    height: 16px;
}

.radio-option input[type="radio"]:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Textarea */
.feedback-widget textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: #fff;
    color: #333;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.feedback-widget textarea:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-color: #3498db;
}

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

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

/* Submit Button */
.feedback-submit {
    width: 100%;
    padding: 12px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 44px;
}

.feedback-submit:hover {
    background: #b71c1c;
}

.feedback-submit:focus-visible {
    outline: 2px solid #d32f2f;
    outline-offset: 2px;
}

.feedback-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Success Message */
.feedback-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #28a745;
    font-size: 1rem;
    font-weight: 500;
    margin: 20px 0;
    padding: 20px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    text-align: center;
    min-height: 80px;
}

.feedback-success.show {
    display: flex !important;
}

.success-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Form hidden state */
.feedback-form-hidden {
    display: none !important;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feedback-widget {
        border: 2px solid #000;
        background-color: #fff;
    }
    
    .feedback-submit {
        background: #000 !important;
        border: 2px solid #000;
    }
    
    .feedback-submit:hover {
        background: #333 !important;
    }
    
    .star:focus-visible {
        outline-color: #000;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .radio-option input[type="radio"]:focus-visible,
    .feedback-widget textarea:focus-visible,
    .feedback-submit:focus-visible {
        outline-color: #000;
        box-shadow: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .star,
    .feedback-submit,
    .radio-option,
    .feedback-widget textarea {
        transition: none;
    }
}