/**
 * Amplify Reviews Frontend Styles
 * 
 * @package Amplify_Reviews
 * @version 0.1.0
 */

/* Container Styles */
.amplify-reviews-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Step Styles */
.ar-step {
    transition: opacity 0.3s ease-in-out;
}

/* Header Styles */
.ar-header {
    text-align: center;
    margin-bottom: 30px;
}

.ar-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.ar-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.4;
}

/* Rating Options */
.ar-rating-options {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ar-rating-option {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 20px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    user-select: none;
}

.ar-rating-option:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.ar-rating-option.selected {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.ar-emoji {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.ar-rating-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: block;
}

/* Traits Options */
.ar-traits-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.ar-trait-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    user-select: none;
}

.ar-trait-option:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.ar-trait-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #007cba;
}

.ar-trait-option input[type="checkbox"]:checked+.ar-trait-label {
    color: #007cba;
    font-weight: 500;
}

.ar-trait-label {
    font-size: 16px;
    color: #333;
    transition: color 0.3s ease;
}

/* Button Styles */
.ar-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
    min-width: 120px;
}

.ar-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.ar-btn-primary {
    background: #007cba;
    color: #fff;
}

.ar-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.ar-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.ar-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.ar-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #333;
}

.ar-btn-outline {
    background: transparent;
    color: #007cba;
    border: 2px solid #007cba;
}

.ar-btn-outline:hover {
    background: #007cba;
    color: #fff;
}

.ar-btn-back {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.ar-btn-back:hover {
    background: #f8f9fa;
    color: #333;
}

/* Step Actions */
.ar-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.ar-step-actions .ar-btn {
    flex: 0 0 auto;
}

/* Review Container */
.ar-review-container {
    margin-bottom: 20px;
}

/* Loading Styles */
.ar-loading {
    text-align: center;
    padding: 40px 20px;
}

.ar-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: ar-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ar-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ar-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Review Content */
.ar-review-content {
    padding: 20px 0;
}

/* Review Controls */
.ar-review-controls {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ar-control-group {
    margin-bottom: 15px;
}

.ar-control-group:last-child {
    margin-bottom: 0;
}

.ar-control-label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.ar-style-buttons,
.ar-length-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ar-style-btn,
.ar-length-btn {
    background: #fff;
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: auto;
}

.ar-style-btn:hover,
.ar-length-btn:hover {
    border-color: #007cba;
    background: #f8f9ff;
    color: #007cba;
}

.ar-style-btn.active,
.ar-length-btn.active {
    border-color: #007cba;
    background: #007cba;
    color: #fff;
}

.ar-btn-mini {
    padding: 8px 12px;
    font-size: 13px;
    min-width: auto;
}

/* Regenerate Section */
.ar-regenerate-section {
    text-align: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.ar-regenerate-section .ar-btn {
    min-width: auto;
}

/* Feedback Form Styles */
.ar-feedback-form {
    margin-bottom: 20px;
}

.ar-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ar-form-group {
    flex: 1;
    min-width: 250px;
}

.ar-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.ar-form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.ar-form-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.ar-form-input:required:invalid {
    border-color: #dc3545;
}

.ar-form-actions {
    text-align: center;
    margin-top: 30px;
}

.ar-feedback-success {
    text-align: center;
    padding: 40px 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
}

.ar-feedback-success h3 {
    margin-bottom: 15px;
    color: #155724;
    font-size: 24px;
}

.ar-feedback-success p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.ar-review-text {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 20px;
    font-family: inherit;
}

.ar-review-text:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Review Actions */
.ar-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.ar-review-actions .ar-btn {
    min-width: auto;
    white-space: nowrap;
}

/* Error Message */
.ar-error-message {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.ar-error-message p {
    margin: 0 0 15px 0;
    font-size: 16px;
}

/* Feedback Message */
.ar-feedback-message {
    text-align: center;
    padding: 40px 20px;
}

.ar-feedback-message h3 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 24px;
}

.ar-feedback-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .amplify-reviews-container {
        margin: 10px;
        padding: 15px;
    }

    .ar-rating-options {
        gap: 10px;
    }

    .ar-rating-option {
        min-width: 70px;
        padding: 15px 10px;
    }

    .ar-emoji {
        font-size: 24px;
    }

    .ar-traits-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ar-trait-option {
        padding: 12px;
    }

    .ar-step-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ar-step-actions .ar-btn {
        width: 100%;
    }

    .ar-review-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ar-review-actions .ar-btn {
        width: 100%;
        min-width: auto;
    }

    .ar-header h3 {
        font-size: 20px;
    }

    .ar-header p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ar-rating-options {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
    }

    .ar-rating-option:nth-child(4),
    .ar-rating-option:nth-child(5) {
        grid-column: span 1;
    }

    .ar-rating-option:nth-child(5) {
        grid-column: 2;
    }
}

/* Animation Classes */
.ar-fade-in {
    animation: ar-fadeIn 0.3s ease-in;
}

.ar-fade-out {
    animation: ar-fadeOut 0.3s ease-out;
}

@keyframes ar-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ar-fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .ar-rating-option,
    .ar-trait-option,
    .ar-btn,
    .ar-step {
        transition: none;
    }

    .ar-spinner {
        animation: none;
    }

    .ar-fade-in,
    .ar-fade-out {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {

    .ar-rating-option,
    .ar-trait-option {
        border-width: 3px;
    }

    .ar-btn {
        border-width: 2px;
    }
}