/* Stato iniziale nascosto tramite classe aggiunta via PHP */
body.ptfx-is-loading {
  opacity: 0 !important; /* Usiamo !important per sicurezza iniziale */
  visibility: hidden !important; /* Usiamo !important per sicurezza iniziale */
  transition: none !important; /* Disabilita transizioni durante lo stato iniziale */
}

/* --- ANIMAZIONI DI USCITA (OUT) --- */

/* Base per animazioni di uscita */
/* (Non strettamente necessario, ma può essere utile per stili comuni) */
/* body.ptfx-animating-out { } */

.ptfx-fade-out { animation: ptfxFadeOut 0.5s forwards; }
.ptfx-slide-left-out { animation: ptfxSlideLeftOut 0.5s forwards; }
.ptfx-slide-right-out { animation: ptfxSlideRightOut 0.5s forwards; }
.ptfx-slide-up-out { animation: ptfxSlideUpOut 0.5s forwards; }
.ptfx-slide-down-out { animation: ptfxSlideDownOut 0.5s forwards; }
.ptfx-zoom-out-out { animation: ptfxZoomOut 0.5s forwards; }
.ptfx-zoom-in-out { animation: ptfxZoomInForOut 0.5s forwards; }
.ptfx-blur-out { animation: ptfxBlurOut 0.5s forwards; }
.ptfx-rotate-out { animation: ptfxRotateOut 0.5s forwards; }
.ptfx-skew-out { animation: ptfxSkewOut 0.5s forwards; }
.ptfx-flip-out { animation: ptfxFlipOut 0.5s forwards; }
.ptfx-flip-v-out { animation: ptfxFlipVOut 0.5s forwards; }
.ptfx-scale-down-out { animation: ptfxScaleDown 0.5s forwards; }
.ptfx-scale-up-out { animation: ptfxScaleUpForOut 0.5s forwards; }
.ptfx-wipe-left-out { animation: ptfxWipeLeftOut 0.5s forwards; clip-path: inset(0 0 0 0); }
.ptfx-wipe-right-out { animation: ptfxWipeRightOut 0.5s forwards; clip-path: inset(0 0 0 0); }
.ptfx-wipe-up-out { animation: ptfxWipeUpOut 0.5s forwards; clip-path: inset(0 0 0 0); }
.ptfx-wipe-down-out { animation: ptfxWipeDownOut 0.5s forwards; clip-path: inset(0 0 0 0); }

/* --- ANIMAZIONI DI INGRESSO (IN) --- */

/* Base per animazioni di ingresso */
/* (Non strettamente necessario, ma può essere utile per stili comuni) */
/* body.ptfx-animating-in { } */

.ptfx-fade-in { animation: ptfxFadeIn 0.5s forwards; }
.ptfx-slide-left-in { animation: ptfxSlideLeftIn 0.5s forwards; }
.ptfx-slide-right-in { animation: ptfxSlideRightIn 0.5s forwards; }
.ptfx-slide-up-in { animation: ptfxSlideUpIn 0.5s forwards; }
.ptfx-slide-down-in { animation: ptfxSlideDownIn 0.5s forwards; }
.ptfx-zoom-out-in { animation: ptfxZoomIn 0.5s forwards; }
.ptfx-zoom-in-in { animation: ptfxZoomOutForIn 0.5s forwards; }
.ptfx-blur-in { animation: ptfxBlurIn 0.5s forwards; }
.ptfx-rotate-in { animation: ptfxRotateIn 0.5s forwards; }
.ptfx-skew-in { animation: ptfxSkewIn 0.5s forwards; }
.ptfx-flip-in { animation: ptfxFlipIn 0.5s forwards; }
.ptfx-flip-v-in { animation: ptfxFlipVIn 0.5s forwards; }
.ptfx-scale-down-in { animation: ptfxScaleUp 0.5s forwards; }
.ptfx-scale-up-in { animation: ptfxScaleDownForIn 0.5s forwards; }
.ptfx-wipe-left-in { animation: ptfxWipeLeftIn 0.5s forwards; clip-path: inset(0 100% 0 0); }
.ptfx-wipe-right-in { animation: ptfxWipeRightIn 0.5s forwards; clip-path: inset(0 0 0 100%); }
.ptfx-wipe-up-in { animation: ptfxWipeUpIn 0.5s forwards; clip-path: inset(100% 0 0 0); }
.ptfx-wipe-down-in { animation: ptfxWipeDownIn 0.5s forwards; clip-path: inset(0 0 100% 0); }

