/**
 * Press Ganey Ratings - Frontend Styles
 */

/* Base Rating Widget */
.pgr-rating-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Star Container */
.pgr-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

/* Individual Stars */
.pgr-star {
    display: inline-block;
    font-style: normal;
}

.pgr-star-filled {
    color: #f5a623;
}

.pgr-star-empty {
    color: #e0e0e0;
}

/* Partial Star */
.pgr-star-partial {
    position: relative;
    color: #e0e0e0;
}

.pgr-star-partial::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: var(--fill-percentage, 50%);
    overflow: hidden;
    color: #f5a623;
}

/* Star Sizes */
.pgr-size-small .pgr-star {
    font-size: 14px;
}

.pgr-size-medium .pgr-star {
    font-size: 20px;
}

.pgr-size-large .pgr-star {
    font-size: 28px;
}

/* Rating Number */
.pgr-rating-number {
    font-weight: 600;
    color: #333;
    margin-left: 4px;
}

.pgr-size-small .pgr-rating-number {
    font-size: 13px;
}

.pgr-size-medium .pgr-rating-number {
    font-size: 16px;
}

.pgr-size-large .pgr-rating-number {
    font-size: 22px;
}

/* Review Count */
.pgr-review-count {
    color: #666;
    font-size: 14px;
}

/* Card Layout */
.pgr-rating-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.pgr-card-horizontal {
    flex-direction: row;
}

.pgr-card-vertical {
    flex-direction: column;
    text-align: center;
}

.pgr-card-compact {
    padding: 4px 8px;
    gap: 4px;
}

.pgr-card-info {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.pgr-card-rating {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.pgr-card-count {
    color: #888;
    font-size: 13px;
}

/* Full Rating Display */
.pgr-rating-full {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
}

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

.pgr-full-main {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.pgr-full-rating-number {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 8px;
}

.pgr-full-stars {
    margin-bottom: 8px;
}

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

/* Sources List */
.pgr-sources {
    margin-top: 16px;
}

.pgr-sources-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pgr-sources-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pgr-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pgr-source-item:last-child {
    border-bottom: none;
}

.pgr-source-name {
    font-size: 14px;
    color: #444;
    flex: 1;
}

.pgr-source-rating {
    margin: 0 12px;
}

.pgr-source-count {
    color: #888;
    font-size: 12px;
    min-width: 50px;
    text-align: right;
}

/* Error Message (admin only) */
.pgr-error {
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .pgr-rating-full {
        padding: 16px;
    }
    
    .pgr-full-rating-number {
        font-size: 36px;
    }
    
    .pgr-source-item {
        flex-wrap: wrap;
    }
    
    .pgr-source-name {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* Avada Theme Integration */
.fusion-builder-live .pgr-rating-widget,
.fusion-builder-live .pgr-rating-card,
.fusion-builder-live .pgr-rating-full {
    pointer-events: none;
}

/* Print Styles */
@media print {
    .pgr-star-filled,
    .pgr-star-partial::before {
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .pgr-star-empty {
        color: #ccc !important;
    }
}
