/**
 * Styles pour le système de notation et avis produits
 */

/* ============================================
   ÉTOILES DE NOTATION
============================================ */

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
    line-height: 1;
}

.rating-stars .star {
    display: inline-block;
    color: #ddd;
    transition: color 0.2s ease;
    cursor: default;
}

.rating-stars .star.full {
    color: #FFD700; /* Or */
}

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

.rating-stars .star.empty {
    color: #ddd;
}

/* Étoiles interactives (pour laisser un avis) */
.rating-stars.interactive .star {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.rating-stars.interactive .star:hover {
    transform: scale(1.2);
    color: #FFD700;
}

/* ============================================
   RATING DANS LES CARTES PRODUITS
============================================ */

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0px 0 0.7rem 0;
    font-size: 0.9rem;
}

.product-rating .rating-count {
    color: #ffffff;
    font-size: 0.85rem;
}

/* ============================================
   RATING DANS LA MODAL PRODUIT
============================================ */

.modal-product-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.modal-product-rating .rating-stars {
    font-size: 1.2rem;
}

.modal-product-rating .rating-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.modal-product-rating .rating-count {
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   SECTION AVIS CLIENTS (SLIDER)
============================================ */

.reviews-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 2px solid #f0f0f0;
}

.reviews-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1.5rem 0;
}

/* Slider container */
.reviews-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Viewport (zone visible) */
.reviews-slider-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Track (piste des avis) */
.reviews-slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Carte d'avis individuelle */
.review-card {
    flex: 0 0 100%;
    min-width: 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.review-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.review-author {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

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

.review-text {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
    font-style: italic;
}

/* Boutons de navigation */
.reviews-slider-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
}

.reviews-slider-btn:hover:not([style*="not-allowed"]) {
    background: var(--red);
    color: white;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
    transform: scale(1.1);
}

.reviews-slider-btn:active:not([style*="not-allowed"]) {
    transform: scale(0.95);
}

.reviews-slider-btn svg {
    width: 20px;
    height: 20px;
}

/* Dots de pagination */
.reviews-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.review-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.review-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.review-dot.active {
    background: var(--red);
    transform: scale(1.3);
}

/* ============================================
   BOUTON "DONNEZ VOTRE AVIS"
============================================ */

.review-button-container {
    margin: 1.5rem 0;
    text-align: center;
}

.btn-give-review {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
}

.btn-give-review:hover {
    background: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-give-review svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   FORMULAIRE POUR LAISSER UN AVIS
============================================ */

.review-form-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.review-form-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.review-form-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 1.5rem 0;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.review-form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.required {
    color: var(--red);
    font-weight: bold;
}

/* Étoiles interactives pour noter */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

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

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

.rating-input .star-label:hover,
.rating-input .star-label.hover {
    color: #FFD700;
    transform: scale(1.2);
}

.rating-input .star-label.selected {
    color: #FFD700;
}

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

.rating-display {
    margin-top: 0.5rem;
}

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

.rating-text.selected {
    color: var(--red);
    font-weight: 600;
}

/* Textarea */
.review-form-group textarea {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    width: 100%;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.review-form-group textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.char-count {
    font-size: 0.85rem;
    color: #999;
    text-align: right;
}

/* Actions du formulaire */
.review-form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-submit-review {
    padding: 0.75rem 1.5rem;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit-review:hover:not(:disabled) {
    background: var(--red);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-cancel-review {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-review:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

/* Messages de statut */
.review-form-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 1rem;
}

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

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

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

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 768px) {
    .modal-product-rating {
        flex-wrap: wrap;
    }
    
    .reviews-slider-btn {
        width: 35px;
        height: 35px;
    }
    
    .review-card {
        padding: 1rem;
    }
    
    .reviews-title {
        font-size: 1.1rem;
    }
}

/* ============================================
   ANIMATIONS
============================================ */

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

.review-card {
    animation: fadeIn 0.4s ease;
}

/* État "Pas d'avis" */
.no-reviews {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
}

.no-reviews-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ============================================
   BOUTON "MODIFIER MON AVIS" & BADGES STATUT
============================================ */

/* Bouton "Modifier mon avis" - Bleu */
.btn-give-review.has-review {
    background: #007bff;
}

.btn-give-review.has-review:hover {
    background: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Badges de statut d'avis */
.review-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.review-status svg {
    width: 20px;
    height: 20px;
}

.review-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.review-status.validated {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}
