/**
 * SI-REMBES Animations (animation.css)
 * High-performance CSS transitions and keyframes
 */

/* ==========================================================================
   Entrance Animation Timeline
   ========================================================================== */
#entrance-curtain {
    animation: fadeOutCurtain 0.8s ease 0.3s forwards;
}

.bg-layer {
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

.batik-layer {
    opacity: 0;
    animation: fadeIn 1.5s ease 0.8s forwards;
}

.faucet-layer {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.surface-layer {
    animation: fadeIn 0.8s ease 1s both;
}

.login-card {
    /* Removed base opacity: 0 so it doesn't disappear when overwritten */
    animation: floatUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.input-group {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s ease forwards;
}

#group-username { animation-delay: 1.3s; }
#group-password { animation-delay: 1.4s; }
.form-options { 
    opacity: 0;
    animation: fadeIn 0.5s ease 1.5s forwards; 
}
.btn-submit {
    opacity: 0;
    transform: translateY(20px);
    animation: floatUpIn 0.5s ease 1.6s forwards;
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes fadeOutCurtain {
    to { opacity: 0; visibility: hidden; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes floatUpIn {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Continuous Floating Animation for Card */
.card-floating {
    animation: gentleFloat 6s ease-in-out infinite alternate;
}

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

.spinner-icon {
    animation: spin 1s linear infinite;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    display: inline-block;
    vertical-align: middle;
}

.card-fade-out {
    /* Gunakan important agar menimpa animasi floating */
    animation: cinematicFadeOut 1.2s cubic-bezier(0.8, 0, 0.2, 1) forwards !important;
}

@keyframes cinematicFadeOut {
    0% { opacity: 1; transform: translateY(-8px) scale(1); filter: blur(0); }
    100% { opacity: 0; transform: translateY(-50px) scale(0.9); filter: blur(10px); }
}

@keyframes gentleFloat {
    0% { transform: translateY(0); box-shadow: 0 30px 60px rgba(0,0,0,0.4); }
    100% { transform: translateY(-8px); box-shadow: 0 40px 70px rgba(0,0,0,0.3); }
}

/* Button Hover Sweep */
.btn-submit:hover .btn-light-sweep {
    animation: lightSweep 0.8s ease;
}

@keyframes lightSweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Button Click Ripple (Triggered via JS) */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
