/* Modern Magnific Popup Styling */
.mfp-bg {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1042;
    overflow: hidden;
    position: fixed;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(20, 20, 30, 0.9) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mfp-bg.mfp-ready {
    opacity: 1;
}

.mfp-bg.mfp-removing {
    opacity: 0;
}

.mfp-wrap {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1043;
    position: fixed;
    outline: 0 !important;
    -webkit-backface-visibility: hidden;
}

.mfp-container {
    text-align: center;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.mfp-container:before {
    content: "";
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.mfp-align-top .mfp-container:before {
    display: none;
}

.mfp-content {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 auto;
    text-align: left;
    z-index: 1045;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mfp-ready .mfp-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.mfp-removing .mfp-content {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

.mfp-ajax-holder .mfp-content,
.mfp-inline-holder .mfp-content {
    width: 100%;
    cursor: auto;
}

.mfp-ajax-cur {
    cursor: progress;
}

.mfp-zoom-out-cur,
.mfp-zoom-out-cur .mfp-image-holder .mfp-close {
    cursor: -moz-zoom-out;
    cursor: -webkit-zoom-out;
    cursor: zoom-out;
}

.mfp-zoom {
    cursor: pointer;
    cursor: -webkit-zoom-in;
    cursor: -moz-zoom-in;
    cursor: zoom-in;
}

.mfp-auto-cursor .mfp-content {
    cursor: auto;
}

.mfp-arrow,
.mfp-close,
.mfp-counter,
.mfp-preloader {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.mfp-loading.mfp-figure {
    display: none;
}

.mfp-hide {
    display: none !important;
}

.mfp-preloader {
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    text-align: center;
    z-index: 1044;
    font-size: 14px;
    font-weight: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.mfp-preloader::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 0.9;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.mfp-preloader a {
    color: rgba(255, 255, 255, 0.8);
}

.mfp-preloader a:hover {
    color: #fff;
}

.mfp-s-ready .mfp-preloader {
    display: none;
}

.mfp-s-error .mfp-content {
    display: none;
}

button.mfp-arrow,
button.mfp-close {
    overflow: visible;
    cursor: pointer;
    background: 0 0;
    border: 0;
    -webkit-appearance: none;
    display: block;
    outline: 0;
    padding: 0;
    z-index: 1046;
    box-shadow: none;
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button::-moz-focus-inner {
    padding: 0;
    border: 0;
}

/* Modern Close Button */
.mfp-close {
    width: 50px;
    height: 50px;
    line-height: 48px;
    position: absolute;
    right: 40px;
    top: 0px;
    text-decoration: none;
    text-align: center;
    opacity: 0;
    padding: 0;
    color: #fff;
    font-style: normal;
    font-size: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mfp-close:focus,
.mfp-close:hover {
    opacity: 1;
    transform: scale(1.1);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 100%
    );
}

.mfp-close:active {
    transform: scale(0.95);
}

.mfp-close-btn-in .mfp-close {
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mfp-iframe-holder .mfp-close,
.mfp-image-holder .mfp-close {
    color: #fff;
    right: 0px;
    text-align: center;
    padding-right: 0;
    width: 50px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Counter */
.mfp-counter {
    position: absolute;
    top: 0px;
    right: 0px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 18px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 300;
    animation: fadeInScale 0.5s 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Modern Arrow Buttons */
.mfp-arrow {
    position: absolute;
    opacity: 0;
    margin: 0;
    top: 50%;
    margin-top: -75px;
    padding: 0;
    width: 60px;
    height: 120px;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.5s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mfp-arrow:active {
    margin-top: -74px;
}

.mfp-arrow:focus,
.mfp-arrow:hover {
    opacity: 1;
    transform: scale(1.05);
}

.mfp-arrow:after,
.mfp-arrow:before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -12px;
    margin-top: -8px;
    border: medium inset transparent;
}

.mfp-arrow:after {
    border-top-width: 16px;
    border-bottom-width: 16px;
    top: 8px;
}

.mfp-arrow:before {
    border-top-width: 24px;
    border-bottom-width: 24px;
    opacity: 0.7;
    top: 0;
}

.mfp-arrow-left {
    left: 20px;
}

.mfp-arrow-left:after {
    border-right: 20px solid #fff;
    margin-left: -16px;
}

.mfp-arrow-left:before {
    margin-left: -20px;
    border-right: 30px solid rgba(0, 0, 0, 0.3);
}

.mfp-arrow-right {
    right: 20px;
}

.mfp-arrow-right:after {
    border-left: 20px solid #fff;
    margin-left: -4px;
}

.mfp-arrow-right:before {
    border-left: 30px solid rgba(0, 0, 0, 0.3);
}

/* iFrame holder */
.mfp-iframe-holder {
    padding-top: 40px;
    padding-bottom: 40px;
}

.mfp-iframe-holder .mfp-content {
    line-height: 0;
    width: 100%;
    max-width: 900px;
}

.mfp-iframe-holder .mfp-close {
    top: -50px;
}

.mfp-iframe-scaler {
    width: 100%;
    height: 0;
    overflow: hidden;
    padding-top: 56.25%;
}

.mfp-iframe-scaler iframe {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #000;
    border-radius: 8px;
}

/* Image styling */
img.mfp-img {
    width: auto;
    max-width: 80vw;
    max-height: 80vh;
    height: auto;
    display: block;
    line-height: 0;
    box-sizing: border-box;
    padding: 0;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mfp-figure {
    line-height: 0;
}

.mfp-figure:after {
    content: "";
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 20px;
    display: block;
    right: 0;
    width: auto;
    height: auto;
    z-index: -1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: transparent;
    border-radius: 8px;
}

.mfp-figure small {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    font-size: 14px;
    line-height: 18px;
    font-weight: 300;
}

.mfp-figure figure {
    margin: 0;
}

.mfp-bottom-bar {
    margin-top: -36px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    cursor: auto;
}

.mfp-title {
    text-align: center;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
    padding: 20px 40px;
    font-size: 16px;
    font-weight: 300;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    margin: 20px auto 0;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mfp-image-holder .mfp-content {
    max-width: 100%;
}

.mfp-gallery .mfp-image-holder .mfp-figure {
    cursor: pointer;
}

/* Mobile responsive */
@media screen and (max-width: 800px) and (orientation: landscape),
    screen and (max-height: 300px) {
    .mfp-img-mobile .mfp-image-holder {
        padding-left: 0;
        padding-right: 0;
    }

    .mfp-img-mobile img.mfp-img {
        padding: 0;
    }

    .mfp-img-mobile .mfp-figure:after {
        top: 0;
        bottom: 0;
    }

    .mfp-img-mobile .mfp-figure small {
        display: inline;
        margin-left: 5px;
    }

    .mfp-img-mobile .mfp-bottom-bar {
        background: rgba(0, 0, 0, 0.6);
        bottom: 0;
        margin: 0;
        top: auto;
        padding: 12px 15px;
        position: fixed;
        box-sizing: border-box;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mfp-img-mobile .mfp-bottom-bar:empty {
        padding: 0;
    }

    .mfp-img-mobile .mfp-counter {
        right: 15px;
        top: 12px;
    }

    .mfp-img-mobile .mfp-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        line-height: 38px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 50%;
    }
}

@media all and (max-width: 900px) {
    .mfp-arrow {
        -webkit-transform: scale(0.75);
        transform: scale(0.75);
        width: 50px;
        height: 100px;
        margin-top: -50px;
    }

    .mfp-arrow-left {
        -webkit-transform-origin: 0;
        transform-origin: 0;
        left: 10px;
    }

    .mfp-arrow-right {
        -webkit-transform-origin: 100%;
        transform-origin: 100%;
        right: 10px;
    }

    .mfp-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .mfp-close {
        right: 0px;
        top: 0px;
        width: 45px;
        height: 45px;
        line-height: 43px;
        font-size: 20px;
    }

    .mfp-counter {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .mfp-title {
        padding: 15px 30px;
        font-size: 14px;
        margin: 15px auto 0;
    }

    img.mfp-img {
        padding: 0;
    }
}

/* Tablet and small desktop optimizations */
@media all and (max-width: 1200px) and (min-width: 901px) {
    .mfp-arrow {
        width: 55px;
        height: 110px;
        margin-top: -55px;
    }

    .mfp-close {
        width: 48px;
        height: 48px;
        line-height: 46px;
        font-size: 22px;
    }
}

/* Very small screens */
@media all and (max-width: 480px) {
    .mfp-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .mfp-close {
        right: 5px;
        top: 5px;
        width: 40px;
        height: 40px;
        line-height: 38px;
        font-size: 18px;
    }

    .mfp-counter {
        top: 5px;
        right: 5px;
        padding: 4px 8px;
        font-size: 11px;
    }

    .mfp-arrow {
        display: none; /* Hide arrows on very small screens for better UX */
    }

    .mfp-title {
        padding: 12px 20px;
        font-size: 13px;
        margin: 12px auto 0;
        max-width: 90%;
    }

    img.mfp-img {
        padding: 0;
        max-width: 85vw;
        max-height: 85vh;
    }

    .mfp-preloader::before {
        width: 30px;
        height: 30px;
    }
}
