<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <link rel="stylesheet" href="{{ asset('auth/css/authstyle.css') }}">
    <title>Perhitungan SAW - Login</title>
    <style>
    #toast-container {
        z-index: 99999 !important;
        position: fixed !important;
    }
    #toast-container > div {
        z-index: 99999 !important;
    }
    .toast {
        z-index: 99999 !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
    }
</style>
</head>

<body>

<div class="container" id="container">

<!-- Log In Form -->
<div class="form-container sign-in">
<form method="POST" action="{{ route('login') }}">
    @csrf
    <h1>Log In</h1>
    <span>Masuk untuk mulai pilih pelajaran yang sesuai dengan minat dan tujuanmu.</span>
    <input type="email" name="email" placeholder="Email" required>
    <div class="password-container">
        <input type="password" name="password" id="signin-password" placeholder="Password" required>
        <i id="toggle-signin-password" class="fas fa-eye"></i> 
    </div>
    <div class="form-options">
    <div class="remember-container">
        <input type="checkbox" name="remember" id="remember-me">
        <label for="remember-me">Remember Me</label>
    </div>
    <a href="{{ route('password.request') }}" class="forget-password">Forget Your Password?</a>
    </div>
    <button type="submit">Log In</button>
</form>
</div>
<!-- Log In Form End -->

        

        <!-- Toggle Panel -->
        <div class="toggle-container">
            <div class="toggle">
                <div class="toggle-panel toggle-right">
                <img src="{{ asset('user/images/hero-banner.png') }}" alt="Hero Banner" class="toggle-image">  
                </div>
            </div>
        </div>
    </div>

    <script>
        // Password visibility toggle functionality
        document.addEventListener('DOMContentLoaded', function() {
            const togglePassword = document.getElementById('toggle-signin-password');
            const password = document.getElementById('signin-password');
            
            togglePassword.addEventListener('click', function() {
                // Toggle the type attribute
                const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
                password.setAttribute('type', type);
                
                // Toggle the eye icon
                this.classList.toggle('fa-eye');
                this.classList.toggle('fa-eye-slash');
            });
        });
    </script>
    <script>
        // Tambahkan script ini setelah DOM loaded
document.addEventListener('DOMContentLoaded', function() {
    // Pindahkan toast container ke body dan set z-index tertinggi
    setTimeout(function() {
        const toastContainer = document.getElementById('toast-container');
        if (toastContainer) {
            // Pindah ke body
            document.body.appendChild(toastContainer);
            
            // Set z-index tertinggi
            toastContainer.style.zIndex = '999999';
            toastContainer.style.position = 'fixed';
            toastContainer.style.top = '20px';
            toastContainer.style.right = '20px';
            
            // Set z-index untuk semua toast
            const toasts = toastContainer.querySelectorAll('.toast');
            toasts.forEach(toast => {
                toast.style.zIndex = '999999';
            });
        }
    }, 100);
});

// Override toastr untuk selalu menggunakan z-index tinggi
if (typeof toastr !== 'undefined') {
    const originalShow = toastr.show;
    toastr.show = function() {
        const result = originalShow.apply(this, arguments);
        setTimeout(() => {
            const container = document.getElementById('toast-container');
            if (container) {
                container.style.zIndex = '999999';
                const toasts = container.querySelectorAll('.toast');
                toasts.forEach(toast => {
                    toast.style.zIndex = '999999';
                });
            }
        }, 10);
        return result;
    };
}
    </script>
</body>

</html>
