.image-preview-for-acf-field-help {
    display: inline-block;
    align-items: center;
    margin-left: 8px;
    cursor: pointer;
    font-size: 15px;
    line-height: 17px;
    vertical-align: middle;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 17px;
    height: 17px;
    color: #2271b1;
    border: 1px solid #2271b1;
    background: #f6f7f7;
    text-align: center;
}

.image-preview-for-acf-field-help:hover {
    color: #FFFFFF;
    background-color: #2271b1;
}

/* Style for the field label and instructions container */
.acf-field .acf-label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.acf-field .acf-label label {
    display: inline-block;
    margin: 0;
    padding: 0;
    margin-right: 5px;
}

.acf-field .acf-label .acf-instructions {
    flex-basis: 100%;
    margin-left: 0;
}

.image-preview-for-acf-field-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    /* display: flex is applied by JavaScript when shown */
    justify-content: center;
    align-items: center;
}

.image-preview-for-acf-field-modal.is-visible {
    display: flex; /* Show as flex when active */
}

.image-preview-for-acf-field-modal-content {
    position: relative;
    background-color: #fff;
    margin: 0;
    padding: 20px;
    width: 90%;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.image-preview-for-acf-field-modal-close {
    position: absolute;
    right: -10px;
    top: -10px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    background-color: #e74c3c;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.image-preview-for-acf-field-modal-close:hover {
    background-color: #c0392b;
}

.image-preview-for-acf-field-modal-image {
    max-width: 100%;
    max-height: calc(90vh - 40px);
    display: block;
    margin: 0 auto;
}

/* CSS to hide body overflow when modal is open */
body.image-preview-for-acf-field-modal-open {
    overflow: hidden;
}

/* Modal Sizes */
.image-preview-for-acf-field-modal-content.modal-small {
    width: 400px;
    max-width: 90vw;
}
.image-preview-for-acf-field-modal-content.modal-medium {
    width: 600px;
    max-width: 90vw;
}
.image-preview-for-acf-field-modal-content.modal-large {
    width: 900px;
    max-width: 90vw;
}
.image-preview-for-acf-field-modal-content.modal-full {
    width: 95vw;
    height: 95vh;
    max-width: none;
}
.modal-full .image-preview-for-acf-field-modal-image {
    max-height: calc(95vh - 40px);
}
.modal-full .video-container iframe,
.modal-full video {
    height: calc(95vh - 40px);
}

/* Video Container for 16:9 Aspect Ratio */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    width: 100%;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tooltip Styles */
.image-preview-for-acf-field-tooltip {
    display: none;
    position: absolute;
    z-index: 999999;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid #ccd0d4;
    width: 300px;
}
.image-preview-for-acf-field-tooltip.is-visible {
    display: block;
}
.image-preview-for-acf-field-tooltip .image-preview-for-acf-field-media-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Custom Image/GIF Icon */
.image-preview-for-acf-field-custom-img-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    vertical-align: top;
    display: block;
}

/* Gallery Slider */
.imagprfo-gallery-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.imagprfo-gallery-slides {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
}

.imagprfo-gallery-slide {
    min-width: 100%;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagprfo-gallery-slide img {
    max-width: 100%;
    max-height: calc(90vh - 40px);
    object-fit: contain;
}
.modal-full .imagprfo-gallery-slide img {
    max-height: calc(95vh - 40px);
}

.imagprfo-gallery-prev,
.imagprfo-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
    transition: background 0.3s;
    z-index: 10;
}

.imagprfo-gallery-prev:hover,
.imagprfo-gallery-next:hover {
    background: rgba(0,0,0,0.8);
}

.imagprfo-gallery-prev {
    left: 10px;
}

.imagprfo-gallery-next {
    right: 10px;
}