﻿/* Tải Font Awesome 5 (Nếu chưa có) */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* Cần thêm thư viện Tailwind CSS trong file HTML chính để các class như flex, p-4 hoạt động */

.product-review-container {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
}

.review-title {
    font-size: 18px;
    font-weight: 550;
    margin-bottom: 20px;
    color: #333;
}

/* --- Review Summary Section --- */
.review-summary-section {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng trên mobile */
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.summary-left {
    flex: 0 0 auto; /* Không co giãn */
    width: 150px; /* Độ rộng cố định */
    text-align: center;
    border-right: 1px solid #eee; /* Đường kẻ phân cách */
    padding-right: 20px;
}

@media (max-width: 768px) {
    .summary-left {
        width: 100%;
        border-right: none;
        padding-right: 0;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
    }
}

.overall-rating .rating-score {
    font-size: 48px;
    font-weight: bold;
    color: #ffc107; /* Màu vàng sao */
    line-height: 1;
}

.overall-rating .stars-display {
    margin: 5px 0;
}

    .overall-rating .stars-display .fa-star,
    .overall-rating .stars-display .fa-star-half-alt {
        color: #e0e0e0; /* Màu sao chưa filled */
        font-size: 18px;
    }

    .overall-rating .stars-display .filled {
        color: #ffc107; /* Màu sao đã filled */
    }

.overall-rating .happy-customers {
    display: block;
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.overall-rating .total-reviews {
    display: block;
    font-size: 14px;
    color: #888;
    margin-top: 2px;
}

.summary-right {
    flex-grow: 1; /* Chiếm hết không gian còn lại */
    padding-left: 20px;
}

@media (max-width: 768px) {
    .summary-right {
        padding-left: 0;
        margin-bottom: 20px;
    }
}

.rating-breakdown .rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.rating-breakdown .rating-label {
    width: 30px; /* Kích thước cố định cho số sao */
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .rating-breakdown .rating-label .fa-star {
        font-size: 12px;
        color: #ffc107;
    }

.rating-breakdown .progress-bar-wrapper {
    flex-grow: 1;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden; /* Đảm bảo thanh progress không tràn ra */
}

.rating-breakdown .progress-bar {
    height: 100%;
    background-color: #ffc107;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.rating-breakdown .rating-percent {
    font-size: 14px;
    color: #555;
    width: 50px; /* Kích thước cố định cho phần trăm */
    text-align: right;
}

.summary-gallery {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng nếu nhiều ảnh */
    gap: 8px;
    margin-top: 15px; /* Khoảng cách từ phần thống kê sao */
    width: 100%; /* Đảm bảo chiếm hết chiều rộng */
}

    .summary-gallery .gallery-item {
        width: 70px; /* Kích thước của mỗi ảnh nhỏ */
        height: 70px;
        border-radius: 6px;
        overflow: hidden;
        cursor: pointer;
        border: 1px solid #eee;
        box-sizing: border-box; /* Đảm bảo border không làm tăng kích thước */
    }

        .summary-gallery .gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover; /* Đảm bảo ảnh đầy đủ khung */
        }

    .summary-gallery .view-more-photos {
        background-color: #f0f2f5;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: #007bff;
        text-align: center;
        line-height: 1.2;
        cursor: pointer;
        font-weight: bold;
        border: 1px dashed #ccc;
    }


/* --- Review List --- */
.user-review-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

    .user-review-item:last-child {
        border-bottom: none; /* Không có đường kẻ dưới cho review cuối cùng */
    }

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

    .user-info .user-name {
        font-weight: bold;
        color: #333;
        font-size: 16px;
        margin-right: 10px;
    }

    .user-info .verified-purchase {
        font-size: 13px;
        color: #007bff; /* Màu xanh của DMX/Đã mua */
        display: flex;
        align-items: center;
    }

        .user-info .verified-purchase .fa-check-circle {
            margin-right: 5px;
        }

.review-stars {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

    .review-stars .fa-star,
    .review-stars .fa-star-half-alt {
        color: #e0e0e0;
        font-size: 16px;
        margin-right: 2px;
    }

    .review-stars .filled {
        color: #ffc107;
    }

    .review-stars .recommend-text {
        font-size: 13px;
        color: #888;
        margin-left: 10px;
        display: flex;
        align-items: center;
    }

        .review-stars .recommend-text .fa-heart {
            color: #dc3545; /* Màu đỏ của icon trái tim */
            margin-right: 5px;
        }
.star-rating-options .star-icon svg {
    /* Đảm bảo SVG không bị lỗi màu */
    fill: currentColor;
}

.star-rating-options .star-icon {
    color: #e0e0e0; /* Màu mặc định: Xám */
}

    /* Khi đã chọn hoặc đang hover, đổi màu thành vàng */
    .star-rating-options .star-icon.hovered,
    .star-rating-options .star-icon.selected {
        color: #ffc107; /* Màu vàng sao đã chọn */
    }
.review-content {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.review-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 15px;
    align-items: center;
}

    .review-meta .helpful-vote {
        cursor: pointer;
        display: flex;
        align-items: center;
    }

        .review-meta .helpful-vote .far.fa-thumbs-up {
            margin-right: 5px;
        }

        .review-meta .helpful-vote:hover {
            color: #007bff;
        }

/* --- Review Actions --- */
.review-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}


.btn-view-all {
    background-color: #fff;
    color: #007bff;
    border: 1px solid #007bff;
}

    .btn-view-all:hover {
        background-color: #e6f2ff;
    }

.btn-write-review {
    background-color: #007bff;
    color: #fff;
}

    .btn-write-review:hover {
        background-color: #0056b3;
    }
/* --- Modal Styles --- */
.modalrv {
    display: none; /* Ẩn modal theo mặc định */
    position: fixed; /* Luôn ở trên cùng */
    z-index: 1000; /* Đảm bảo modal nằm trên các phần tử khác */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Cho phép cuộn nếu nội dung dài */
    background-color: rgba(0,0,0,0.6); /* Nền overlay đen mờ */
    display: flex; /* Dùng flexbox để căn giữa modal-content */
    justify-content: center;
    align-items: center;
}

.modal-contentrv {
    background-color: #fff;
    margin: auto;
    padding: 25px;
    border-radius: 10px;
    position: relative;
    width: 90%;
    max-width: 500px; /* Chiều rộng tối đa */
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transform: translateY(20px); /* Hiệu ứng mở modal */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.modalrv.show .modal-contentrv {
    transform: translateY(0);
    opacity: 1;
}

.close-buttonrv {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
}

    .close-buttonrv:hover,
    .close-buttonrv:focus {
        color: #333;
        text-decoration: none;
    }

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 25px;
}

.modal-product-info {
    text-align: center;
    margin-bottom: 25px;
}

.modal-product-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
}

.modal-product-name {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    text-align:left;
}

.modal-rating-selection {
    text-align: center;
    margin-bottom: 25px;
}

.star-rating-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

    .star-rating-options .star-icon {
        font-size: 36px;
        color: #e0e0e0; /* Màu sao chưa chọn */
        cursor: pointer;
        transition: color 0.2s ease;
    }

        .star-rating-options .star-icon:hover,
        .star-rating-options .star-icon.hovered {
            color: #ffc107; /* Màu khi hover */
        }

        .star-rating-options .star-icon.selected {
            color: #ffc107; /* Màu sao đã chọn */
        }

.rating-text-options {
    display: flex;
    justify-content: center;
    gap: 0px;
    font-size: 14px;
    color: #888;
}

    .rating-text-options span {
        width: 60px; /* Đảm bảo các text rating cùng chiều rộng */
        text-align: center;
    }

        .rating-text-options span.selected {
            font-weight: bold;
            color: #333; /* Màu chữ rating khi chọn */
        }


/* --- Expanded Form --- */
.expanded-review-form {
    display: none; /* Ẩn theo mặc định */
    animation: fadeIn 0.5s ease-out; /* Hiệu ứng fade-in */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-textarea {
    width: calc(100% - 20px);
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    resize: vertical; /* Cho phép đổi kích thước chiều dọc */
    margin-bottom: 15px;
}

/* Custom Checkbox (Sẽ giới thiệu SP) */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .checkbox-container input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #007bff;
    border-color: #007bff;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

/* Upload Photo Button */
.upload-photo-btn {
    display: inline-flex; /* Để icon và text trên cùng 1 hàng */
    align-items: center;
    background-color: #e0f7fa; /* Màu xanh nhạt */
    color: #00838f; /* Màu chữ xanh đậm */
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    border: 1px dashed #00838f;
    transition: background-color 0.2s ease;
}

    .upload-photo-btn:hover {
        background-color: #b2ebf2;
    }

    .upload-photo-btn .fas.fa-camera {
        margin-right: 8px;
    }

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-field {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.privacy-consent {
    margin-bottom: 20px;
}

    .privacy-consent a {
        color: #007bff;
        text-decoration: none;
    }

        .privacy-consent a:hover {
            text-decoration: underline;
        }

.btn-submit-review {
    width: 100%;
    background-color: #7abaff; /* Màu xanh nhạt hơn khi chưa chọn sao */
    color: #fff;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 6px;
    cursor: not-allowed; /* Mặc định là không cho phép bấm */
    opacity: 0.7;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    border: none;
}

    .btn-submit-review.active {
        background-color: #007bff; /* Màu xanh đậm khi active */
        cursor: pointer;
        opacity: 1;
    }

        .btn-submit-review.active:hover {
            background-color: #0056b3;
        }

.policy-links {
    text-align: center;
    font-size: 12px;
    margin-top: 15px;
}

    .policy-links a {
        color: #888;
        text-decoration: none;
    }

        .policy-links a:hover {
            text-decoration: underline;
        }


/* --- Modal 1: GALLERY INDEX --- */
.photo-gallery-modal .modal-content {
    max-width: 900px;
    height: 90%;
    padding: 20px;
}

.gallery-index-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: left;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filter-btn {
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #f9f9f9;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

    .filter-btn.active {
        background-color: #007bff;
        color: #fff;
        border-color: #007bff;
    }

.gallery-content-area {
    overflow-y: auto;
    max-height: calc(100% - 100px); /* Điều chỉnh chiều cao để cuộn */
}

    .gallery-content-area img {
        width: 150px;
        height: 150px;
        object-fit: cover;
        border-radius: 8px;
        cursor: pointer;
        margin: 5px;
    }

    .gallery-content-area .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

        .gallery-content-area .grid img {
            width: 100%;
            height: 100%;
        }


/* --- Modal 2: LARGE PHOTO VIEWER --- */
.large-photo-viewer .modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 1200px;
    padding: 0; /* Loại bỏ padding để ảnh chiếm hết không gian */
}

.view-all-photos-link {
    position: absolute;
    top: 15px;
    left: 20px;
    color: #fff; /* Màu trắng trên nền tối */
    font-size: 14px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
}

    .view-all-photos-link .fa-arrow-left {
        margin-right: 5px;
    }

.photo-viewer-wrapper {
    display: flex;
    height: 100%;
    min-height: 600px;
}

.viewer-photo-area {
    flex: 2; /* Chiếm 2/3 không gian */
    background-color: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

    .viewer-photo-area img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain; /* Đảm bảo ảnh không bị cắt */
    }

.viewer-info-area {
    flex: 1; /* Chiếm 1/3 không gian */
    padding: 30px;
    background-color: #fff;
    overflow-y: auto;
}

/* Navigation Buttons */
.viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 10px;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
    user-select: none;
}

    .viewer-nav-btn:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    .viewer-nav-btn.prev {
        left: 0;
        border-radius: 0 5px 5px 0;
    }

    .viewer-nav-btn.next {
        right: 0;
        border-radius: 5px 0 0 5px;
    }

/* Info Area Details */
.reviewer-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.reviewer-name {
    font-weight: bold;
    margin-right: 10px;
}

.review-details {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.review-stars-viewer {
    margin-bottom: 5px;
}

.review-text {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}