/**
 * Simple Love Rating - Stylesheet
 * Version: 1.6.1
 */

.slr-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 10px 0;
    position: relative;
    transition: opacity 0.2s ease;
}

.slr-container.slr-loading {
    opacity: 0.5;
    pointer-events: none;
}

.slr-heart {
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    color: #cccccc;

    border: none;
    background: none;
    outline: none;

    padding: 4px;
    border-radius: 4px;

    font: inherit;
    line-height: 1;

    appearance: none;
    -webkit-appearance: none;

    box-shadow: none;

    transition:
        color 0.3s ease,
        transform 0.2s ease;
}

.slr-heart:hover {
    color: #ff6b7a;
    transform: scale(1.15);
}

.slr-heart:focus-visible {
    box-shadow: 0 0 0 2px #ff4757;
}

/* Sudah pernah like */
.slr-heart.liked {
    color: #ff4757;
    cursor: default;
    transform: none;
    pointer-events: none;
}

/* Hindari browser membuat tombol disabled terlihat pudar */
.slr-heart:disabled {
    opacity: 1;
}

.slr-heart svg {
    display: block;
}

.slr-count {
    min-width: 1ch;

    user-select: none;

    font-weight: 600;
    color: #333333;

    transition: transform 0.3s ease;
}

.slr-count.slr-count-updated {
    transform: scale(1.2);
}

.slr-msg {
    position: absolute;

    left: 36px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 12px;
    white-space: nowrap;

    padding: 4px 8px;

    border-radius: 4px;

    background: #ffffff;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    animation: slr-fade-in 0.3s ease;

    z-index: 10;
}

.slr-msg-error {
    color: #dc3545;
}

.slr-msg-warning {
    color: #856404;
}

@keyframes slr-fade-in {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Dark mode */

@media (prefers-color-scheme: dark) {

    .slr-count {
        color: #e0e0e0;
    }

    .slr-heart {
        color: #666666;
    }

    .slr-heart:hover {
        color: #ff6b7a;
    }

    .slr-heart.liked {
        color: #ff4757;
    }

    .slr-msg {
        background: #333333;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .slr-msg-error {
        color: #ff6b6b;
    }

    .slr-msg-warning {
        color: #ffc107;
    }
}

/* Reduced Motion Accessibility */

@media (prefers-reduced-motion: reduce) {

    .slr-container,
    .slr-heart,
    .slr-count,
    .slr-msg {
        transition: none;
        animation: none;
    }
}