/**
 * J2Commerce Product Reviews - Frontend Styles
 * Copyright (C) 2025 J2Commerce, LLC. All rights reserved.
 */


.product-reviews {
    .btn-secondary {
        --btn-color: #333d4c;
        --btn-bg: #eef1f6;
        --btn-border-color: #eef1f6;
        --btn-hover-color: #181d25;
        --btn-hover-bg: #e0e5eb;
        --btn-hover-border-color: #e0e5eb;
        --btn-active-color: #333d4c;
        --btn-active-bg: #e0e5eb;
        --btn-active-border-color: #e0e5eb;
        --btn-disabled-color: #333d4c;
        --btn-disabled-bg: #eef1f6;
        --btn-disabled-border-color: #eef1f6;
    }

    .stars-display .star-icon {line-height:1;}
    .fs-xs {font-size:0.75rem;}
    .fs-sm {font-size:0.825rem;}
    .fs-md {font-size:1rem;}
    .fs-lg {font-size:1.125rem;}
    .fs-xl {font-size:1.25rem;}

}

/* Reviews Section */
.j2commerce-reviews-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.reviews-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Rating Overview */
.rating-overview {
    padding: 20px;
}

.average-rating {
    font-size: 2rem;
    margin-bottom: 10px;
}

.rating-number {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
}

.rating-max {
    color: #999;
}

.stars-display {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.total-reviews {
    color: #666;
}

/* Rating Distribution */
.rating-distribution {
    padding: 10px 0;
}

.rating-bar-row {
    margin-bottom: 5px;
}

.rating-label {
    width: 60px;
    font-size: 0.9rem;
}

.rating-count {
    width: 40px;
    text-align: right;
    font-size: 0.9rem;
    color: #666;
}

/* Write Review CTA */
.write-review-cta {
    text-align: center;
    padding: 20px 0;
}

/* Review Form */
#review-form-container {
    max-width: 700px;
    margin: 0 auto 30px;
}

.star-rating-input {
    padding: 10px 0;
}

.stars-interactive {
    font-size: 2rem;
    cursor: pointer;
}

.stars-interactive i {
    color: #ddd;
    transition: color 0.2s ease;
    padding: 0 2px;
}

.stars-interactive i:hover,
.stars-interactive i.active,
.stars-interactive i.hovered {
    color: #ffc107;
}

/* Uppy Dashboard Customization */
#uppy-dashboard {
    min-height: 150px;
}

.uppy-Dashboard-inner {
    border-radius: 8px;
}

/* Reviews List */
.reviews-list {
    margin-top: 20px;
}

.review-item {
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.review-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.review-header {
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.reviewer-name {
    font-size: 1rem;
}

.review-date {
    font-size: 0.85rem;
}

.review-rating {
    font-size: 1rem;
}

.review-rating i {
    margin-right: 2px;
}

.review-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.review-content {
    line-height: 1.6;
    color: #444;
}

/* Review Images */
.review-images {
    margin-top: 15px;
}

.review-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Admin Response */
.admin-response {
    margin-top: 15px;
    border-left: 3px solid #007bff;
}

.admin-response strong {
    color: #007bff;
}

/* No Reviews */
.no-reviews {
    color: #999;
}

.no-reviews i {
    display: block;
    margin-bottom: 15px;
}

/* Reviews Toolbar */
.reviews-toolbar {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

/* Pagination */
.reviews-pagination {
    margin-top: 30px;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 767px) {
    .rating-overview {
        margin-bottom: 20px;
    }

    .average-rating {
        font-size: 1.5rem;
    }

    .rating-number {
        font-size: 2rem;
    }

    .stars-display {
        font-size: 1.2rem;
    }

    .review-thumb {
        width: 60px;
        height: 60px;
    }

    .reviews-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .reviews-toolbar > div {
        width: 100%;
    }

    .reviews-toolbar select {
        width: 100% !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .j2commerce-reviews-section {
        border-top-color: #444;
    }

    .rating-number {
        color: #fff;
    }

    .review-item {
        border-color: #444;
        background-color: #2d2d2d;
    }

    .review-header {
        border-bottom-color: #444;
    }

    .review-content {
        color: #ccc;
    }

    .admin-response {
        background-color: #333 !important;
    }

    .reviews-toolbar {
        border-bottom-color: #444;
    }
}

/* Animation for form toggle */
#review-form-container {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Star hover effect */
.stars-interactive i {
    transform-origin: center;
}

.stars-interactive i:hover {
    transform: scale(1.2);
}

/* Loading state for submit button */
#btn-submit-review.loading {
    pointer-events: none;
    opacity: 0.7;
}

#btn-submit-review.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.reviews-pagination .page-link {color:#181d25!important;}
.reviews-pagination .page-link.active, .reviews-pagination .active > .page-link {background-color:#eef1f6!important;color:#181d25!important;}

.star_summary.afterDisplayTitle {margin-bottom:1rem;}
.star_summary .stars-display {font-size:1rem;margin-bottom:0;}

#uppy-review-dashboard .uppy-Dashboard-inner {
    border-radius: 0.375rem;
}
#uppy-review-dashboard .uppy-Dashboard-AddFiles {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.375rem;
}
