/**
 * Flexible Popup Plugin – Frontend Styles
 *
 * @version 2.0.0
 */

/* ===========================================================
   Overlay
=========================================================== */
.fpp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 15px;
    overflow-y: auto;
}

/* ===========================================================
   Content box
=========================================================== */
.fpp-popup-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: calc(100% - 30px);
    max-height: 90vh;
    width: auto;
    overflow: hidden;
}

.fpp-popup-inner-content {
    height: 100%;
    overflow-y: auto;
    max-height: 80vh;
}

.fpp-popup-inner-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ===========================================================
   Close button
=========================================================== */
.fpp-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    transition: all .2s cubic-bezier(.4,0,.2,1);
}

.fpp-popup-close:hover,
.fpp-popup-close:focus {
    background: #c0392b;
    transform: scale(1.15) rotate(90deg);
    outline: none;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

/* ===========================================================
   Positioning variants
=========================================================== */
.fpp-position-center       { margin: auto; }
.fpp-position-left         { margin: auto auto auto 0; }
.fpp-position-right        { margin: auto 0 auto auto; }
.fpp-position-top          { align-self: flex-start; margin: 0 auto; }
.fpp-position-bottom       { align-self: flex-end; margin: 0 auto; }
.fpp-position-top-left     { align-self: flex-start; margin: 0 auto 0 0; }
.fpp-position-top-right    { align-self: flex-start; margin: 0 0 0 auto; }
.fpp-position-bottom-left  { align-self: flex-end;   margin: 0 auto 0 0; }
.fpp-position-bottom-right { align-self: flex-end;   margin: 0 0 0 auto; }
.fpp-position-fullscreen   { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; }

/* ===========================================================
   Animations – SHOW
=========================================================== */
@keyframes fpp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fpp-zoom-in {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

@keyframes fpp-slide-left-in {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

@keyframes fpp-slide-right-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fpp-slide-top-in {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@keyframes fpp-slide-bottom-in {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fpp-flip-in {
    from { transform: perspective(600px) rotateY(90deg); opacity: 0; }
    to   { transform: perspective(600px) rotateY(0deg);  opacity: 1; }
}

@keyframes fpp-rotate-in {
    from { transform: rotate(-180deg) scale(0.5); opacity: 0; }
    to   { transform: rotate(0deg)    scale(1);   opacity: 1; }
}

.fpp-show-fade-in      { animation: fpp-fade-in       0.4s ease-out forwards; }
.fpp-show-zoom-in      { animation: fpp-zoom-in       0.4s ease-out forwards; }
.fpp-show-slide-left   { animation: fpp-slide-left-in  0.4s ease-out forwards; }
.fpp-show-slide-right  { animation: fpp-slide-right-in 0.4s ease-out forwards; }
.fpp-show-slide-top    { animation: fpp-slide-top-in   0.4s ease-out forwards; }
.fpp-show-slide-bottom { animation: fpp-slide-bottom-in 0.4s ease-out forwards; }
.fpp-show-flip         { animation: fpp-flip-in        0.5s ease-out forwards; }
.fpp-show-rotate       { animation: fpp-rotate-in      0.5s ease-out forwards; }

/* ===========================================================
   Animations – HIDE
=========================================================== */
@keyframes fpp-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes fpp-zoom-out {
    from { transform: scale(1);   opacity: 1; }
    to   { transform: scale(0.5); opacity: 0; }
}

@keyframes fpp-slide-left-out {
    from { transform: translateX(0);     opacity: 1; }
    to   { transform: translateX(-100%); opacity: 0; }
}

@keyframes fpp-slide-right-out {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

@keyframes fpp-slide-top-out {
    from { transform: translateY(0);     opacity: 1; }
    to   { transform: translateY(-100%); opacity: 0; }
}

@keyframes fpp-slide-bottom-out {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}

@keyframes fpp-flip-out {
    from { transform: perspective(600px) rotateY(0deg);  opacity: 1; }
    to   { transform: perspective(600px) rotateY(90deg); opacity: 0; }
}

@keyframes fpp-rotate-out {
    from { transform: rotate(0deg)    scale(1);   opacity: 1; }
    to   { transform: rotate(180deg)  scale(0.5); opacity: 0; }
}

.fpp-hide-fade-out     { animation: fpp-fade-out       0.35s ease-in forwards; }
.fpp-hide-zoom-out     { animation: fpp-zoom-out       0.35s ease-in forwards; }
.fpp-hide-slide-left   { animation: fpp-slide-left-out  0.35s ease-in forwards; }
.fpp-hide-slide-right  { animation: fpp-slide-right-out 0.35s ease-in forwards; }
.fpp-hide-slide-top    { animation: fpp-slide-top-out   0.35s ease-in forwards; }
.fpp-hide-slide-bottom { animation: fpp-slide-bottom-out 0.35s ease-in forwards; }
.fpp-hide-flip         { animation: fpp-flip-out        0.4s ease-in forwards; }
.fpp-hide-rotate       { animation: fpp-rotate-out      0.4s ease-in forwards; }

/* ===========================================================
   Mobile tweaks
=========================================================== */
@media (max-width: 768px) {
    .fpp-popup-content {
        max-width: calc(100% - 20px);
        max-height: 85vh;
    }

    .fpp-popup-inner-content {
        max-height: 75vh;
    }

    .fpp-popup-close {
        top: -10px;
        right: -10px;
    }
}
