/* =====================
   REVIEW SYSTEM
   ===================== */

:root {
    --primary: #ff8800;
    --secondary: #007bff;
    --success: #28a745;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #fff;
    --bg-light: #f8f9fa;
    --border: #e9ecef;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.2s ease;
}

.product-reviews-section {
    padding: 30px;
    background: var(--bg);
    max-width: 1000px;
    margin: 10px 0 0 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.reviews-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.reviews-product-title {
    font: 600 20px/1 inherit;
    color: var(--text);
    margin: 0;
}

/* Rating Summary */
.reviews-summary-modern {
    display: flex;
    gap: 60px;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.rating-overview-left {
    min-width: 220px;
    padding-right: 20px;
}

.rating-score-large {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.score-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.score-star {
    font-size: 48px;
    color: var(--primary);
}

.rating-subtitle {
    color: var(--text-light);
    font: 500 15px inherit;
    margin-bottom: 8px;
}

.total-reviews {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.rating-bars-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
}

.rating-bar-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 4px 0;
}

.star-number {
    font: 500 15px inherit;
    color: var(--text);
    min-width: 15px;
}

.star-icon {
    font-size: 15px;
    color: var(--primary);
    min-width: 16px;
}

.progress-modern {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill-modern {
    height: 100%;
    background: var(--secondary);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.percentage-label {
    font: 500 14px inherit;
    color: var(--text-light);
    min-width: 40px;
    text-align: right;
}

/* Reviews List */
.reviews-list-container {
    margin-bottom: 30px;
    padding: 10px 0;
}

.reviews-list {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 15px;
}

.review-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.review-item:hover {
    box-shadow: var(--shadow-hover);
    border-color: #ddd;
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.review-author-info {
    flex: 1;
}

.review-author {
    font: 600 16px inherit;
    color: var(--text);
    margin-bottom: 8px;
}

.review-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: 500 12px inherit;
    color: var(--success);
    background: #d4edda;
    padding: 3px 10px;
    border: 1px solid #c3e6cb;
    border-radius: 12px;
    margin-left: 10px;
}

.review-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6c757d;
}

.review-date,
.review-usage {
    color: var(--text-muted);
}

.review-rating {
    font-size: 16px;
}

.review-rating i {
    margin: 0 2px;
    color: var(--primary);
}

.review-comment {
    font: 15px/1.6 inherit;
    color: #495057;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 5px;
}

/* Actions & Buttons */
.review-helpful {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: normal;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    background: var(--bg-light);
    user-select: none;
}

.review-helpful:hover,
.review-helpful.marked {
    color: var(--secondary);
    background: #e7f3ff;
    border-color: var(--secondary);
}

.review-helpful.marked {
    font-weight: 500;
    background: #d0e9ff;
}

.review-helpful i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.review-helpful:hover i,
.review-helpful.marked i {
    transform: scale(1.1);
    color: var(--secondary);
}

.review-reply {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-left: 3px solid var(--secondary);
    border-radius: 5px;
    font-size: 14px;
}

.review-reply .fw-bold {
    color: var(--secondary);
    margin: 0 0 8px 0;
    font-size: 14px;
}

.reviews-actions,
.reviews-actions-modern {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}

.btn-view-all,
.btn-write-review-modern {
    padding: 14px 35px;
    border-radius: 25px;
    font: 500 15px inherit;
    cursor: pointer;
    transition: var(--transition);
    min-width: 180px;
    border: 1px solid;
}

.btn-view-all {
    background: var(--bg);
    color: var(--text);
    border-color: #ccc;
}

.btn-view-all:hover {
    background: var(--bg-light);
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-write-review-modern {
    background: var(--secondary);
    color: var(--bg);
    border-color: var(--secondary);
}

.btn-write-review-modern:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Pagination */
.reviews-pagination {
    display: flex;
    justify-content: flex-start;
}

.reviews-pagination .page-link {
    color: var(--primary);
    border-color: var(--border);
    padding: 8px 16px;
    transition: var(--transition);
}

.reviews-pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.reviews-pagination .page-link:hover {
    background: #ffde1f;
    border-color: #ffde1f;
    color: #000;
}

/* Form & Modal */
.review-form-section {
    background: var(--bg);
    padding: 25px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
}

.review-form-section h4 {
    color: var(--text);
    margin-bottom: 25px;
    font: 700 20px inherit;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase;
}

.review-form .form-group {
    margin-bottom: 25px;
}

.review-form label {
    display: block;
    margin: 0 0 10px 0;
    color: var(--text);
    font: 600 15px inherit;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 10px;
    padding: 15px;
    background: var(--bg-light);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    cursor: pointer;
    font-size: 32px;
    color: #ddd;
    transition: var(--transition);
    margin: 0;
    padding: 5px;
    line-height: 1;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input[type="radio"]:checked ~ label,
.rating-input input[type="radio"]:checked ~ label ~ label {
    color: #ffc107;
}

.rating-input input[type="radio"]:checked ~ label {
    transform: scale(1.15);
}

.review-form .form-control {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    padding: 12px 15px;
    font: 14px "Montserrat", sans-serif;
    background: #f2f2f2;
    transition: var(--transition);
}

.review-form .form-control:hover,
.review-form .form-control:focus {
    background: var(--bg);
    border-color: var(--primary);
    outline: none;
}

.review-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 133, 0, 0.1);
}

.review-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.review-form .btn-primary {
    background: #fd6e1d;
    border: none;
    padding: 12px 30px;
    font: 600 15px inherit;
    color: var(--bg);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 160px;
}

.review-form .btn-primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 133, 0, 0.3);
}

/* Loading & Modal */
.review-loading {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    background: rgba(0, 0, 0, 0.6);
}

.review-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: var(--bg);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 250px;
}

