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

/* Note moyenne */
.rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.stars-display {
    display: inline-block;
}

.stars {
    display: inline-block;
    font-size: 20px;
    color: #ddd;
}

.stars .star {
    color: #ddd;
    transition: color 0.2s ease;
}

.stars .star.filled {
    color: #ffc107;
}

.rating-text {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.rating-count {
    color: #666;
    font-size: 14px;
}

.no-reviews {
    color: #999;
    font-style: italic;
}

/* Formulaire d'avis */
.review-form-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.review-form-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.rating-input {
    margin-bottom: 20px;
}

.rating-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.stars-input {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.stars-input .star {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.stars-input .star:hover,
.stars-input .star.filled {
    color: #ffc107;
    transform: scale(1.1);
}

.stars-input .star.filled {
    color: #ffc107;
}

.comment-input {
    margin-bottom: 20px;
}

.comment-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.comment-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.comment-input textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-actions {
    text-align: right;
}

.btn-submit-review {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-submit-review:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Liste des avis */
.reviews-list {
    margin-top: 30px;
}

.reviews-list h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.review-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.review-user {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.review-stars {
    display: inline-block;
}

.review-stars .stars {
    font-size: 16px;
}

.review-date {
    color: #666;
    font-size: 14px;
}

.review-comment {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

.reviews-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Messages de statut */
.review-login-prompt,
.review-prompt {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.review-login-prompt p,
.review-prompt p {
    margin: 0 0 15px 0;
    color: #1976d2;
}

.btn-login {
    background: #1976d2;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-login:hover {
    background: #1565c0;
    text-decoration: none;
    color: white;
}

/* Note du prestataire */
.provider-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
}

/* Messages de succès/erreur */
.review-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

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

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

/* Étoiles sur les vignettes - Alignement parfait */
.card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: var(--space-3) 0;
    font-size: var(--font-size-sm);
    justify-content: flex-start;
    line-height: 1;
    min-height: 20px; /* Hauteur fixe pour éviter les décalages */
}

.card-rating .stars {
    display: inline-flex;
    gap: 1px;
    align-items: center;
    line-height: 1;
}

.card-rating .star {
    font-size: 16px;
    color: #ddd;
    transition: color 0.2s ease;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
    text-align: center;
}

.card-rating .star.filled {
    color: #ffc107;
}

.card-rating .star.half {
    color: #ffc107;
    position: relative;
}

.card-rating .star.half::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ddd;
}

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

.card-rating .rating-number {
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1;
    margin-left: 4px;
}

.card-rating .rating-count {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    line-height: 1;
}

.card-rating.no-reviews {
    justify-content: flex-start;
}

.no-reviews-text {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Styles pour les vignettes avec étoiles - Harmonisation */
.listing-item .card-rating,
.product-card .card-rating {
    margin: var(--space-3) 0;
}

/* Harmonisation des cartes avec étoiles */
.listing-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.listing-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--space-6);
}

.listing-title-item {
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.listing-location {
    margin-bottom: var(--space-3);
}

.listing-description {
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.listing-price {
    margin-bottom: var(--space-4);
}

.listing-actions {
    margin-top: auto;
}

/* Accessibilité pour les étoiles */
.card-rating {
    aria-label: attr(data-rating);
}

.card-rating[aria-label] {
    cursor: help;
}

/* Responsive pour les étoiles */
@media (max-width: 992px) {
    .card-rating .star {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 768px) {
    .card-rating {
        gap: 6px;
        margin: var(--space-2) 0;
    }
    
    .card-rating .star {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .card-rating .rating-number {
        font-size: var(--font-size-xs);
    }
    
    .card-rating .rating-count {
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .card-rating {
        gap: 4px;
    }
    
    .card-rating .star {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
}

/* Styles spécifiques pour la page voitures - Espacements compacts */
.page-header--voitures ~ section .listing-item {
    /* Réduire les espacements pour un rendu plus compact */
}

.page-header--voitures ~ section .listing-title-item {
    margin-bottom: 8px; /* Réduit de var(--space-3) à 8px */
}

.page-header--voitures ~ section .card-rating {
    margin: 6px 0; /* Réduit de var(--space-3) à 6px */
    min-height: 16px; /* Réduit de 20px à 16px */
}

.page-header--voitures ~ section .listing-location {
    margin-bottom: 8px; /* Réduit de var(--space-3) à 8px */
}

.page-header--voitures ~ section .listing-description {
    margin-bottom: 12px; /* Réduit de var(--space-4) à 12px */
}

.page-header--voitures ~ section .listing-price {
    margin-bottom: 12px; /* Réduit de var(--space-4) à 12px */
}

/* Alignement parfait des étoiles pour voitures */
.page-header--voitures ~ section .card-rating {
    display: flex;
    align-items: center;
    gap: 4px; /* Réduit de 8px à 4px */
    line-height: 1;
}

.page-header--voitures ~ section .card-rating .stars {
    display: inline-flex;
    gap: 0px; /* Supprime l'espace entre les étoiles */
    align-items: center;
    line-height: 1;
}

.page-header--voitures ~ section .card-rating .star {
    font-size: 14px; /* Réduit de 16px à 14px */
    width: 14px;
    height: 14px;
    line-height: 1;
    vertical-align: middle;
    text-align: center;
    margin: 0;
    padding: 0;
}

.page-header--voitures ~ section .card-rating .rating-number {
    font-size: var(--font-size-sm);
    line-height: 1;
    margin-left: 2px; /* Réduit de 4px à 2px */
}

.page-header--voitures ~ section .card-rating .rating-count {
    font-size: var(--font-size-xs);
    line-height: 1;
}

/* Responsive spécifique pour les voitures */
@media (max-width: 992px) {
    .page-header--voitures ~ section .card-rating .star {
        font-size: 13px;
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 768px) {
    .page-header--voitures ~ section .listing-title-item {
        margin-bottom: 6px;
    }
    
    .page-header--voitures ~ section .card-rating {
        margin: 4px 0;
        gap: 3px;
    }
    
    .page-header--voitures ~ section .card-rating .star {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
    
    .page-header--voitures ~ section .listing-location {
        margin-bottom: 6px;
    }
    
    .page-header--voitures ~ section .listing-description {
        margin-bottom: 10px;
    }
    
    .page-header--voitures ~ section .listing-price {
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .page-header--voitures ~ section .card-rating {
        gap: 2px;
    }
    
    .page-header--voitures ~ section .card-rating .star {
        font-size: 11px;
        width: 11px;
        height: 11px;
    }
}

/* Responsive pour les autres éléments */
@media (max-width: 768px) {
    .review-form-container {
        padding: 20px;
        margin: 20px 0;
    }
    
    .review-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .stars-input .star {
        font-size: 25px;
    }
    
    .rating-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
