/* Styles pour le système d'avis */

/* Conteneur principal des avis */
.reviews-section {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* Styles pour l'intégration avec le design existant */
.reviews-section .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.reviews-section .btn-primary {
    background-color: #4f46e5;
    color: white;
}

.reviews-section .btn-primary:hover {
    background-color: #4338ca;
}

.reviews-section .cancel-review-btn {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.reviews-section .cancel-review-btn:hover {
    background-color: #e2e8f0;
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.login-prompt p {
    margin-bottom: 1rem;
    color: #64748b;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.average-rating {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

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

.star.filled {
    color: #ffc107;
}

.star.half {
    background: linear-gradient(90deg, #ffc107 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star:hover,
.star.hover {
    color: #ffc107;
}

.total-reviews {
    color: #666;
    font-size: 0.9rem;
}

/* Formulaire de soumission d'avis */
.review-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.review-form h3 {
    margin-bottom: 1rem;
    color: #333;
}

.rating-input {
    margin-bottom: 1rem;
}

.rating-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.rating-stars-input {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.rating-stars-input .star {
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-stars-input .star:hover {
    transform: scale(1.1);
}

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

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

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

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

.submit-review-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

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

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.rating-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Liste des avis */
.reviews-list {
    margin-top: 2rem;
}

.reviews-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.review-item {
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
}

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

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

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

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

.verified-purchase {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #28a745;
    background: #d4edda;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.25rem;
}

.review-rating {
    display: flex;
    gap: 0.2rem;
}

.review-rating .star {
    font-size: 1.2rem;
}

.review-content {
    margin-bottom: 1rem;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.review-text {
    line-height: 1.6;
    color: #555;
}

.review-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.helpful-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.helpful-btn:hover {
    background: #f8f9fa;
    border-color: #ff6b35;
}

.helpful-btn.voted {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.helpful-count {
    font-size: 0.85rem;
    color: #666;
}

/* États de chargement */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.reviews-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

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

/* Messages d'erreur et succès */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive */
@media (max-width: 768px) {
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .reviews-filters {
        flex-direction: column;
    }
    
    .review-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .review-actions {
        flex-wrap: wrap;
    }
    
    .rating-stars-input .star {
        font-size: 1.5rem;
    }
}

/* Animations */
.review-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.star {
    transition: all 0.2s ease;
}

.star:hover {
    transform: scale(1.1);
}

/* Pagination */
.reviews-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #ff6b35;
}

.pagination-btn.active {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.pagination-btn:disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
}