/**
 * Review System Styles
 * Styles for product reviews and rating system
 */

/* Review Container */
.rm-reviews-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rm-user-reviews-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Review Header */
.rm-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.rm-reviews-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

/* Rating Summary */
.rm-rating-summary {
    text-align: right;
}

.rm-average-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-rating-text {
    font-size: 0.9rem;
    color: #666;
}

/* Stars */
.rm-stars {
    display: inline-flex;
    gap: 2px;
}

.rm-star {
    font-size: 1.2rem;
    color: #ddd;
    transition: color 0.2s ease;
}

.rm-star.filled {
    color: #ffc107;
}

/* Review Form Container */
.rm-review-form-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.rm-add-review-btn,
.rm-edit-review-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.rm-add-review-btn:hover,
.rm-edit-review-btn:hover {
    background: #005a87;
}

/* Review Form */
.rm-review-form {
    margin-top: 1rem;
}

.rm-form-group {
    margin-bottom: 1rem;
}

.rm-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.rm-form-group .required {
    color: #dc3545;
}

.rm-form-group input[type="text"],
.rm-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.rm-form-group input[type="text"]:focus,
.rm-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Rating Input */
.rm-rating-input {
    display: flex;
    gap: 5px;
    margin-top: 0.5rem;
}

.rm-rating-input input[type="radio"] {
    display: none;
}

.rm-star-label {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rm-star-label:hover,
.rm-star-label.selected {
    color: #ffc107;
}

.rm-rating-input input[type="radio"]:checked ~ .rm-star-label,
.rm-rating-input input[type="radio"]:checked + .rm-star-label {
    color: #ffc107;
}

/* Character Counter */
.rm-char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.rm-char-counter.warning {
    color: #dc3545;
}

/* Form Actions */
.rm-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.rm-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.rm-btn-primary {
    background: #007cba;
    color: white;
}

.rm-btn-primary:hover {
    background: #005a87;
}

.rm-btn-secondary {
    background: #6c757d;
    color: white;
}

.rm-btn-secondary:hover {
    background: #545b62;
}

.rm-btn:disabled,
.rm-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Login Prompt */
.rm-login-prompt {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.rm-login-prompt a {
    color: #007cba;
    text-decoration: none;
}

.rm-login-prompt a:hover {
    text-decoration: underline;
}

/* Reviews List */
.rm-reviews-list {
    margin-top: 1.5rem;
}

.rm-review-item,
.rm-user-review-item {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1rem;
    background: #fff;
}

.rm-review-item:last-child,
.rm-user-review-item:last-child {
    margin-bottom: 0;
}

/* Review Header */
.rm-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.rm-reviewer-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rm-reviewer-name {
    font-weight: 600;
    color: #333;
}

.rm-review-date {
    font-size: 0.8rem;
    color: #666;
}

/* Review Actions */
.rm-review-actions {
    display: flex;
    gap: 0.5rem;
}

.rm-review-actions button {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #666;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.rm-review-actions button:hover {
    background: #f0f0f0;
    color: #333;
}

.rm-delete-review-btn:hover {
    color: #dc3545;
}

.rm-report-review-btn:hover {
    color: #ffc107;
}

/* Review Rating */
.rm-review-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Review Title */
.rm-review-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Review Content */
.rm-review-content {
    line-height: 1.6;
    color: #555;
}

/* User Reviews */
.rm-user-reviews-list {
    margin-top: 1rem;
}

.rm-user-review-item h4 {
    margin: 0 0 0.5rem 0;
}

.rm-user-review-item h4 a {
    color: #007cba;
    text-decoration: none;
}

.rm-user-review-item h4 a:hover {
    text-decoration: underline;
}

/* No Reviews */
.rm-no-reviews {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Loading */
.rm-loading {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-style: italic;
}

/* Load More */
.rm-load-more-container {
    text-align: center;
    margin-top: 1.5rem;
}

.rm-load-more-reviews {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rm-load-more-reviews:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Messages */
.rm-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    position: relative;
}

.rm-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rm-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rm-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.rm-message p {
    margin: 0;
}

.rm-message-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.rm-message-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rm-reviews-container,
    .rm-user-reviews-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .rm-reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .rm-rating-summary {
        text-align: left;
    }
    
    .rm-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rm-review-actions {
        align-self: flex-end;
    }
    
    .rm-form-actions {
        flex-direction: column;
    }
    
    .rm-btn {
        width: 100%;
    }
    
    .rm-rating-input {
        justify-content: center;
    }
    
    .rm-star-label {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .rm-reviews-container,
    .rm-user-reviews-container {
        padding: 0.75rem;
    }
    
    .rm-review-item,
    .rm-user-review-item {
        padding: 1rem;
    }
    
    .rm-stars {
        gap: 1px;
    }
    
    .rm-star {
        font-size: 1rem;
    }
    
    .rm-star-label {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .rm-review-form-container,
    .rm-review-actions,
    .rm-load-more-container,
    .rm-message {
        display: none !important;
    }
    
    .rm-reviews-container,
    .rm-user-reviews-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .rm-review-item,
    .rm-user-review-item {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rm-reviews-container,
    .rm-user-reviews-container {
        border: 2px solid #000;
    }
    
    .rm-review-item,
    .rm-user-review-item {
        border: 1px solid #000;
    }
    
    .rm-btn-primary {
        background: #000;
        color: #fff;
    }
    
    .rm-btn-secondary {
        background: #666;
        color: #fff;
    }
    
    .rm-star.filled {
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .rm-star,
    .rm-star-label,
    .rm-btn,
    .rm-review-actions button {
        transition: none;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .rm-reviews-container,
    .rm-user-reviews-container {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .rm-review-item,
    .rm-user-review-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .rm-review-form-container {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .rm-form-group input[type="text"],
    .rm-form-group textarea {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .rm-form-group input[type="text"]:focus,
    .rm-form-group textarea:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.1);
    }
    
    .rm-reviews-header h3,
    .rm-reviewer-name,
    .rm-review-title {
        color: #e2e8f0;
    }
    
    .rm-rating-text,
    .rm-review-date,
    .rm-char-counter {
        color: #a0aec0;
    }
    
    .rm-review-content {
        color: #cbd5e0;
    }
    
    .rm-login-prompt {
        background: #1a202c;
    }
    
    .rm-load-more-reviews {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .rm-load-more-reviews:hover {
        background: #4a5568;
    }
}