/* --- KEYFRAMES USCITA (OUT) --- */
/* Terminano con opacity: 0; visibility: hidden; */
@keyframes ptfxFadeOut { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes ptfxSlideLeftOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; visibility: hidden; } }
@keyframes ptfxSlideRightOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; visibility: hidden; } }
@keyframes ptfxSlideUpOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-100%); opacity: 0; visibility: hidden; } }
@keyframes ptfxSlideDownOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; visibility: hidden; } }
@keyframes ptfxZoomOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.8); opacity: 0; visibility: hidden; } }
@keyframes ptfxZoomInForOut { from { transform: scale(1); opacity: 1; } to { transform: scale(1.2); opacity: 0; visibility: hidden; } }
@keyframes ptfxBlurOut { from { filter: blur(0px); opacity: 1; } to { filter: blur(10px); opacity: 0; visibility: hidden; } }
@keyframes ptfxRotateOut { from { transform: rotate(0deg); opacity: 1; transform-origin: center center;} to { transform: rotate(-90deg); opacity: 0; visibility: hidden; } }
@keyframes ptfxSkewOut { from { transform: skew(0deg, 0deg); opacity: 1; } to { transform: skew(-30deg, -10deg); opacity: 0; visibility: hidden; } }
@keyframes ptfxFlipOut { from { transform: perspective(1000px) rotateY(0deg); opacity: 1; } to { transform: perspective(1000px) rotateY(90deg); opacity: 0; visibility: hidden; } }
@keyframes ptfxFlipVOut { from { transform: perspective(1000px) rotateX(0deg); opacity: 1; } to { transform: perspective(1000px) rotateX(90deg); opacity: 0; visibility: hidden; } }
@keyframes ptfxScaleDown { from { transform: scale(1); opacity: 1; } to { transform: scale(0); opacity: 0; visibility: hidden; } }
@keyframes ptfxScaleUpForOut { from { transform: scale(1); opacity: 1; } to { transform: scale(1.5); opacity: 0; visibility: hidden; } }
@keyframes ptfxWipeLeftOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 100% 0 0); visibility: hidden; } }
@keyframes ptfxWipeRightOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); visibility: hidden; } }
@keyframes ptfxWipeUpOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(100% 0 0 0); visibility: hidden; } }
@keyframes ptfxWipeDownOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* --- KEYFRAMES INGRESSO (IN) --- */
/* Iniziano da uno stato nascosto (opacity: 0, transform/clip-path appropriato) */
/* Terminano con opacity: 1; visibility: visible; */
@keyframes ptfxFadeIn { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }
@keyframes ptfxSlideLeftIn { from { transform: translateX(-100%); opacity: 0; visibility: hidden; } to { transform: translateX(0); opacity: 1; visibility: visible; } }
@keyframes ptfxSlideRightIn { from { transform: translateX(100%); opacity: 0; visibility: hidden; } to { transform: translateX(0); opacity: 1; visibility: visible; } }
@keyframes ptfxSlideUpIn { from { transform: translateY(-100%); opacity: 0; visibility: hidden; } to { transform: translateY(0); opacity: 1; visibility: visible; } }
@keyframes ptfxSlideDownIn { from { transform: translateY(100%); opacity: 0; visibility: hidden; } to { transform: translateY(0); opacity: 1; visibility: visible; } }
@keyframes ptfxZoomIn { from { transform: scale(0.8); opacity: 0; visibility: hidden; } to { transform: scale(1); opacity: 1; visibility: visible; } }
@keyframes ptfxZoomOutForIn { from { transform: scale(1.2); opacity: 0; visibility: hidden; } to { transform: scale(1); opacity: 1; visibility: visible; } }
@keyframes ptfxBlurIn { from { filter: blur(10px); opacity: 0; visibility: hidden; } to { filter: blur(0px); opacity: 1; visibility: visible; } }
@keyframes ptfxRotateIn { from { transform: rotate(90deg); opacity: 0; visibility: hidden; transform-origin: center center;} to { transform: rotate(0deg); opacity: 1; visibility: visible; } }
@keyframes ptfxSkewIn { from { transform: skew(30deg, 10deg); opacity: 0; visibility: hidden; } to { transform: skew(0deg, 0deg); opacity: 1; visibility: visible; } }
@keyframes ptfxFlipIn { from { transform: perspective(1000px) rotateY(-90deg); opacity: 0; visibility: hidden; } to { transform: perspective(1000px) rotateY(0deg); opacity: 1; visibility: visible; } }
@keyframes ptfxFlipVIn { from { transform: perspective(1000px) rotateX(-90deg); opacity: 0; visibility: hidden; } to { transform: perspective(1000px) rotateX(0deg); opacity: 1; visibility: visible; } }
@keyframes ptfxScaleUp { from { transform: scale(0); opacity: 0; visibility: hidden; } to { transform: scale(1); opacity: 1; visibility: visible; } }
@keyframes ptfxScaleDownForIn { from { transform: scale(1.5); opacity: 0; visibility: hidden; } to { transform: scale(1); opacity: 1; visibility: visible; } }
@keyframes ptfxWipeLeftIn { from { clip-path: inset(0 100% 0 0); visibility: hidden; } to { clip-path: inset(0 0 0 0); visibility: visible; } } /* Visibility change needed */
@keyframes ptfxWipeRightIn { from { clip-path: inset(0 0 0 100%); visibility: hidden; } to { clip-path: inset(0 0 0 0); visibility: visible; } }/* Visibility change needed */
@keyframes ptfxWipeUpIn { from { clip-path: inset(100% 0 0 0); visibility: hidden; } to { clip-path: inset(0 0 0 0); visibility: visible; } } /* Visibility change needed */
@keyframes ptfxWipeDownIn { from { clip-path: inset(0 0 100% 0); visibility: hidden; } to { clip-path: inset(0 0 0 0); visibility: visible; } }/* Visibility change needed */