<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Efata Gemilang Jaya | Landing Page</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <style>
        * { font-family: 'Plus Jakarta Sans', sans-serif; }
        body { 
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        
        /* Animasi fade dan scale */
        @keyframes fadeScaleIn {
            0% {
                opacity: 0;
                transform: scale(0.9);
            }
            100% {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        @keyframes fadeOut {
            0% {
                opacity: 1;
                transform: scale(1);
            }
            100% {
                opacity: 0;
                transform: scale(1.1);
            }
        }
        
        @keyframes slideInFromBottom {
            0% {
                opacity: 0;
                transform: translateY(50px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @keyframes slideInFromTop {
            0% {
                opacity: 0;
                transform: translateY(-50px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @keyframes zoomIn {
            0% {
                opacity: 0;
                transform: scale(0.5);
            }
            100% {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        /* Animasi untuk redirect */
        @keyframes pageExit {
            0% {
                opacity: 1;
                transform: scale(1);
            }
            50% {
                opacity: 0.5;
                transform: scale(0.98);
            }
            100% {
                opacity: 0;
                transform: scale(0.95);
            }
        }
        
        @keyframes slideOutToRight {
            0% {
                opacity: 1;
                transform: translateX(0);
            }
            100% {
                opacity: 0;
                transform: translateX(100px);
            }
        }
        
        @keyframes glowPulse {
            0% {
                box-shadow: 0 0 0 0 rgba(197, 160, 40, 0.7);
            }
            70% {
                box-shadow: 0 0 30px 15px rgba(197, 160, 40, 0.3);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(197, 160, 40, 0);
            }
        }
        
        .landing-container {
            position: relative;
            width: 100vw;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .landing-container.exit-animation {
            animation: pageExit 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        
        .landing-container.exit-right {
            animation: slideOutToRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        
        /* Layer 1: Nama Perusahaan */
        .layer-name {
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            opacity: 1;
            transition: opacity 0.8s ease-in-out;
        }
        
        .layer-name.fade-out {
            opacity: 0;
            pointer-events: none;
        }
        
        .logo-large {
            animation: zoomIn 1.2s ease-out forwards;
        }
        
        .company-name {
            animation: slideInFromBottom 0.8s ease-out 0.3s both;
        }
        
        .company-tagline {
            animation: slideInFromTop 0.8s ease-out 0.6s both;
        }
        
        /* Layer 2: Gambar Besar */
        .layer-image {
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.8s ease-in-out;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        }
        
        .layer-image.show {
            opacity: 1;
            z-index: 20;
        }
        
        .layer-image.fade-out {
            opacity: 0;
        }
        
        .image-container {
            position: relative;
            width: 90%;
            max-width: 1200px;
            height: 80%;
            max-height: 800px;
            border-radius: 2rem;
            overflow: hidden;
            box-shadow: 0 30px 60px -15px rgba(30, 43, 58, 0.3);
            animation: fadeScaleIn 1.2s ease-out forwards;
            border: 4px solid rgba(197, 160, 40, 0.3);
            transition: all 0.5s ease;
        }
        
        .image-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .image-container:hover {
            border-color: #C5A028;
            box-shadow: 0 40px 80px -15px rgba(197, 160, 40, 0.3);
        }
        
        .image-container:hover img {
            transform: scale(1.05);
        }
        
        .image-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(30, 43, 58, 0.9), transparent);
            padding: 2rem;
            color: white;
            transform: translateY(100%);
            transition: transform 0.5s ease;
        }
        
        .image-container:hover .image-overlay {
            transform: translateY(0);
        }
        
        .image-overlay h3 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #C5A028;
        }
        
        .image-overlay p {
            font-size: 1rem;
            opacity: 0.9;
        }
        
        /* Loading indicator */
        .loading-progress {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 30;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            color: #1e2b3a;
            font-weight: 600;
            opacity: 0;
            transition: opacity 0.5s ease;
        }
        
        .loading-progress.show {
            opacity: 1;
        }
        
        .progress-bar {
            width: 200px;
            height: 4px;
            background: rgba(197, 160, 40, 0.2);
            border-radius: 10px;
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            width: 0%;
            background: #C5A028;
            border-radius: 10px;
            transition: width 0.3s linear;
        }
        
        .countdown-text {
            font-size: 0.9rem;
            color: #64748b;
        }
        
        /* Skip link */
        .skip-link {
            position: absolute;
            bottom: 30px;
            right: 30px;
            z-index: 40;
            padding: 12px 24px;
            background: rgba(255, 255, 255, 0.9);
            color: #1e2b3a;
            border-radius: 50px;
            font-weight: 600;
            text-decoration: none;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(197, 160, 40, 0.3);
            transition: all 0.3s;
            opacity: 0;
            pointer-events: none;
        }
        
        .skip-link.show {
            opacity: 1;
            pointer-events: auto;
        }
        
        .skip-link:hover {
            background: #C5A028;
            color: white;
            border-color: #C5A028;
            transform: scale(1.05);
        }
        
        /* Decorative elements */
        .decor-circle {
            position: absolute;
            width: 300px;
            height: 300px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(197,160,40,0.1) 0%, rgba(197,160,40,0) 70%);
            z-index: 1;
        }
        
        .circle-1 {
            top: -150px;
            left: -150px;
        }
        
        .circle-2 {
            bottom: -150px;
            right: -150px;
        }
        
        /* Redirect transition overlay */
        .transition-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #1e2b3a 0%, #2c3e50 100%);
            z-index: 9999;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.5s ease;
        }
        
        .transition-overlay.show {
            opacity: 1;
            pointer-events: all;
        }
        
        .transition-overlay .loader {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 60px;
            height: 60px;
            border: 3px solid rgba(197, 160, 40, 0.3);
            border-top-color: #C5A028;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: translate(-50%, -50%) rotate(360deg); }
        }
        
        .transition-overlay .text {
            position: absolute;
            top: calc(50% + 50px);
            left: 50%;
            transform: translateX(-50%);
            color: white;
            font-weight: 600;
            font-size: 1.2rem;
            text-align: center;
            white-space: nowrap;
        }
        
        .transition-overlay .text span {
            color: #C5A028;
        }
    </style>
</head>
<body>
    <div class="landing-container" id="landingContainer">
        
        <!-- Transition Overlay -->
        <div class="transition-overlay" id="transitionOverlay">
            <div class="loader"></div>
            <div class="text">Memasuki <span>EfataGemilang</span> Jaya</div>
        </div>
        
        <!-- Decorative circles -->
        <div class="decor-circle circle-1"></div>
        <div class="decor-circle circle-2"></div>
        
        <!-- LAYER 1: NAMA PERUSAHAAN -->
        <div id="layerName" class="layer-name">
            <div class="text-center px-6">
                <div class="logo-large mb-8">
                    <div class="w-32 h-32 md:w-40 md:h-40 flex items-center justify-center rotate-3 mx-auto">
    <img src="assets/image/logo.png" alt="Logo" class="w-[75%] h-[75%] object-contain">
</div>
                </div>
                <h1 class="company-name text-4xl md:text-6xl lg:text-7xl font-extrabold text-[#1e2b3a] mb-4 tracking-tight">
                    Efata<span class="text-[#C5A028]">Gemilang</span> Jaya
                </h1>
                <p class="company-tagline text-lg md:text-xl text-slate-600 max-w-2xl mx-auto leading-relaxed">
                    Mitra Terpercaya Keluarga Indonesia dalam Penyaluran Tenaga Kerja Profesional
                </p>
                <div class="mt-12 flex justify-center gap-2">
                    <div class="w-2 h-2 bg-[#C5A028] rounded-full animate-pulse"></div>
                    <div class="w-2 h-2 bg-[#C5A028] rounded-full animate-pulse" style="animation-delay: 0.2s;"></div>
                    <div class="w-2 h-2 bg-[#C5A028] rounded-full animate-pulse" style="animation-delay: 0.4s;"></div>
                </div>
            </div>
        </div>
        
        <!-- LAYER 2: GAMBAR BESAR -->
      <div id="layerImage" class="layer-image">
            <div class="image-container relative w-[1080px] h-[359px] mx-auto overflow-hidden">
                <img 
                    src="assets/image/informasi_egj.jpg" 
                    alt="Efata Gemilang Jaya - Tim Profesional"
                    class="w-full h-full object-cover"
                >
                <div class="image-overlay">
                    <h3>Efata Gemilang Jaya</h3>
                    <p>Penyalur tenaga kerja profesional & terpercaya sejak 2018</p>
                </div>
            </div>
        </div>
        
        <!-- PROGRESS BAR & COUNTDOWN -->
        <div id="loadingProgress" class="loading-progress">
            <div class="progress-bar">
                <div id="progressFill" class="progress-fill"></div>
            </div>
            <div id="countdownText" class="countdown-text">Mengarahkan ke halaman utama dalam 5 detik...</div>
        </div>
        
        <!-- SKIP LINK -->
        <a href="../egj/home/" id="skipLink" class="skip-link">
            Lewati & Langsung ke Home →
        </a>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Ambil elemen yang diperlukan
            const layerName = document.getElementById('layerName');
            const layerImage = document.getElementById('layerImage');
            const loadingProgress = document.getElementById('loadingProgress');
            const progressFill = document.getElementById('progressFill');
            const countdownText = document.getElementById('countdownText');
            const skipLink = document.getElementById('skipLink');
            const landingContainer = document.getElementById('landingContainer');
            const transitionOverlay = document.getElementById('transitionOverlay');
            
            // Timing variables (dalam detik)
            const nameDisplayDuration = 2; // Tampilan nama selama 2 detik
            const imageDisplayDuration = 3; // Tampilan gambar selama 3 detik
            const totalDuration = nameDisplayDuration + imageDisplayDuration; // Total 5 detik
            
            let currentTime = 0;
            let countdownInterval;
            
            // Fungsi untuk update progress bar dan countdown text
            function updateProgress() {
                // currentTime dalam detik
                const percent = (currentTime / totalDuration) * 100;
                progressFill.style.width = percent + '%';
                
                const remainingSeconds = Math.ceil(totalDuration - currentTime);
                countdownText.textContent = `Mengarahkan ke halaman utama dalam ${remainingSeconds} detik...`;
            }
            
            // Fungsi untuk redirect ke home dengan animasi
            function redirectToHomeWithAnimation() {
                // Hentikan interval countdown
                clearInterval(countdownInterval);
                
                // Tambahkan class exit animation ke container
                landingContainer.classList.add('exit-animation');
                
                // Tampilkan overlay transisi setelah animasi exit mulai
                setTimeout(() => {
                    transitionOverlay.classList.add('show');
                }, 300);
                
                // Redirect setelah animasi selesai
                setTimeout(() => {
                    window.location.href = '../egj/home/';
                }, 800);
            }
            
            // Fungsi untuk redirect langsung (untuk skip link)
            function redirectToHomeDirect() {
                // Hentikan interval countdown
                clearInterval(countdownInterval);
                
                // Tampilkan overlay transisi
                transitionOverlay.classList.add('show');
                
                // Redirect setelah overlay muncul
                setTimeout(() => {
                    window.location.href = '../egj/home/';
                }, 300);
            }
            
            // Mulai sequence
            setTimeout(function() {
                // Fade out layer nama
                layerName.classList.add('fade-out');
                
                // Setelah fade out selesai, show layer gambar
                setTimeout(function() {
                    layerImage.classList.add('show');
                    loadingProgress.classList.add('show');
                    skipLink.classList.add('show');
                    
                    // Mulai countdown untuk redirect
                    currentTime = nameDisplayDuration; // Sudah melewati durasi nama
                    updateProgress();
                    
                    countdownInterval = setInterval(function() {
                        currentTime += 0.1; // Update setiap 100ms
                        updateProgress();
                        
                        if (currentTime >= totalDuration) {
                            redirectToHomeWithAnimation();
                        }
                    }, 100);
                    
                }, 800); // Sinkron dengan durasi fade-out CSS (0.8s)
                
            }, nameDisplayDuration * 1000); // Tampilkan nama selama 2 detik
            
            // Skip link handler
            skipLink.addEventListener('click', function(e) {
                e.preventDefault();
                redirectToHomeDirect();
            });
            
            // Jika user mengklik gambar, bisa langsung redirect (opsional)
            layerImage.addEventListener('click', function() {
                redirectToHomeWithAnimation();
            });
        });
    </script>
</body>
</html>