.restaurant-rating {
    margin: 0;
    padding: 4px 16px 0;
    /* border: 1px solid #ddd; */
    border-radius: 1rem;
    /* background: #fff; */
    position: relative;
    text-align: center;
}

/* Interactive Rating Styles */
.restaurant-rating p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.restaurant-rating .rating-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 5px 0;
    align-items: flex-start;
}

.restaurant-rating .rating-star {
    font-size: 18px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    padding: 0 2px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    font-family: Arial, sans-serif;
}

/* Rating Date Display */
.rating-date {
    font-size: 0.75rem;
    color: var(--global-palette6, #666);
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-style: italic;
    text-align: center;
}

/* Display-only Rating Styles */
.rating-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.rating-display-stars {
    display: flex;
    gap: 2px;
}

.rating-display-star {
    display: inline-block;
    position: relative;
    line-height: 1;
    font-size: 18px;
    width: 18px;
    height: 18px;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* Star colors */
.rating-display-star {
    color: #ddd;  /* Default empty star color */
}

.rating-display-star.full {
    color: var(--star-color, #ffc107);  /* Filled star color */
}

.rating-display-star.partial {
    position: relative;
    color: transparent;
}

.rating-display-star.partial::before,
.rating-display-star.partial::after {
    content: "★";
    position: absolute;
    left: 0;
    top: 0;
}

.rating-display-star.partial::before {
    color: #ddd;
}

.rating-display-star.partial::after {
    color: var(--star-color, #ffc107);
    clip-path: inset(0 calc(100% - var(--partial-value)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--partial-value)) 0 0);
}

/* Overlay colors */
.rating-overlay .rating-display-star {
    color: rgba(255, 255, 255, 0.3);  /* Empty star in overlay */
}

.rating-overlay .rating-display-star.full {
    color: #fff;  /* Filled star in overlay */
}

.rating-overlay .rating-display-star.partial::before {
    color: rgba(255, 255, 255, 0.3);
}

.rating-overlay .rating-display-star.partial::after {
    color: #fff;
}

.rating-display-number {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9em;
    color: #000;
    margin-left: 4px;
}

.rating-label {
    font-weight: 500;
}

.rating-value {
    font-weight: 600;
}

.rating-count {
    color: initial;
}

/* Adjust number color for overlay */
.rating-overlay .rating-display-number {
    color: #fff;
}

.rating-overlay .rating-count {
    color: rgba(255, 255, 255, 0.7);
}

/* Interactive Rating Styles (continued) */
.restaurant-rating .rating-star.hover,
.restaurant-rating .rating-star.active {
    color: #ffc107;
    transform: scale(1.2);
}

.restaurant-rating .rating-star:hover {
    transform: scale(1.3);
    color: #ffdb4d;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

/* Toast Notifications */
.rating-toasts-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Prevent text selection */
.restaurant-rating .rating-stars,
.rating-display {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .rating-toasts-container {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
    }

    .rating-toast {
        width: 100%;
        max-width: none;
        transform: translateY(120%);
    }

    .rating-toast[style*="transform: translateX(0)"] {
        transform: translateY(0) !important;
    }

    .rating-toast[style*="transform: translateX(120%)"] {
        transform: translateY(120%) !important;
    }
}

/* Accessibility */
.rating-display:focus-within {
    outline: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 4px;
}

/* Print styles */
@media print {
    .rating-display-star {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Rating overlay styles */
.rating-overlay {
    transition: opacity 0.3s ease;
}

.rating-item:hover .rating-overlay {
    opacity: 1;
}

/* Rating image wrapper styles */
.rating-image-wrapper {
    position: relative;
    overflow: hidden;
}

.rating-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rating-item:hover .rating-image-wrapper img {
    transform: scale(1.05);
}

.rating-star-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rating-star-label {
    font-size: 0.75rem;
    color: #666;
}

.rating-star.selected {
    color: #ffc107;
}

.rating-star.selected,
.rating-star.hover {
    color: #ffc107;
    transform: scale(1.2);
}

.rating-star.hover {
    color: #ffdb4d;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.rating-star.lower-rating {
    color: #ff9800; /* Different color for lower ratings */
    transform: scale(0.9); /* Slightly smaller scale */
    opacity: 0.8; /* Slightly transparent */
}
