/**
 * Article Feedback Component Styles
 * 
 * Modern, accessible styling for the Article Feedback component.
 * Includes responsive design, focus states, and animation support.
 *
 * @package LVBL_Excellence_Companion
 * @subpackage Components
 * @since 2.0.0
 */

.lvbl-article-feedback {
    --feedback-primary: #0073aa;
    --feedback-primary-hover: #005177;
    --feedback-success: #00a32a;
    --feedback-warning: #dba617;
    --feedback-error: #d63638;
    --feedback-border: #ddd;
    --feedback-background: #f8f9fa;
    --feedback-text: #1e1e1e;
    --feedback-text-light: #666;
    --feedback-radius: 8px;
    --feedback-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --feedback-transition: all 0.3s ease;
    
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--feedback-background);
    border: 1px solid var(--feedback-border);
    border-radius: var(--feedback-radius);
    box-shadow: var(--feedback-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.feedback-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.feedback-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--feedback-text);
    line-height: 1.4;
}

.feedback-summary {
    font-size: 0.875rem;
    color: var(--feedback-text-light);
}

.feedback-count {
    font-weight: 500;
}

/* Thank You State */
.feedback-thank-you {
    text-align: center;
    padding: 2rem 1rem;
}

.feedback-thank-you.hidden {
    display: none;
}

.thank-you-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.thank-you-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--feedback-success);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
}

.thank-you-message {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--feedback-text);
}

.user-rating {
    margin: 0;
    font-size: 0.875rem;
    color: var(--feedback-text-light);
}

/* Feedback Form */
.feedback-form.hidden {
    display: none;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feedback-option {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: white;
    border: 2px solid var(--feedback-border);
    border-radius: var(--feedback-radius);
    cursor: pointer;
    transition: var(--feedback-transition);
    position: relative;
}

.feedback-option:hover {
    border-color: var(--feedback-primary);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.feedback-option:has(input:checked) {
    border-color: var(--feedback-primary);
    background: rgba(0, 115, 170, 0.05);
}

.feedback-option:has(input:focus-visible) {
    outline: 2px solid var(--feedback-primary);
    outline-offset: 2px;
}

.feedback-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

.option-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    line-height: 1;
    color: var(--feedback-text-light);
    transition: var(--feedback-transition);
}

.option-icon svg,
.option-icon .option-icon-svg {
    width: 24px;
    height: 24px;
    display: block;
}

.feedback-option:has(input:checked) .option-icon {
    color: var(--feedback-primary);
}

.option-details {
    flex: 1;
}

.option-label {
    display: block;
    font-weight: 600;
    color: var(--feedback-text);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.option-description {
    display: block;
    font-size: 0.875rem;
    color: var(--feedback-text-light);
    line-height: 1.4;
}

/* Comment Section */
.feedback-comment {
    margin-bottom: 1.5rem;
}

.comment-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--feedback-text);
}

.comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--feedback-border);
    border-radius: var(--feedback-radius);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--feedback-transition);
}

.comment-input:focus {
    outline: none;
    border-color: var(--feedback-primary);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.comment-input::placeholder {
    color: var(--feedback-text-light);
}

/* Actions */
.feedback-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.feedback-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--feedback-primary);
    color: white;
    border: none;
    border-radius: var(--feedback-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--feedback-transition);
    min-height: 48px; /* Accessibility: minimum touch target */
    position: relative;
}

.feedback-submit-btn:hover:not(:disabled) {
    background: var(--feedback-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.feedback-submit-btn:focus-visible {
    outline: 2px solid var(--feedback-primary);
    outline-offset: 2px;
}

.feedback-submit-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-text.hidden {
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages */
.feedback-success,
.feedback-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--feedback-radius);
    font-weight: 500;
}

.feedback-success {
    background: rgba(0, 163, 42, 0.1);
    color: var(--feedback-success);
    border: 1px solid rgba(0, 163, 42, 0.2);
}

.feedback-error {
    background: rgba(214, 54, 56, 0.1);
    color: var(--feedback-error);
    border: 1px solid rgba(214, 54, 56, 0.2);
}

.feedback-success.hidden,
.feedback-error.hidden {
    display: none;
}

/* Loading State */
.lvbl-article-feedback.loading {
    pointer-events: none;
}

.lvbl-article-feedback.loading .feedback-form {
    opacity: 0.6;
}

/* Has Voted State */
.lvbl-article-feedback.has-voted .feedback-form {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lvbl-article-feedback {
        margin: 1rem;
        padding: 1rem;
    }
    
    .feedback-title {
        font-size: 1.125rem;
    }
    
    .feedback-options {
        gap: 0.5rem;
    }
    
    .feedback-option {
        padding: 0.75rem;
    }
    
    .option-content {
        gap: 0.5rem;
    }
    
    .option-icon {
        width: 24px;
        height: 24px;
    }
    
    .option-icon svg,
    .option-icon .option-icon-svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .feedback-submit-btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .lvbl-article-feedback {
        border-width: 2px;
    }
    
    .feedback-option {
        border-width: 2px;
    }
    
    .feedback-option:has(input:checked) {
        background: rgba(0, 115, 170, 0.2);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .lvbl-article-feedback *,
    .lvbl-article-feedback *::before,
    .lvbl-article-feedback *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feedback-submit-btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Screen Reader Only */
.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;
}

/* Focus Indicators */
.focus-visible {
    outline: 2px solid var(--feedback-primary) !important;
    outline-offset: 2px !important;
}
