/**
 * Ratings CSS
 * 
 * Estilos para o sistema de avaliações
 */

/* Estrelas de avaliação */
.rating-stars {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.rating-stars .star {
    color: #e0e0e0;
    font-size: 1.2rem;
    margin-right: 2px;
    transition: transform 0.2s, color 0.2s;
}

.rating-stars .star.filled {
    color: #ffb700;
}

.rating-stars .star.half-filled {
    position: relative;
}

.rating-stars .star.half-filled:before {
    content: '\f089'; /* fa-star-half */
    position: absolute;
    color: #ffb700;
}

/* Efeito de zoom ao passar o mouse */
.rating-stars:hover {
    z-index: 10;
}

.rating-stars:hover .star {
    transform: scale(1.2);
}

/* Tooltip de detalhes */
.rating-tooltip {
    position: absolute;
    top: -70px;
    left: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 10px;
    width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
}

.rating-stars:hover .rating-tooltip {
    opacity: 1;
    visibility: visible;
}

.rating-tooltip-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.rating-tooltip-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.rating-tooltip-stats {
    display: flex;
    margin-bottom: 8px;
}

.rating-tooltip-bar {
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

.rating-tooltip-bar-fill {
    height: 100%;
    background-color: #ffb700;
}

.rating-tooltip-comments {
    font-size: 0.85rem;
    max-height: 60px;
    overflow-y: auto;
}

.rating-tooltip-comment {
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Formulário de avaliação */
.rating-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rating-form-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.rating-form-group {
    margin-bottom: 15px;
}

.rating-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.rating-form-stars {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

.rating-form-stars .star {
    font-size: 1.8rem;
    color: #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    margin-right: 5px;
}

.rating-form-stars .star:hover,
.rating-form-stars .star.active {
    color: #ffb700;
}

/* Efeito de preenchimento progressivo */
.rating-form-stars {
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse; /* Inverte a ordem para facilitar o efeito */
    justify-content: flex-end;
}

.rating-form-stars .star {
    position: relative;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 2rem;
    transition: color 0.2s, transform 0.2s;
    margin-right: 5px;
}

.rating-form-stars .star:hover,
.rating-form-stars .star:hover ~ .star,
.rating-form-stars .star.hover,
.rating-form-stars .star.hover ~ .star {
    color: #ffb700;
    transform: scale(1.2);
}

.rating-form-stars .star.active {
    color: #ffb700;
}

/* Efeito de preenchimento ao passar o mouse */
.rating-form-stars:not(:hover) .star.active,
.rating-form-stars:not(:hover) .star.active ~ .star {
    color: #ffb700;
}

/* Animação de preenchimento */
@keyframes fill-star {
    0% { color: #e0e0e0; transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { color: #ffb700; transform: scale(1.1); }
}

.rating-form-stars .star:hover,
.rating-form-stars .star:hover ~ .star,
.rating-form-stars .star.hover,
.rating-form-stars .star.hover ~ .star {
    animation: fill-star 0.3s ease forwards;
}

/* Texto de feedback baseado na avaliação */
.rating-feedback {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
    height: 20px;
    transition: opacity 0.3s;
}

.rating-form-submit {
    background-color: #6e0ad6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rating-form-submit:hover {
    background-color: #5a08b0;
}

/* Lista de avaliações */
.ratings-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ratings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.ratings-title {
    font-size: 1.5rem;
    margin: 0;
    color: #333;
}

.ratings-summary {
    display: flex;
    align-items: center;
}

.ratings-average {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6e0ad6;
    margin-right: 15px;
}

.ratings-count {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.ratings-list {
    margin-bottom: 20px;
}

.rating-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.rating-item:last-child {
    border-bottom: none;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.rating-user {
    display: flex;
    align-items: center;
}

.rating-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.rating-user-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.rating-date {
    color: #666;
    font-size: 0.9rem;
}

.rating-content {
    color: #333;
    line-height: 1.5;
    margin-top: 10px;
}

/* Filtros de avaliações */
.ratings-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ratings-filter-btn {
    padding: 8px 15px;
    border-radius: 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.ratings-filter-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.ratings-filter-btn.active {
    background-color: #6e0ad6;
    color: white;
}

/* Paginação */
.ratings-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.ratings-pagination-btn {
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.ratings-pagination-btn:hover {
    background-color: #e0e0e0;
}

.ratings-pagination-btn.active {
    background-color: #6e0ad6;
    color: white;
}

.ratings-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsividade */
@media (max-width: 768px) {
    .ratings-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ratings-summary {
        margin-top: 10px;
    }
    
    .rating-header {
        flex-direction: column;
    }
    
    .rating-date {
        margin-top: 5px;
    }
}
