/* ==========================================================================
   Pistis Floating Messages - Frontend Styles v2.0
   ========================================================================== */

/* ---------- Base Wrapper ---------- */
.pfm-wrapper {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
}
.pfm-wrapper.pfm-visible {
    visibility: visible;
}
.pfm-wrapper a {
    text-decoration: none;
    font-weight: bold;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pfm-wrapper .pfm-content {
    font-weight: bold;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Close Button ---------- */
.pfm-close {
    position: absolute;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    z-index: 100000;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.pfm-close:hover {
    background: rgba(220, 50, 50, 0.9);
    transform: scale(1.15);
}

/* ---------- Icon ---------- */
.pfm-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}
.pfm-icon .dashicons {
    font-size: inherit;
    width: auto;
    height: auto;
    line-height: inherit;
}

/* ---------- Overlay (for center position) ---------- */
.pfm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.pfm-overlay.pfm-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   POSITIONS
   ========================================================================== */

/* -- Bottom Center -- */
.pfm-pos-bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px 10px 0 0;
}
.pfm-pos-bottom-center .pfm-close { top: -12px; right: -12px; }

/* -- Bottom Left -- */
.pfm-pos-bottom-left {
    bottom: 0;
    left: 20px;
    border-radius: 10px 10px 0 0;
}
.pfm-pos-bottom-left .pfm-close { top: -12px; right: -12px; }

/* -- Bottom Right -- */
.pfm-pos-bottom-right {
    bottom: 0;
    right: 20px;
    border-radius: 10px 10px 0 0;
}
.pfm-pos-bottom-right .pfm-close { top: -12px; left: -12px; }

/* -- Top Center -- */
.pfm-pos-top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 10px 10px;
}
.pfm-pos-top-center .pfm-close { bottom: -12px; right: -12px; }

/* -- Top Left -- */
.pfm-pos-top-left {
    top: 0;
    left: 20px;
    border-radius: 0 0 10px 10px;
}
.pfm-pos-top-left .pfm-close { bottom: -12px; right: -12px; }

/* -- Top Right -- */
.pfm-pos-top-right {
    top: 0;
    right: 20px;
    border-radius: 0 0 10px 10px;
}
.pfm-pos-top-right .pfm-close { bottom: -12px; left: -12px; }

/* -- Left Center (vertical text) -- */
.pfm-pos-left {
    left: 0;
    top: 50%;
    writing-mode: vertical-lr;
    transform: translateY(-50%) rotate(180deg);
    border-radius: 0 10px 10px 0;
}
.pfm-pos-left .pfm-close { top: -12px; right: -12px; transform: rotate(180deg); }
.pfm-pos-left a,
.pfm-pos-left .pfm-content { padding: 24px 10px; }

/* -- Right Center (vertical text) -- */
.pfm-pos-right {
    right: 0;
    top: 50%;
    writing-mode: vertical-rl;
    transform: translateY(-50%);
    border-radius: 10px 0 0 10px;
}
.pfm-pos-right .pfm-close { top: -12px; left: -12px; }
.pfm-pos-right a,
.pfm-pos-right .pfm-content { padding: 24px 10px; }

/* -- Center (modal-style) -- */
.pfm-pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    max-width: 90vw;
}
.pfm-pos-center .pfm-close { top: -12px; right: -12px; }

/* ==========================================================================
   ANIMATION KEYFRAMES — ENTRANCE
   ========================================================================== */

/* -- fadeIn -- */
@keyframes pfm-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* -- slideInUp -- */
@keyframes pfm-slideInUp {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- slideInDown -- */
@keyframes pfm-slideInDown {
    from { opacity: 0; transform: translateY(-60px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- slideInLeft -- */
@keyframes pfm-slideInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -- slideInRight -- */
@keyframes pfm-slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -- bounceIn -- */
@keyframes pfm-bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.08); }
    70%  { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* -- zoomIn -- */
@keyframes pfm-zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* -- flipInX -- */
@keyframes pfm-flipInX {
    from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
    40%  { transform: perspective(400px) rotateX(-15deg); }
    70%  { transform: perspective(400px) rotateX(10deg); }
    to   { opacity: 1; transform: perspective(400px) rotateX(0deg); }
}

/* -- rotateIn -- */
@keyframes pfm-rotateIn {
    from { opacity: 0; transform: rotate(-200deg) scale(0.5); }
    to   { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* ==========================================================================
   ANIMATION KEYFRAMES — EXIT
   ========================================================================== */

/* -- fadeOut -- */
@keyframes pfm-fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* -- slideOutUp -- */
@keyframes pfm-slideOutUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-60px); }
}

/* -- slideOutDown -- */
@keyframes pfm-slideOutDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(60px); }
}

/* -- slideOutLeft -- */
@keyframes pfm-slideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-60px); }
}

/* -- slideOutRight -- */
@keyframes pfm-slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* -- bounceOut -- */
@keyframes pfm-bounceOut {
    0%   { opacity: 1; transform: scale(1); }
    25%  { transform: scale(0.95); }
    50%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* -- zoomOut -- */
@keyframes pfm-zoomOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.5); }
}

/* -- flipOutX -- */
@keyframes pfm-flipOutX {
    from { opacity: 1; transform: perspective(400px) rotateX(0deg); }
    30%  { transform: perspective(400px) rotateX(-15deg); }
    to   { opacity: 0; transform: perspective(400px) rotateX(90deg); }
}

/* -- rotateOut -- */
@keyframes pfm-rotateOut {
    from { opacity: 1; transform: rotate(0deg) scale(1); }
    to   { opacity: 0; transform: rotate(200deg) scale(0.5); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 600px) {
    .pfm-pos-bottom-center,
    .pfm-pos-top-center {
        width: calc(100% - 20px);
        left: 10px;
        transform: none;
    }
    .pfm-pos-center {
        width: calc(100% - 30px);
        max-width: none;
    }
    .pfm-wrapper a,
    .pfm-wrapper .pfm-content {
        padding: 10px 18px;
        font-size: 14px;
    }
}
