/* RatingPlus - Modern US Editorial / SaaS Style */

:root{
    --rp-text:#0f172a;
    --rp-text-2:#475569;
    --rp-text-3:#64748b;
    --rp-line:#e5e7eb;
    --rp-line-soft:#eef2f7;
    --rp-bg:#ffffff;
    --rp-bg-soft:#f8fafc;
    --rp-primary:#2563eb;
    --rp-primary-hover:#1d4ed8;
    --rp-like:#e11d48;
    --rp-like-hover:#be123c;
    --rp-like-active:#e11d48;
    --rp-star:#f59e0b;
    --rp-star-soft:#e5e7eb;
    --rp-success:#16a34a;
    --rp-shadow:0 12px 30px rgba(15,23,42,.06);
    --rp-radius:18px;
}

.ratingplus-main {
    margin: 36px 0 28px;
    padding: 0;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rating-section {
    margin-bottom: 14px;
}

.rating-box {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    max-width: 100%;
}

.like-section,
.like-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    min-width: 154px;
    padding: 0 18px;
    background: transparent;
    color: var(--rp-text);
    border: 1px solid var(--rp-line);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: all .22s ease;
    white-space: nowrap;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.like-btn::before {
    content: none;
}

.like-btn:hover:not(:disabled) {
    color: var(--rp-like-hover);
    border-color: #cfd7e3;
    background: rgba(15,23,42,.02);
    transform: translateY(-1px);
    box-shadow: none;
}

.like-btn:active:not(:disabled) {
    transform: translateY(0);
}

.like-btn.liked {
    color: var(--rp-like-active);
    border-color: rgba(225,29,72,.18);
    background: rgba(225,29,72,.04);
    box-shadow: none;
}

.like-btn.liked:hover:not(:disabled) {
    box-shadow: none;
}

.like-btn:disabled {
    cursor: not-allowed;
    opacity: 1;
    transform: none !important;
}

.like-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.heart-icon {
    transition: all .25s ease;
}

.heart-outline {
    opacity: 1;
    transform: scale(1);
    transition: all .25s ease;
}

.heart-filled {
    opacity: 0;
    transform: scale(.72);
    transition: all .25s ease;
}

.like-btn.liked .heart-outline {
    opacity: 0;
    transform: scale(.72);
}

.like-btn.liked .heart-filled {
    opacity: 1;
    transform: scale(1);
}

.like-btn:hover .like-icon {
    transform: scale(1.03);
}

.like-text {
    font-weight: 700;
}

.like-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--rp-text-3);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: all .2s ease;
    border: none;
}

.like-btn:hover .like-count {
    background: #f1f5f9;
    transform: scale(1.03);
}

.like-btn.liked .like-count {
    background: rgba(225,29,72,.08);
    color: var(--rp-like-active);
}

.divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(148,163,184,.45), transparent);
    flex-shrink: 0;
}

.stars-container {
    position: relative;
    display: inline-block;
    font-size: 28px;
    line-height: 1;
    height: 28px;
    width: 140px;
    vertical-align: top;
    flex-shrink: 0;
}

.stars-background,
.stars-foreground {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 28px;
    line-height: 28px;
    white-space: nowrap;
    letter-spacing: 0;
    font-family: inherit;
}

.stars-background {
    color: var(--rp-star-soft);
    z-index: 1;
}

.stars-foreground {
    color: var(--rp-star);
    overflow: hidden;
    text-shadow: 0 1px 6px rgba(245,158,11,.18);
    z-index: 2;
    width: 0;
    transition: width .28s ease;
}

.stars-interactive {
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 28px;
}

.star {
    font-size: 28px;
    color: transparent;
    cursor: pointer;
    transition: transform .18s ease, color .18s ease;
    display: inline-block;
    width: 28px;
    height: 28px;
    text-align: center;
    user-select: none;
    flex: 0 0 28px;
    line-height: 28px;
    padding: 0;
    margin: 0;
}

.star:hover:not(.disabled) {
    transform: translateY(-1px) scale(1.12);
    color: rgba(245,158,11,.38) !important;
}

.star.disabled {
    cursor: not-allowed;
    opacity: .6;
}

.rating-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
}

.rating-show {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
}

.rating-score {
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    color: var(--rp-text);
    letter-spacing: -.03em;
}

.rating-count {
    color: var(--rp-text-3);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.rating-no {
    color: var(--rp-text-3);
    font-size: 13px;
    font-weight: 600;
}

.rating-tip {
    color: var(--rp-success);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    background: rgba(22,163,74,.08);
    border: 1px solid rgba(22,163,74,.14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    width: max-content;
}

.rating-error {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 10px;
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    width: max-content;
}

.ratingplus-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    margin: 14px auto 0;
    color: var(--rp-text-2);
    font-size: 14px;
    font-weight: 700;
    width: max-content;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid var(--rp-primary);
    border-radius: 50%;
    animation: rp-spin 1s linear infinite;
    display: inline-block;
}

@keyframes rp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rp-heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.16); }
    50% { transform: scale(.95); }
    75% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes rp-starBounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-5px,0); }
    70% { transform: translate3d(0,-2px,0); }
    90% { transform: translate3d(0,-1px,0); }
}

.like-btn:active:not(:disabled) .like-icon {
    animation: rp-heartBeat .45s ease;
}

.star:active:not(.disabled) {
    animation: rp-starBounce .38s ease;
}

/* Mobile */
@media (max-width: 768px) {
    .ratingplus-main {
        margin: 28px 0 22px;
    }

    .rating-box {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 18px 18px;
        width: 100%;
        max-width: 340px;
    }

    .divider {
        width: 82%;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(148,163,184,.45), transparent);
    }

    .rating-info {
        text-align: center;
        align-items: center;
        min-width: auto;
        order: 1;
    }

    .stars-container {
        order: 2;
        margin: 2px 0;
    }

    .like-box {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .like-btn {
        min-width: 180px;
        justify-content: center;
        min-height: 48px;
    }

    .rating-show {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .rating-box {
        max-width: 100%;
        padding: 16px 16px;
    }

    .stars-container {
        font-size: 26px;
        height: 26px;
        width: 130px;
    }

    .stars-background,
    .stars-foreground {
        font-size: 26px;
        height: 26px;
        line-height: 26px;
    }

    .stars-interactive {
        height: 26px;
    }

    .star {
        font-size: 26px;
        width: 26px;
        height: 26px;
        line-height: 26px;
        flex: 0 0 26px;
    }

    .like-btn {
        min-width: 168px;
        padding: 0 16px;
        font-size: 14px;
    }

    .rating-score {
        font-size: 22px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .rating-box {
        flex-direction: row;
        max-width: 520px;
    }

    .rating-info {
        align-items: flex-start;
        text-align: left;
        order: initial;
    }

    .stars-container,
    .like-box {
        order: initial;
    }

    .divider {
        width: 1px;
        height: 40px;
        background: linear-gradient(to bottom, transparent, rgba(148,163,184,.45), transparent);
    }
}