/**
 * Reviews and Ratings CSS
 * Styling for the marketplace reviews and ratings system
 */

/* Reviews Summary */
.reviews-summary {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.overall-rating {
    text-align: center;
    min-width: 150px;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 5px;
}

.rating-stars {
    margin-bottom: 5px;
}

.review-count {
    color: #64748b;
    font-size: 0.9rem;
}

.rating-breakdown {
    flex: 1;
    max-width: 400px;
    margin-left: 40px;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #fbbf24;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Review Form */
.review-submission-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.star-rating-input {
    display: flex;
    gap: 5px;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: #d1d5db;
    transition: color 0.2s;
    padding: 0;
}

.star-btn:hover,
.star-btn.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.star-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Review Items */
.review-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 25px 0;
    transition: background-color 0.2s;
}

.review-item:hover {
    background-color: #fafafa;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.reviewer-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.verified-badge {
    background: #10b981;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #64748b;
    font-size: 0.9rem;
}

.recommend-badge {
    color: #10b981;
    font-weight: 500;
}

.review-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #374151;
}

.review-content h4 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #1e293b;
}

.review-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #64748b;
    font-size: 0.9rem;
}

.helpful-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.helpful-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.helpful-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.helpful-btn.voted {
    color: #10b981;
    background-color: #ecfdf5;
}

.delete-review-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.delete-review-btn:hover {
    background-color: #fef2f2;
}

/* Star Rating Display */
.star-rating {
    display: inline-flex;
    align-items: center;
}

.star-rating .star {
    transition: color 0.2s;
}

/* Form Elements */
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

/* Buttons */
.submit-review-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-review-btn:hover {
    background: #2563eb;
}

.submit-review-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

#load-more-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#load-more-btn:hover {
    background: #4b5563;
}

/* Loading States */
.form-loading {
    color: #64748b;
    font-style: italic;
}

.loading-reviews {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

/* Messages */
.review-form-notice {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.review-success-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.review-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* No Reviews State */
.no-reviews {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-reviews h3 {
    margin: 0 0 10px;
    color: #374151;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .summary-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .rating-breakdown {
        margin-left: 0;
        width: 100%;
    }
    
    .review-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .review-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .review-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .star-rating-input {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .reviews-summary,
    .review-submission-form {
        padding: 20px 15px;
    }
    
    .rating-number {
        font-size: 2rem;
    }
    
    .star-btn {
        font-size: 1.5rem;
    }
    
    .review-item {
        padding: 20px 0;
    }
}

/* Animation for new reviews */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-item.new-review {
    animation: slideIn 0.3s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .star-btn,
    .bar-fill,
    .helpful-btn,
    .submit-review-btn,
    #load-more-btn {
        transition: none;
    }
    
    .review-item.new-review {
        animation: none;
    }
}