/*
 * ReDesign LoginPage - Additional Styles
 * Version: 1.0.0
 * Author: Andi Sharil
 */

/* Additional animations and effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 158, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 158, 255, 0);
    }
}

/* Enhanced login form animations */
#login {
    animation: fadeInUp 0.6s ease-out;
}

/* Input field enhancements */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    position: relative;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    animation: pulse 2s infinite;
}

/* Button hover effects */
.wp-core-ui .button-primary {
    position: relative;
    overflow: hidden;
}

.wp-core-ui .button-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.wp-core-ui .button-primary:hover:before {
    left: 100%;
}

/* Loading state */
.login .button-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login .button-primary.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.8);
}

/* Enhanced error and message styling */
.login .message,
.login .notice {
    animation: fadeInUp 0.4s ease-out;
    position: relative;
}

.login .error {
    animation: fadeInUp 0.4s ease-out;
    position: relative;
}

/* Form field focus indicators */
.login .input {
    position: relative;
}

.login .input:focus-within label {
    color: #4a9eff !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Improved checkbox styling */
.forgetmenot input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.forgetmenot input[type="checkbox"]:checked {
    background: #4a9eff;
    border-color: #4a9eff;
}

.forgetmenot input[type="checkbox"]:checked:after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Link hover effects */
.login #nav a,
.login #backtoblog a {
    position: relative;
    display: inline-block;
}

.login #nav a:after,
.login #backtoblog a:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4a9eff;
    transition: width 0.3s ease;
}

.login #nav a:hover:after,
.login #backtoblog a:hover:after {
    width: 100%;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .login h1 a {
        font-size: 20px !important;
    }
    
    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .wp-core-ui .button-primary {
        font-size: 16px !important;
        padding: 14px 24px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #login {
        background: #000000 !important;
        border: 2px solid #ffffff !important;
    }
    
    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        background: #000000 !important;
        border: 2px solid #ffffff !important;
        color: #ffffff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    body.login {
        background: white !important;
        color: black !important;
    }
    
    #login {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid black !important;
    }
}