/*
* Custom Product Reviews Front CSS
*/

/* Container styles matching custom delivery blocks */
.cpr-container {
    background-color: #f7fbfd; /* Very light blue/cyan background */
    border: 1px dashed #b8daff; /* Light blue dashed border */
    border-radius: 4px; /* Slight rounded corners */
    padding: 20px;
    margin-bottom: 20px;
    font-family: inherit;
    color: #333;
}

/* Header & Stats */
.cpr-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.cpr-header-left {
    text-align: center;
    min-width: 120px;
}

.cpr-average-score {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #222;
}

.cpr-score-max {
    font-size: 16px;
    color: #888;
    font-weight: 400;
}

.cpr-stars {
    margin: 10px 0;
}

.cpr-star {
    fill: #ffd700; /* Gold color for stars */
}

.cpr-star-empty {
    fill: #e0e0e0;
}

.cpr-total-reviews {
    font-size: 13px;
    color: #666;
}

/* Distribution Bars */
.cpr-header-center {
    flex-grow: 1;
    max-width: 300px;
    margin: 0 30px;
}

.cpr-dist-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
}

.cpr-dist-star {
    min-width: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #555;
}

.cpr-progress {
    flex-grow: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.cpr-progress-bar {
    height: 100%;
    background-color: #ffd700;
    border-radius: 4px;
}

.cpr-dist-count {
    min-width: 30px;
    color: #888;
    text-align: right;
}

/* Sorting */
.cpr-sorting {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.cpr-sort-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}

.cpr-sort-btn.active, .cpr-sort-btn:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* Review List */
.cpr-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cpr-item {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.cpr-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cpr-item-stars {
    display: flex;
    gap: 2px;
}

.cpr-item-meta {
    font-size: 13px;
    color: #888;
}

.cpr-item-author {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.cpr-item-title {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
}

.cpr-item-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 15px;
}

/* Photos */
.cpr-item-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cpr-item-photos img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.cpr-item-photos img:hover {
    transform: scale(1.05);
}

/* Actions */

.cpr-item-actions-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cpr-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.cpr-useful-actions {
    display: flex;
    gap: 15px;
}

.cpr-btn-action {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.cpr-btn-action:hover, .cpr-btn-action.active {
    color: #333;
}

/* Mini Stars in Product List */
.cpr-product-list-reviews {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

/* Enforce centering of stars in product cards (PC grid-2, mobile grid & list modes) */
.product-description .tvall-product-star-icon,
.tvproduct-wrapper .tvall-product-star-icon,
.tvproduct-description .tvall-product-star-icon,
.thumbnail-container .tvall-product-star-icon,
.product-miniature .tvall-product-star-icon,
.tvproduct-info-box-wrapper .tvall-product-star-icon {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto 5px auto !important;
    text-align: center !important;
}

.product-description .cpr-stars,
.tvproduct-wrapper .cpr-stars,
.tvproduct-description .cpr-stars,
.thumbnail-container .cpr-stars,
.product-miniature .cpr-stars,
.tvproduct-info-box-wrapper .cpr-stars {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Force LEFT alignment on Single Product Detail Page */
#product .tvall-product-star-icon,
.tv-product-page-content .tvall-product-star-icon,
.tvproduct-page-wrapper .tvall-product-star-icon,
.cpr-page-product-stars {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: auto !important;
    margin: 8px 0 !important;
    text-align: left !important;
    float: none !important;
    clear: both !important;
}

#product .tvall-product-star-icon .cpr-stars,
.tv-product-page-content .tvall-product-star-icon .cpr-stars,
.tvproduct-page-wrapper .tvall-product-star-icon .cpr-stars,
.cpr-page-product-stars .cpr-stars {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: auto !important;
    margin: 0 10px 0 0 !important;
}

.cpr-total-count {
    font-size: 12px;
    color: #888;
}

/* Modal */
.cpr-modal {
    display: none;
    position: fixed;
    z-index: 2147483647;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.cpr-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-height: 95vh;
    overflow-y: auto;
}

.cpr-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.cpr-close:hover {
    color: #333;
}

.cpr-modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.cpr-modal-header img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.cpr-modal-header h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

.cpr-form-group {
    margin-bottom: 20px;
}

.cpr-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

.cpr-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.cpr-input:focus {
    border-color: #66afe9;
    outline: none;
}

.cpr-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Interactive Stars */
.cpr-stars-input-group {
    display: flex;
    flex-direction: column;
}

.cpr-stars-input {
    display: flex;
    gap: 5px;
    cursor: pointer;
}

.cpr-btn-clear {
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 5px;
    padding: 0;
}

/* File Upload */
.cpr-file-upload {
    position: relative;
}

.cpr-file-input {
    display: none;
}

.cpr-file-label {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
}

.cpr-file-label:hover {
    background-color: #e4e4e4;
}

.cpr-file-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.cpr-file-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cpr-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* Modal Footer */
.cpr-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.cpr-btn-primary {
    background-color: #222;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cpr-btn-primary:hover {
    background-color: #444;
}

.cpr-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
}

.cpr-message.success {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.cpr-message.error {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

/* Lightbox Overlay */
.cpr-lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.cpr-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.cpr-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

@media (max-width: 768px) {
    .cpr-header {
        flex-direction: column;
        gap: 20px;
    }
    .cpr-header-center {
        margin: 0;
        width: 100%;
    }
}

/* Top Write Review Button */
.cpr-top-write-btn {
    background-color: #222;
    color: #fff;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    margin-left: auto;
}
.cpr-top-write-btn:hover {
    background-color: #444;
    color: #fff;
    text-decoration: none;
}
.cpr-product-list-reviews {
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
}

/* Nuke the theme's custom CSS injected WYSTAW OPINI text */
.tvall-product-review::before,
.tvcustom-review-wrapper .tvall-product-review::before {
    content: none !important;
    display: none !important;
}

/* Write button styles */
#cpr-top-write-btn, .cpr-top-write-btn {
    background-color: #f4f8fb !important;
    color: #216f9f !important;
    border: 1px dashed #a5c7df !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-left: 0 !important;
    transition: all 0.2s ease-in-out !important;
    outline: none !important;
}

#cpr-top-write-btn:hover, .cpr-top-write-btn:hover {
    background-color: #e2f0f9 !important;
    border-color: #72a9cf !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(33, 111, 159, 0.2) !important;
}

.cpr-bottom-write-btn {
    background-color: #f4f8fb !important;
    color: #216f9f !important;
    border: 1px dashed #a5c7df !important;
    padding: 6px 15px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    margin-left: auto;
    outline: none !important;
}

.cpr-bottom-write-btn:hover {
    background-color: #e2f0f9 !important;
    border-color: #72a9cf !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(33, 111, 159, 0.2) !important;
}

@media (max-width: 768px) {
    .cpr-sorting-header {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
    }
    .cpr-sorting {
        justify-content: center !important;
        margin-bottom: 0 !important;
    }
    .cpr-bottom-write-btn {
        margin-left: 0 !important;
    }
    
    .cpr-item-header {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 5px;
    }
    .cpr-item-meta {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
}

/* ---- review translation ---- */
.cpr-translate-btn {
    position: relative;
}

.cpr-translate-btn .cpr-translate-label {
    font-size: 13px;
}

.cpr-translate-btn:hover {
    color: #216f9f;
}

.cpr-translate-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Attribution label - subtle indicator below content */
.cpr-translation-attribution {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 10px;
}

.cpr-translation-attribution::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M12.87 15.07l-2.54-2.51.03-.03A17.52 17.52 0 0014.07 6H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Error message below review */
.cpr-translate-error {
    font-size: 12px;
    color: #d9534f;
    margin-top: 8px;
    padding: 6px 10px;
    background-color: #fdf2f2;
    border-radius: 4px;
    border: 1px solid #fce4e4;
    animation: cprFadeIn 0.2s ease-in-out;
}

@keyframes cprFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Translated state - very subtle background hint */
.cpr-item.cpr-translating {
    /* No visible background change - keep it clean */
}

/* Mobile adjustments for translation elements */
@media (max-width: 768px) {
    
.cpr-item-actions-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cpr-item-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cpr-useful-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cpr-translate-btn .cpr-translate-label {
        font-size: 12px;
    }

    .cpr-translation-attribution {
        font-size: 11px;
    }
}

/* ---- verified purchase badge ---- */
.cpr-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
}
.cpr-verified svg {
    fill: #16a34a;
    flex: 0 0 auto;
}
