/**
 * WOM Customer Images Styling
 *
 * Styles for customer images carousel/slider and modal viewer
 *
 * @package WOM_Reviews
 * @version 1.0.0
 */

/* Customer Images Section - Premium Elegant Design */
.wom-customer-images-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #F8FDFC 0%, #EDF8F6 50%, #E5F5F1 100%);
    border-radius: 16px;
    border: 1px solid rgba(27, 122, 104, 0.08);
    box-shadow: 0 4px 20px rgba(27, 122, 104, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Decorative corner accent */
.wom-customer-images-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top right, rgba(37, 201, 182, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.wom-customer-images-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at bottom left, rgba(27, 122, 104, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.wom-customer-images-title {
    color: #1B7A68;
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 1.25rem;
    z-index: 1;
}

/* Elegant underline with gradient */
.wom-customer-images-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #1B7A68 20%, #25C9B6 50%, #1B7A68 80%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(37, 201, 182, 0.3);
}

@media (min-width: 768px) {
    .wom-customer-images-title {
        font-size: 1.75rem;
        letter-spacing: 1px;
    }

    .wom-customer-images-title::after {
        width: 100px;
        height: 4px;
    }
}

.wom-images-container {
    position: relative;
    max-width: 64rem;
    margin: 0 auto;
    z-index: 1;
}

.kitchen-jar-slide {
    flex: 0 0 auto;
    padding-right: 16px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.kitchen-jar-slide:hover {
    transform: scale(1.02);
}

/* Kitchen Jars Slider Container */
.kitchen-jars-container {
    position: relative;
    padding: 0 40px;
    overflow: hidden;
}

.kitchen-jars-wrapper {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

/* Navigation Buttons - Elegant Premium Style */
.kitchen-jars-prev,
.kitchen-jars-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    color: #1B7A68;
    border: 2px solid rgba(27, 122, 104, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
                0 2px 4px rgba(27, 122, 104, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.kitchen-jars-prev svg,
.kitchen-jars-next svg {
    width: 14px;
    height: 14px;
    fill: #1B7A68;
    transition: all 0.3s ease;
}

.kitchen-jars-prev:hover:not(.disabled),
.kitchen-jars-next:hover:not(.disabled) {
    background: linear-gradient(135deg, #1B7A68 0%, #25C9B6 100%);
    border-color: transparent;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 20px rgba(27, 122, 104, 0.3),
                0 4px 8px rgba(37, 201, 182, 0.2);
}

.kitchen-jars-prev:hover:not(.disabled) svg,
.kitchen-jars-next:hover:not(.disabled) svg {
    fill: white;
}

.kitchen-jars-prev.disabled,
.kitchen-jars-next.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.kitchen-jars-prev {
    left: -12px;
}

.kitchen-jars-next {
    right: -12px;
}

.kitchen-jars-container {
    padding: 0 24px;
}

/* Customer Image Items */
.customer-image-item {
    cursor: pointer;
    display: block;
}

.customer-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
                0 2px 4px rgba(27, 122, 104, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: white;
}

.customer-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 201, 182, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.customer-image-wrapper:hover {
    box-shadow: 0 12px 32px rgba(27, 122, 104, 0.15),
                0 4px 12px rgba(37, 201, 182, 0.2);
    transform: translateY(-8px) scale(1.02);
    border-color: #25C9B6;
}

.customer-image-wrapper:hover::before {
    opacity: 1;
}

.customer-thumb-img {
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
    background-size: cover;
    background-position: center;
}

/* Use background-image for proper aspect ratio */
.customer-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

.customer-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

@media (min-width: 640px) {
    .customer-image-wrapper {
        padding-bottom: 100%; /* 1:1 aspect ratio on larger screens */
    }
}

.customer-image-item:hover .customer-thumb-img {
    opacity: 0;
}

/* Text Overlay - Elegant Design */
.customer-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(27, 122, 104, 0.95) 0%, rgba(21, 107, 90, 0.98) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2;
}

.customer-image-item:hover .customer-image-overlay {
    opacity: 1;
}

.customer-overlay-content {
    text-align: center;
    color: white;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.customer-image-item:hover .customer-overlay-content {
    transform: translateY(0);
}

.customer-overlay-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

@media (min-width: 640px) {
    .customer-overlay-name {
        font-size: 1.25rem;
    }
}

.customer-overlay-location {
    font-size: 0.9375rem;
    color: #E8F8F4;
    margin-bottom: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@media (min-width: 640px) {
    .customer-overlay-location {
        font-size: 1rem;
    }
}

.customer-overlay-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.customer-overlay-stars i {
    font-style: normal;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
    font-weight: 900 !important;
    display: inline-block;
    line-height: 1;
    color: #F8D214;
    font-size: 1.125rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: starPulse 2s ease-in-out infinite;
}

.customer-overlay-stars i:nth-child(1) { animation-delay: 0s; }
.customer-overlay-stars i:nth-child(2) { animation-delay: 0.1s; }
.customer-overlay-stars i:nth-child(3) { animation-delay: 0.2s; }
.customer-overlay-stars i:nth-child(4) { animation-delay: 0.3s; }
.customer-overlay-stars i:nth-child(5) { animation-delay: 0.4s; }

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.customer-overlay-stars .fa-star::before {
    content: "\f005" !important;
}

/* Image Modal */
.wom-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wom-image-modal.hidden {
    display: none !important;
}

/* Modal Container */
.wom-image-modal > div,
#review-image-modal > div {
    position: relative !important;
    max-width: 700px !important;
    width: 90% !important;
    max-height: 85vh !important;
    background: white !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    overflow-y: auto !important;
}

/* Close Button */
#close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#close-modal:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* Modal Header */
.wom-modal-header {
    background: linear-gradient(135deg, #1B7A68 0%, #156B5A 100%);
    color: white;
    padding: 1.5rem;
}

.wom-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #F8D214 !important;
}

.wom-modal-header > div {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.wom-modal-header #modal-rating-stars {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.wom-modal-header #modal-rating-stars i {
    font-style: normal;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
    font-weight: 900 !important;
    display: inline-block;
    line-height: 1;
}

.wom-modal-header #modal-rating-stars .fa-star::before {
    content: "\f005" !important;
}

.wom-modal-header #modal-rating-stars .far::before {
    font-weight: 400 !important;
}

.wom-modal-header span {
    color: #e5e7eb;
    font-size: 0.875rem;
}

/* Modal Image Container */
.bg-gray-100 {
    background-color: #f3f4f6;
}

.wom-image-modal .relative.bg-gray-100,
#review-image-modal .relative.bg-gray-100 {
    position: relative !important;
    background-color: #f3f4f6 !important;
    min-height: 200px !important;
    max-height: 55vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#modal-image {
    width: 100% !important;
    height: auto !important;
    max-height: 50vh !important;
    max-width: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Image Navigation Buttons */
#prev-image,
#next-image {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

#prev-image:hover,
#next-image:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

#prev-image {
    left: 1rem;
}

#next-image {
    right: 1rem;
}

@media (max-width: 768px) {
    .wom-image-modal > div,
    #review-image-modal > div {
        max-width: 90% !important;
        width: 90% !important;
        max-height: 80vh !important;
    }

    #modal-image {
        max-height: 40vh !important;
    }

    .wom-image-modal .relative.bg-gray-100,
    #review-image-modal .relative.bg-gray-100 {
        max-height: 45vh !important;
    }

    #prev-image,
    #next-image {
        width: 2rem !important;
        height: 2rem !important;
    }
}

