/**
 * Estilos para o componente de avaliação com detalhamento
 * Inspirado no estilo da Amazon
 */

/* Container principal */
.rating-summary {
    position: relative;
    display: inline-block;
    font-family: Arial, sans-serif;
    max-width: 100%;
}

/* Versão compacta */
.rating-summary.compact {
    display: flex;
    align-items: center;
}

.rating-summary.compact .rating-stars {
    margin-right: 5px;
}

.rating-summary.compact .rating-average {
    margin-right: 3px;
    font-weight: bold;
}

/* Cabeçalho */
.rating-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}

.rating-stars-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.rating-stars-container:hover {
    background-color: #f5f5f5;
}

.rating-stars-container:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3);
}

.rating-average {
    margin-left: 8px;
    font-size: 14px;
    color: #333;
}

.rating-count {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Estrelas */
.rating-stars {
    display: flex;
    align-items: center;
}

.rating-stars i {
    color: #e0e0e0;
    font-size: 18px;
    margin-right: 2px;
}

.rating-stars i.fas {
    color: #ffb700;
}

/* Container de detalhes (tooltip) */
.rating-details {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    margin-top: 10px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(-5px);
}

.rating-details.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cabeçalho do detalhamento */
.rating-breakdown-header {
    margin-bottom: 12px;
}

.rating-breakdown-header h5 {
    font-size: 14px;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Barras de progresso */
.rating-breakdown {
    margin-bottom: 12px;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-label {
    width: 60px;
    font-size: 13px;
    color: #666;
}

.rating-progress {
    flex: 1;
    height: 16px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 10px;
}

.rating-progress-bar {
    height: 100%;
    background-color: #ffb700;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rating-percentage {
    width: 40px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* Link para ver todas as avaliações */
.rating-actions {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: center;
}

.rating-link {
    color: #0066cc;
    font-size: 13px;
    text-decoration: none;
}

.rating-link:hover {
    text-decoration: underline;
    color: #004080;
}

/* Seta do tooltip */
.rating-details::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

/* Responsividade */
@media (max-width: 768px) {
    .rating-details {
        width: 280px;
    }
    
    .rating-stars i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rating-details {
        width: 250px;
        left: -50px;
    }
    
    .rating-details::before {
        left: 70px;
    }
    
    .rating-stars i {
        font-size: 14px;
    }
    
    .rating-label {
        width: 50px;
        font-size: 12px;
    }
    
    .rating-percentage {
        width: 35px;
        font-size: 12px;
    }
}
