/* =========================================
   ReviewBox — Frontend Styles
   ========================================= */

/* --- Base Widget --- */
.jsr-widget {
    width: 100%;
    display: block;
    overflow: visible;
    text-align: left;
    direction: ltr;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.jsr-widget *,
.jsr-widget *::before,
.jsr-widget *::after {
    box-sizing: border-box;
}

.jsr-widget img {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    min-width: initial !important;
    max-width: initial !important;
}

/* --- Container --- */
.jsr-container {
    display: block;
    margin-bottom: 15px;
}

/* --- Reviews Wrapper (slider area) --- */
.jsr-slider-area {
    position: relative;
    display: block;
}

.jsr-reviews-wrapper {
    overflow: hidden;
    touch-action: pan-y;
}

.jsr-reviews-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    padding-top: 5px;
    will-change: transform;
}

/* Item sizes are controlled by JS for precise pixel calculations */

/* --- Review Item --- */
.jsr-review-item {
    transition: transform 300ms ease-out;
}

@media (min-width: 480px) {
    .jsr-review-item:hover {
        transform: translate(0, -5px);
    }
}

.jsr-review-inner {
    border-radius: 12px;
    padding: 20px;
    display: block;
    position: relative;
}

/* --- DARK THEME --- */
.jsr-theme-dark .jsr-container {
    color: #ffffff;
}

.jsr-theme-dark .jsr-review-inner {
    background-color: #191919;
    border: 0 solid #191919;
}

.jsr-theme-dark .jsr-name {
    color: #ffffff;
}

.jsr-theme-dark .jsr-date {
    color: #ffffff;
    opacity: 0.7;
}

.jsr-theme-dark .jsr-review-text {
    color: #ffffff;
}

.jsr-theme-dark .jsr-review-header::before {
    border-top-color: #191919;
}

.jsr-theme-dark .jsr-controls .jsr-prev,
.jsr-theme-dark .jsr-controls .jsr-next {
    background-color: #191919;
    outline: 2px solid #191919;
}

.jsr-theme-dark .jsr-controls .jsr-prev::before,
.jsr-theme-dark .jsr-controls .jsr-next::before {
    border-color: #B5B5B5;
}

.jsr-theme-dark .jsr-avatar-placeholder {
    background-color: #333;
    color: #ffffff;
}

.jsr-theme-dark .jsr-progress-bar {
    background: rgba(181, 181, 181, 0.35);
}

.jsr-theme-dark .jsr-progress-dot {
    background: #B5B5B5;
}

.jsr-theme-dark .jsr-tooltip {
    color: #000 !important;
    background-color: #fff !important;
}

.jsr-theme-dark .jsr-tooltip::before {
    border-top-color: #fff;
}

/* --- LIGHT THEME --- */
.jsr-theme-light .jsr-container {
    color: #333333;
}

