/* Enhanced review image upload section */
.review-image-upload {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ebebeb;
    border-radius: 6px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.review-image-upload:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.review-image-upload label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.review-image-upload label + label {
    font-weight: 400;
    color: #666;
    font-size: 12px;
    margin-bottom: 12px;
}

.review-image-input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    background-color: #fff;
    border: 1px dashed #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-image-input:hover {
    border-color: #f58c0d;
    background-color: rgba(245, 140, 13, 0.03);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    display: inline-block;
    border-radius: 6px;
    overflow: hidden;
    width: 80px;
    height: 80px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.image-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.remove-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    z-index: 5;
}

.image-preview:hover .remove-preview {
    opacity: 1;
}

.remove-preview:hover {
    background-color: #e72c45;
    transform: scale(1.1);
}

body.rtl .remove-preview {
    right: auto;
    left: 4px;
}

.review-error-inline {
    margin-top: 12px;
    color: #d63638;
    background-color: #ffebe8;
    border: 1px solid #d63638;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.review-error-inline .error-message {
    font-weight: 500;
}

/* Enhanced modal and image styles */
.mpr-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.8);
}

.mpr-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    top: 50%;
    transform: translateY(-50%);
}

.mpr-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.mpr-modal-img {
    display: block;
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    background-color: #fff;
}

body.rtl .mpr-modal-close {
    right: auto;
    left: 0;
}

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

.review-image-item {
    cursor: pointer;
    display: inline-block;
    margin: 5px;
    border: 1px solid #eee;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.review-image-item:hover {
    border-color: #000;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.review-image-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    pointer-events: none;
}

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

/* Existing images container styles */
.existing-images-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.existing-images-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.existing-images-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.existing-image-item {
    width: 80px;
    height: 80px;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.existing-image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #f58c0d;
}

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

.existing-image-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.remove-existing-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    z-index: 5;
}

.remove-existing-image:hover {
    background-color: #e72c45;
    transform: scale(1.1);
    opacity: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
    .review-image-upload {
        padding: 12px;
        margin-top: 15px;
    }
    
    .image-preview-container {
        gap: 8px;
    }
    
    .image-preview {
        width: 60px;
        height: 60px;
    }
    
    .remove-preview {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
    
    .existing-image-item {
        width: 60px;
        height: 60px;
    }
    
    .remove-existing-image {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
}

/* Admin-specific styles */
.post-type-product .mpr-label-wrap .review-image-upload,
#mpr-rating-section .review-image-upload {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fafafa;
}

#mpr-rating-section .existing-images-container {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

#mpr-rating-section .existing-images-container h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    color: #23282d;
    font-weight: 600;
}

#mpr-rating-section .existing-images-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#mpr-rating-section .existing-image-item {
    width: 60px;
    height: 60px;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#mpr-rating-section .existing-image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

#mpr-rating-section .existing-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#mpr-rating-section .existing-image-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

#mpr-rating-section .remove-existing-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: rgba(220, 53, 69, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    z-index: 5;
}

#mpr-rating-section .remove-existing-image:hover {
    background-color: #dc3545;
    transform: scale(1.1);
    opacity: 1;
}

#mpr-rating-section .review-image-input {
    width: 100%;
    padding: 6px;
    margin: 8px 0;
    background-color: #fff;
    border: 1px dashed #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

#mpr-rating-section .review-image-input:hover {
    border-color: #0073aa;
    background-color: rgba(0, 115, 170, 0.03);
}

#mpr-rating-section .image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#mpr-rating-section .image-preview {
    position: relative;
    display: inline-block;
    border-radius: 3px;
    overflow: hidden;
    width: 60px;
    height: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

#mpr-rating-section .image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#mpr-rating-section .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#mpr-rating-section .remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: rgba(220, 53, 69, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    z-index: 5;
}

#mpr-rating-section .image-preview:hover .remove-preview {
    opacity: 1;
}

#mpr-rating-section .remove-preview:hover {
    background-color: #dc3545;
    transform: scale(1.1);
}

#mpr-rating-section .description {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Admin form styling improvements */
#mpr-rating-section .acf-label label {
    font-weight: 600;
    color: #23282d;
}

#mpr-rating-section .acf-input {
    margin-top: 5px;
}

/* Error styling for admin */
#mpr-rating-section .review-image-input.error {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

#mpr-rating-section .error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
    display: block;
}

/* Disabled state for remove buttons */
.remove-existing-image.disabled,
.remove-existing-image:disabled,
#mpr-rating-section .remove-existing-image.disabled,
#mpr-rating-section .remove-existing-image:disabled {
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

.remove-existing-image.disabled:hover,
.remove-existing-image:disabled:hover,
#mpr-rating-section .remove-existing-image.disabled:hover,
#mpr-rating-section .remove-existing-image:disabled:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
    opacity: 0.5 !important;
}

/* Disabled state for image preview remove buttons */
.remove-preview.disabled,
.remove-preview:disabled,
#mpr-rating-section .remove-preview.disabled,
#mpr-rating-section .remove-preview:disabled {
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

.remove-preview.disabled:hover,
.remove-preview:disabled:hover,
#mpr-rating-section .remove-preview.disabled:hover,
#mpr-rating-section .remove-preview:disabled:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
    opacity: 0.5 !important;
}

/* Visual indicator for disabled functionality */
.existing-images-container.disabled-functionality {
    position: relative;
    opacity: 0.6;
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
    pointer-events: none;
}

.existing-images-container.disabled-functionality::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(200, 200, 200, 0.7);
    pointer-events: none;
    border-radius: 5px;
    z-index: 10;
}

.existing-images-container.disabled-functionality::before {
    content: 'DISABLED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(128, 128, 128, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    z-index: 11;
    pointer-events: none;
    letter-spacing: 1px;
}

.existing-images-container.disabled-functionality h4 {
    color: #888 !important;
}

.existing-images-container.disabled-functionality .existing-image-item {
    opacity: 0.7;
    filter: grayscale(30%);
}

.existing-images-container.disabled-functionality .existing-image-item img {
    opacity: 0.8;
}

.existing-images-container.disabled-functionality .description {
    color: #666 !important;
    font-weight: 500;
}

/* Admin-specific disabled styling */
#mpr-rating-section .existing-images-container.disabled-functionality {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    opacity: 0.7;
}

#mpr-rating-section .existing-images-container.disabled-functionality::after {
    background: rgba(180, 180, 180, 0.8);
}

#mpr-rating-section .existing-images-container.disabled-functionality::before {
    content: 'DISABLED';
    background: rgba(100, 100, 100, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
}

#mpr-rating-section .existing-images-container.disabled-functionality h4 {
    color: #777 !important;
}

#mpr-rating-section .existing-images-container.disabled-functionality .existing-image-item {
    border-color: #ccc !important;
    filter: grayscale(40%);
}

#mpr-rating-section .existing-images-container.disabled-functionality .existing-image-item:hover {
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    border-color: #ccc !important;
} 