/**
 * Article Rating Widget Styles
 * Matches the Source Elements design system
 */

.article-rating-widget {
    margin: 3rem auto 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-width: 700px;
    transition: opacity 0.3s ease;
}

/* Rating Container (Initial State) */
.rating-container {
    text-align: center;
}

.rating-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1.5rem;
}

.rating-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.rating-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rating-yes {
    border-color: #28a745;
    color: #28a745;
}

.rating-yes:hover {
    background: #28a745;
    color: white;
}

.rating-no {
    border-color: #dc3545;
    color: #dc3545;
}

.rating-no:hover {
    background: #dc3545;
    color: white;
}

.rating-btn i {
    font-size: 1.1rem;
}

/* Feedback Form Container */
.feedback-form-container {
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem;
    text-align: center;
}

.feedback-subtitle {
    text-align: center;
    color: #6c757d;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.article-feedback-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Required field asterisk */
.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

.form-control:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.form-control {
    cursor: pointer;
    height: auto;
    min-height: 42px;
    padding: 0.75rem 2.5rem 0.75rem 0.85rem;
    line-height: 1.6;
    /* Ensure dropdown arrow doesn't overlap text */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Ensure dropdown options display with proper spacing */
select.form-control option {
    padding: 0.5rem 0.75rem;
    line-height: 1.8;
    min-height: 2em;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-submit,
.btn-skip {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit {
    background: #a7e163;
    color: #1A1F23;
    font-weight: bold;
}

.btn-submit:hover {
    background: #b8f074;
    color: #0f1215;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(167, 225, 99, 0.4);
}

.btn-submit:active {
    background: #96d152;
    color: #1A1F23;
    transform: translateY(0);
}

.btn-skip {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-skip:hover {
    background: #6c757d;
    color: white;
}

/* Success Container */
.feedback-success-container {
    text-align: center;
    animation: fadeIn 0.3s ease;
    padding: 2rem 1rem;
}

.success-message {
    color: #28a745;
}

.success-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.success-message h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem;
}

.success-message p {
    color: #6c757d;
    margin: 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-rating-widget {
        padding: 1.5rem 1rem;
        margin: 2rem auto 1.5rem;
    }

    .rating-title,
    .feedback-title {
        font-size: 1.1rem;
    }

    .rating-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .rating-btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-submit,
    .btn-skip {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    body.dark-mode .article-rating-widget {
        background: #2d3748;
        border-color: #4a5568;
    }

    body.dark-mode .rating-title,
    body.dark-mode .feedback-title,
    body.dark-mode .success-message h3 {
        color: #e2e8f0;
    }

    body.dark-mode .form-control {
        background-color: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    body.dark-mode .rating-btn {
        background: #1a202c;
        color: #e2e8f0;
    }
}

/* Animation for hiding widget */
.article-rating-widget[style*="opacity: 0"] {
    pointer-events: none;
}