/* ==========================================================================
   Login Animations - Split Screen Design
   ========================================================================== */

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Loading Overlay */
.login-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
}

.login-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e2e8f0;
    border-top-color: #0891b2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Hero Animations */
.login-hero-content {
    animation: fadeInUp 0.6s ease-out;
}

.login-hero-logo {
    animation: fadeIn 0.8s ease-out;
}

.login-hero-title {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.login-hero-subtitle {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.login-hero-feature {
    animation: fadeInLeft 0.4s ease-out;
}

.login-hero-feature:nth-child(1) { animation-delay: 0.3s; }
.login-hero-feature:nth-child(2) { animation-delay: 0.4s; }
.login-hero-feature:nth-child(3) { animation-delay: 0.5s; }

.login-hero-wave {
    animation: fadeIn 1s ease-out 0.5s both;
}

/* Form Animations */
.login-form-container {
    animation: fadeInUp 0.5s ease-out;
}

.login-form-header {
    animation: fadeIn 0.4s ease-out;
}

.login-input-group {
    animation: fadeInUp 0.4s ease-out;
}

.login-input-group:nth-child(1) { animation-delay: 0.1s; }
.login-input-group:nth-child(2) { animation-delay: 0.15s; }

.login-btn-row {
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.login-divider {
    animation: fadeIn 0.3s ease-out;
}

/* Button Effects */
.btn-primary,
.btn-success,
.btn-warning,
.btn-default,
.login-btn {
    transition: all 200ms ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover {
    transform: translateY(-2px);
}

.btn-primary:active,
.btn-success:active,
.btn-warning:active {
    transform: translateY(0);
}

/* Ripple Effect */
.btn-primary::after,
.btn-success::after,
.btn-warning::after,
.btn-default::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after,
.btn-success:active::after,
.btn-warning:active::after,
.btn-default:active::after {
    width: 300px;
    height: 300px;
}

/* Icon Animation */
.btn i,
.login-btn i {
    transition: transform 150ms ease;
}

.btn:hover i,
.login-btn:hover i {
    transform: translateX(2px);
}

/* Input Focus Animation */
.login-input-wrapper {
    position: relative;
}

.login-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0891b2, #22d3ee);
    transition: all 200ms ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.login-input-wrapper:focus-within::after {
    width: calc(100% - 4px);
}

/* Password Toggle Animation */
.password-toggle {
    transition: all 150ms ease;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

/* Footer Animations */
.login-footer {
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.login-footer-column {
    animation: fadeInUp 0.4s ease-out;
}

.login-footer-column:nth-child(1) { animation-delay: 0.1s; }
.login-footer-column:nth-child(2) { animation-delay: 0.15s; }
.login-footer-column:nth-child(3) { animation-delay: 0.2s; }
.login-footer-column:nth-child(4) { animation-delay: 0.25s; }

.login-footer-social a {
    transition: all 200ms ease;
}

.login-footer-social a:hover {
    transform: translateY(-3px);
}

/* Error Animation */
.login-error {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.login-error.show {
    animation: shake 0.4s ease-in-out;
}

/* Back Link Animation */
.login-back-link {
    animation: fadeIn 0.3s ease-out;
}

.login-back-link a {
    transition: all 150ms ease;
}

.login-back-link a:hover {
    transform: translateX(-3px);
}

/* Growl Animation */
.ui-growl-item {
    animation: fadeInUp 0.3s ease-out !important;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    animation: fadeInUp 0.3s ease-out;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .login-loading {
        animation: none;
    }
    
    .login-spinner {
        animation: none;
        border-top-color: #0891b2;
    }
}

/* Hover Effects Desktop Only */
@media (hover: hover) {
    .login-hero-logo {
        transition: transform 300ms ease;
    }
    
    .login-hero-logo:hover {
        transform: scale(1.05);
    }
    
    .login-footer-social a:hover {
        box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .login-hero-content {
        animation: fadeIn 0.4s ease-out;
    }
    
    .login-hero-logo,
    .login-hero-title,
    .login-hero-subtitle {
        animation: none;
    }
}
