/**
 * Reviews Pro Frontend CSS
 * 
 * Styling for the frontend display of reviews
 */

/* Reviews Grid Layout */
.reviews-pro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* For mobile horizontal scrolling */
.reviews-pro-grid.mobile-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 20px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.mobile-scroll .reviews-pro-item {
    flex: 0 0 280px;
    margin-right: 20px;
    scroll-snap-align: start;
}

/* Review Item */
.reviews-pro-item {
    background-color: #fafafa;
    padding: 10px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.reviews-pro-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* Review Photos */
.reviews-pro-photos {
    margin-bottom: 15px;
}

/*.reviews-pro-photo-gallery {*/
/*    display: flex;*/
/*    flex-wrap: nowrap;*/
/*    overflow-x: auto;*/
/*    gap: 10px;*/
/*    scroll-snap-type: x mandatory;*/
/*    -webkit-overflow-scrolling: touch;*/
/*}*/
.reviews-pro-photo-gallery {
    display: flex;
    overflow: hidden;
}
.reviews-pro-photos .reviews-pro-photo-gallery {
    position: relative;
    max-height: 420px;
}
.reviews-pro-photo-gallery span.reviews-pro-more-photos {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 0 5px;
    font-size: 14px;
}
.reviews-pro-photo-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    scroll-snap-align: start;
    cursor: pointer;
}

.reviews-pro-no-photo {
    width: 100%;
    height: 120px;
    background-color: #f7f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Section */
.reviews-pro-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.reviews-pro-user-photo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.reviews-pro-user-avatar {
    width: 40px;
    height: 40px;
    background-color: #f1f1f1;
    color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
}

.reviews-pro-user-name {
    font-weight: 600;
    font-size: 16px;
    position: relative;
}
.reviews-pro-user-name:after {
    content: "";
    position: absolute;
    top: 2px;
    right: -24px;
    height: 20px;
    width: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m9.023 21.23l-1.67-2.814l-3.176-.685l.312-3.277L2.346 12L4.49 9.546L4.177 6.27l3.177-.685L9.023 2.77L12 4.027l2.977-1.258l1.67 2.816l3.176.684l-.312 3.277L21.655 12l-2.142 2.454l.311 3.277l-3.177.684l-1.669 2.816L12 19.973zm1.927-6.372L15.908 9.9l-.708-.72l-4.25 4.25l-2.15-2.138l-.708.708z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m9.023 21.23l-1.67-2.814l-3.176-.685l.312-3.277L2.346 12L4.49 9.546L4.177 6.27l3.177-.685L9.023 2.77L12 4.027l2.977-1.258l1.67 2.816l3.176.684l-.312 3.277L21.655 12l-2.142 2.454l.311 3.277l-3.177.684l-1.669 2.816L12 19.973zm1.927-6.372L15.908 9.9l-.708-.72l-4.25 4.25l-2.15-2.138l-.708.708z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    background-color: #2592eb;
}

/* Rating Stars */
.reviews-pro-rating {
    margin-bottom: 15px;
}

.reviews-pro-rating .star {
    color: #ccc;
    font-size: 20px;
    margin-right: 2px;
}

.reviews-pro-rating .star.filled {
    color: #ffc107;
}

/* Review Text */
.reviews-pro-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}
.reviews-pro-text p{
    margin: 0;
}
/* Product Section */
.reviews-pro-product {
    display: flex;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.reviews-pro-product-image {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    flex-shrink: 0;
}

.reviews-pro-product-image img {
    width: 100%!important;
    height: 100%!important;
    object-fit: cover;
}

.reviews-pro-product-title {
    font-size: 14px;
    font-weight: 600;
}

/* Modal Styles */
.reviews-pro-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8.7px);
    -webkit-backdrop-filter: blur(8.7px);
}

.reviews-pro-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.reviews-pro-modal-content {
    position: relative;
    background-color: #fff;
    margin: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.reviews-pro-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #555;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.reviews-pro-close:hover {
    color: #000;
}

.reviews-pro-modal-body {
    display: flex;
    flex-direction: row;
    height: 100%;
    max-height: 90vh;
}

/* Modal Left Side - Gallery */
.reviews-pro-modal-left {
    flex: 2;
    background-color: #f7f7f7;
    position: relative;
    min-height: 300px;
    max-height: 90vh;
    overflow: hidden;
}

.reviews-pro-modal-gallery {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.reviews-pro-modal-gallery img {
    width: 100%;
    min-height: 580px;
    object-fit: cover;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
}

.gallery-nav button {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.gallery-nav button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.gallery-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.gallery-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.gallery-dots .dot.active {
    background-color: #fff;
}

/* Modal Right Side - Content */
.reviews-pro-modal-right {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.reviews-pro-modal-right .reviews-pro-user {
    margin-bottom: 20px;
}

.reviews-pro-modal-right .reviews-pro-user-photo img,
.reviews-pro-modal-right .reviews-pro-user-avatar {
    width: 50px;
    height: 50px;
    font-size: 22px;
}

.reviews-pro-modal-right .reviews-pro-user-name {
    font-size: 18px;
}

.reviews-pro-modal-right .reviews-pro-rating {
    margin-bottom: 25px;
}

.reviews-pro-modal-right .reviews-pro-rating .star {
    font-size: 24px;
}

.reviews-pro-modal-right .reviews-pro-text {
    max-height: none;
    overflow: visible;
    display: block;
    font-size: 15px;
    margin-bottom: 30px;
    -webkit-line-clamp: initial;
}

.reviews-pro-modal-right .reviews-pro-product {
    padding-bottom: 0px;
}

.reviews-pro-modal-right .reviews-pro-product-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.reviews-pro-modal-right .reviews-pro-product-title {
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.reviews-pro-shop-button {
    display: inline-block;
    background-color: var(--e-global-color-primary);
    color: white;
    padding: 8px 15px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background-color 0.2s ease;
}

.reviews-pro-shop-button:hover {
    background-color: var(--e-global-color-secondary);
    text-decoration: none;
    color: white;
}

/* Photo Popup */
.reviews-pro-photo-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reviews-pro-photo-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.reviews-pro-photo-popup-content img {
    max-width: 100%;
    max-height: 90vh;
    border: 5px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.reviews-pro-photo-popup-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}


/* Loading spinner container */
.reviews-pro-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

/* Loading spinner */
.reviews-pro-loading .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* When using thumbnail in grid, maintain consistent dimensions */
.reviews-pro-photo-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Modal Responsive Styles */
@media screen and (max-width: 768px) {
    .reviews-pro-modal-body {
        flex-direction: column;
        max-height: none;
    }
    
    .reviews-pro-modal-left {
        flex: 0 0 40vh;
    }
    
    .reviews-pro-modal-content {
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .reviews-pro-modal-right {
        padding: 20px;
    }
}

@media screen and (max-width: 480px) {
    .reviews-pro-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-pro-photo-popup-close {
        top: -30px;
        right: -10px;
    }
}

body.reviews-pro-modal-open {
    overflow: hidden;
}