.loader {
    margin: 0 auto;
    width: 25px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(farthest-side, #ffa516 94%, #0000) top/8px 8px
            no-repeat,
        conic-gradient(#0000 30%, #ffa516);
    -webkit-mask: radial-gradient(
        farthest-side,
        #0000 calc(100% - 8px),
        #000 0
    );
    animation: l13 1s infinite linear;
}

@keyframes l13 {
    100% {
        transform: rotate(1turn);
    }
}

.review-loading-text {
    margin-top: 15px;
    color: var(--text);
    font: 500 16px inherit;
}

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.review-modal.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.review-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.review-modal-container {
    position: relative;
    max-width: 50%;
    margin: 40px auto;
    padding: 0 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.review-modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.review-modal-header {
    border-bottom: 1px solid #ccc;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-modal-title {
    font: 700 20px inherit;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    display: inline-block;
}

.review-modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-modal-close:hover {
    color: var(--text);
    background: #f0f0f0;
}

.review-modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.review-form-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Images & Empty State */
.review-images-upload input[type="file"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f2f2f2;
    cursor: pointer;
    transition: var(--transition);
}

.review-images-upload input[type="file"]:hover {
    background: var(--bg);
    border-color: rgba(255, 133, 0, 0.5);
}

.review-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.review-image-preview-item,
.review-image-item {
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: var(--transition);
}

.review-image-preview-item {
    position: relative;
}

.review-image-item {
    width: 120px;
    height: 120px;
    border-width: 1px;
    border-color: #e0e0e0;
}

.review-image-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.review-image-preview-item img,
.review-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-image-preview-item .review-image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.review-image-preview-item .review-image-remove:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.reviews-empty-modern {
    text-align: left;
    padding: 50px 30px;
    color: var(--text-light);
}

.reviews-empty-modern i {
    font-size: 56px;
    margin-bottom: 20px;
    color: #ddd;
}

.reviews-empty-modern h4 {
    color: var(--text);
    margin-bottom: 10px;
    font: 600 18px inherit;
}

.reviews-empty-modern p {
    margin-bottom: 0;
    font: 15px/1.5 inherit;
}

.review-pagination-container {
    display: flex;
    align-items: center;
}

.review-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.review-comment {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.review-author {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.review-usage {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 767px) {
    .product-reviews-section {
        padding: 15px;
    }

    .reviews-summary-modern {
        flex-direction: column;
        gap: 20px;
    }

    .rating-overview-left {
        text-align: left;
        min-width: auto;
        padding-right: 0;
    }

    .score-number {
        font: 700 56px/1 inherit;
    }

    .reviews-actions-modern {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-view-all,
    .btn-write-review-modern {
        min-width: 200px;
    }

    .review-item {
        padding: 15px;
    }

    .rating-input {
        gap: 8px;
    }

    .rating-input label {
        font-size: 28px;
    }

    .review-image-preview-item {
        width: 80px;
        height: 80px;
    }

    .review-image-item {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 575px) {
    .rating-bar-modern {
        gap: 8px;
    }

    .percentage-label {
        font: 500 12px inherit;
        min-width: 30px;
    }

    .reviews-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .reviews-product-title {
        font: 600 16px/1 inherit;
    }
}
