/* Customer Rating and Trust Level Styles */
.customer-rating-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.rating-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* --- SIMPLE RATING BAR STYLE --- */
.rating-bar {
    transition: background 0.5s ease;
}

.trust-level {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.trust-percentage {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    min-width: 35px;
    text-align: center;
}

/* --- UPDATED LEFT-TO-RIGHT SHADED GRADIENTS --- */
.trust-percentage.excellent {
    background: linear-gradient(to right, #2ecc71, #28a745);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
}

.trust-percentage.good {
    background: linear-gradient(to right, #3498db, #007bff);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.4);
}

.trust-percentage.average {
    background: linear-gradient(to right, #f39c12, #ffc107);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.4);
}

.trust-percentage.poor {
    background: linear-gradient(to right, #e74c3c, #dc3545);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

.trust-percentage.new {
    background: linear-gradient(to right, #95a5a6, #6c757d);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.4);
}

.order-count {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

.rating-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10001;
    pointer-events: none;
}

.rating-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.rating-legend {
    display: flex;
    gap: 8px;
    font-size: 10px;
    margin-top: 2px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-color.delivered {
    background: #28a745;
}

.legend-color.failed {
    background: #dc3545;
}

.legend-color.ongoing {
    background: #ffc107;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customer-rating-container {
        min-width: 100px;
    }
    .rating-bar-container {
        height: 16px;
    }
    .trust-level {
        font-size: 10px;
    }
    .trust-percentage {
        font-size: 10px;
        padding: 1px 4px;
        min-width: 30px;
    }
    .rating-legend {
        display: none;
    }
}

/* Animation for loading state */
.rating-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced hover effects */
.customer-rating-container:hover .rating-bar-container {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.customer-rating-container:hover .trust-percentage {
    transform: scale(1.05);
}