.jsr-theme-light .jsr-review-inner {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.jsr-theme-light .jsr-name {
    color: #333333;
}

.jsr-theme-light .jsr-date {
    color: #888888;
}

.jsr-theme-light .jsr-review-text {
    color: #444444;
}

.jsr-theme-light .jsr-review-header::before {
    border-top-color: #ffffff;
}

.jsr-theme-light .jsr-controls .jsr-prev,
.jsr-theme-light .jsr-controls .jsr-next {
    background-color: #ffffff;
    outline: 2px solid #e5e5e5;
}

.jsr-theme-light .jsr-controls .jsr-prev::before,
.jsr-theme-light .jsr-controls .jsr-next::before {
    border-color: #555;
}

.jsr-theme-light .jsr-controls .jsr-prev:hover,
.jsr-theme-light .jsr-controls .jsr-next:hover {
    background-color: #f0f0f0 !important;
    outline-color: #ccc !important;
}

.jsr-theme-light .jsr-avatar-placeholder {
    background-color: #e0e0e0;
    color: #555;
}

.jsr-theme-light .jsr-progress-bar {
    background: rgba(0, 0, 0, 0.1);
}

.jsr-theme-light .jsr-progress-dot {
    background: #888;
}

.jsr-theme-light .jsr-tooltip {
    color: #fff !important;
    background-color: #333 !important;
}

.jsr-theme-light .jsr-tooltip::before {
    border-top-color: #333;
}

/* --- Review Content --- */
.jsr-review-content {
    position: relative;
    padding: 0;
    overflow: visible;
    height: auto;
}

.jsr-review-content .jsr-stars {
    margin: 0 0 7px 0;
}

.jsr-review-text {
    -webkit-box-orient: vertical;
    line-height: 1.45;
    height: 87px;
    font-size: 15px;
    text-align: left;
    transition: height 0.5s;
    font-style: normal;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    overflow: hidden;
    padding-right: 0;
}

.jsr-empty-text {
    opacity: 0.6;
    font-style: italic;
}

/* --- Stars --- */
.jsr-stars {
    margin-top: 3px;
    white-space: nowrap;
    display: block;
    height: 17px;
    line-height: 17px;
}

.jsr-star {
    display: inline-block;
    width: 17px;
    height: 17px;
    margin-right: 1px;
    vertical-align: top;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    /* Star shape via CSS mask (5-point star) */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

.jsr-star-full {
    background-color: #f6bb06;
}

.jsr-star-empty {
    background-color: #555;
}

.jsr-theme-light .jsr-star-empty {
    background-color: #ccc;
}

/* Google stars — override with Google style colors */
.jsr-source-google .jsr-star-full {
    background-color: #f6bb06;
}

/* Facebook stars — use Facebook blue */
.jsr-source-facebook .jsr-star-full {
    background-color: #1877F2;
}

/* --- Platform Icon --- */
.jsr-platform-icon {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 17px;
    right: 17px;
    line-height: 0;
}

.jsr-platform-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* --- Review Header (below card, speech-bubble style) --- */
.jsr-review-header {
    display: flex;
    flex-wrap: nowrap;
    position: relative;
    padding: 15px 0 0 10px;
}

.jsr-review-header::before {
    position: absolute;
    content: "";
    top: 0;
    left: 20px;
    border: 10px solid transparent;
    border-bottom-width: 0;
}

.jsr-profile-img {
    margin: 0 15px 0 0;
    flex-shrink: 0;
}

.jsr-profile-img img {
    width: 40px !important;
    height: 40px !important;
    display: block;
    border-radius: 50% !important;
    object-fit: cover;
    object-position: top;
}

.jsr-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
}

.jsr-profile-details {
    flex: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.jsr-name {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    padding-right: 25px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.jsr-date {
    font-size: 13px;
}

/* --- Tooltip --- */
.jsr-tooltip-wrap {
    position: relative;
    display: inline-block;
    cursor: default;
}

.jsr-tooltip {
    text-align: left;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    display: inline-block;
    position: absolute;
    white-space: nowrap;
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.33);
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

.jsr-tooltip::before {
    width: 0;
    height: 0;
    border-style: solid;
    content: "";
    position: absolute;
    left: 50%;
    margin-left: -7px;
    bottom: -7px;
    border-width: 7px 7px 0 7px;
    border-color: transparent;
}

.jsr-tooltip-wrap:hover .jsr-tooltip {
    opacity: 1;
    visibility: visible;
}

/* --- Controls (prev/next arrows) --- */
.jsr-controls {
    display: none;
    width: 100%;
    position: absolute;
    height: 0;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

@media (min-width: 1024px) {
    .jsr-controls {
        display: block;
    }
}

.jsr-controls .jsr-prev,
.jsr-controls .jsr-next {
    position: absolute;
    width: 36px;
    height: 36px;
    display: block;
    opacity: 1;
    transition: all 200ms ease-out;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}

.jsr-controls .jsr-prev::before,
.jsr-controls .jsr-next::before {
    transition: all 200ms ease-out;
    content: "";
    display: block;
    position: absolute;
    border-style: solid;
    border-width: 0;
    border-bottom-width: 2px;
    border-left-width: 2px;
    width: 10px;
    height: 10px;
    top: 50%;
    left: 50%;
}

.jsr-controls .jsr-prev:hover,
.jsr-controls .jsr-next:hover {
    background-color: #ccc !important;
    outline-color: #ccc !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
}

.jsr-controls .jsr-prev:hover::before,
.jsr-controls .jsr-next:hover::before {
    border-color: #000 !important;
}

.jsr-controls .jsr-next {
    right: -18px;
}

.jsr-controls .jsr-next::before {
    transform: translate(-70%, -50%) rotate(-135deg);
}

.jsr-controls .jsr-prev {
    left: -18px;
}

.jsr-controls .jsr-prev::before {
    transform: translate(-30%, -50%) rotate(45deg);
}

.jsr-controls .jsr-prev[data-hidden="true"],
.jsr-controls .jsr-next[data-hidden="true"] {
    display: none;
}

/* --- Progress Bar (mobile) --- */
.jsr-progress-bar {
    display: none;
    margin: 20px auto;
    width: 150px;
    height: 3px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.jsr-progress-dot {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
    width: 25px;
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s, left 0.2s;
}

@media (max-width: 479px) {
    .jsr-progress-bar {
        display: block;
    }
}

/* --- No reviews message --- */
.jsr-no-reviews {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 15px;
}

/* --- Scrollbar for review-text-mode-scroll --- */
.jsr-widget ::-webkit-scrollbar {
    width: 4px;
    border-radius: 3px;
}

.jsr-widget ::-webkit-scrollbar-track {
    background: rgba(85, 85, 85, 0.1);
}

.jsr-widget ::-webkit-scrollbar-thumb {
    background: rgba(85, 85, 85, 0.6);
}

.jsr-widget ::-webkit-scrollbar-thumb:hover {
    background: #555;
}