/* Image Counter */
#image-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Review Text Section */
.wom-image-modal .p-6 {
    padding: 1.5rem;
}

#modal-review-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

#modal-review-text {
    color: #374151;
    line-height: 1.625;
    margin: 0;
}

/* Rating bars clean design */
.rating-bar-container {
    margin-bottom: 8px !important;
}

.rating-bar-bg {
    background-color: #e5e7eb !important;
    border-radius: 9999px !important;
    height: 12px !important;
    overflow: hidden !important;
    position: relative !important;
}

.rating-bar-fill {
    background-color: #1b7a68 !important;
    height: 100% !important;
    border-radius: 9999px !important;
    transition: width 0.7s ease-out !important;
    width: 0% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    display: block !important;
    min-height: 12px !important;
}

.rating-percentage {
    color: #6b7280 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-align: right !important;
    width: 3rem !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    /* Make images smaller on mobile */
    .customer-image-wrapper {
        padding-bottom: 100% !important; /* Square aspect ratio on mobile */
        max-height: 200px; /* Limit height */
    }

    .wom-customer-images-section {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .wom-customer-images-title {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
        letter-spacing: 0.3px;
        padding-bottom: 0.75rem;
    }

    .wom-customer-images-title::after {
        width: 60px;
        height: 2.5px;
    }

    .kitchen-jars-prev,
    .kitchen-jars-next {
        width: 32px;
        height: 32px;
    }

    .kitchen-jars-prev svg,
    .kitchen-jars-next svg {
        width: 10px;
        height: 10px;
    }

    .kitchen-jars-container {
        padding: 0 20px;
        overflow-x: auto; /* Allow horizontal scroll */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .kitchen-jar-slide {
        padding-right: 8px; /* Reduce gap on mobile */
    }

    /* Smaller hover effects on mobile */
    .customer-image-wrapper:hover {
        transform: translateY(-2px);
    }

    .kitchen-jars-prev {
        left: -8px;
    }

    .kitchen-jars-next {
        right: -8px;
    }
}

/* Extra small mobile devices - smaller modal images */
@media (max-width: 480px) {
    .wom-image-modal > div,
    #review-image-modal > div {
        max-width: 95% !important;
        width: 95% !important;
        max-height: 75vh !important;
    }

    #modal-image {
        max-height: 35vh !important;
    }

    .wom-image-modal .relative.bg-gray-100,
    #review-image-modal .relative.bg-gray-100 {
        max-height: 38vh !important;
        min-height: 150px !important;
    }

    #prev-image,
    #next-image {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }

    #close-modal {
        width: 2rem !important;
        height: 2rem !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
    }
}

/* Utility classes */
.relative {
    position: relative;
}

.hidden {
    display: none;
}

/* Hide empty star containers and pagination */
#modal-rating-stars:empty,
.customer-overlay-stars:empty,
#customer-images-pagination {
    display: none !important;
}

/* Ensure Font Awesome loads properly */
.fa, .fas, .far, .fal, .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
}
