/* ===============================================*/
/*    0. BASIC SETUP                              */
/* ===============================================*/
#main-content {
    visibility: hidden;
    opacity: 0;
    transition: opacity 1s ease;
}

#main-content.visible {
    visibility: visible;
    opacity: 1;
}

/* ===============================================*/
/*    1. SPLASH SCREEN CONTAINER                  */
/* ===============================================*/
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/papan_bunga.webp');
    background-size: cover;
    background-position: center;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #FFF2D9;
    opacity: 1;
    transition: opacity 1s ease;
}

#splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===============================================*/
/*    2. KONTEN & KEADAAN AWAL                    */
/* ===============================================*/
.splash-content {
    font-family: "Abhaya Libre", serif;
    font-weight: 400;
    font-style: normal;
}

/* Keadaan awal HANYA untuk elemen yang akan dianimasikan oleh CSS */
.splash-logo,
.splash-text-static,
.btn-enter {
    opacity: 0;
}

/* ===============================================*/
/*    3. DEFINISI ANIMASI (KEYFRAMES)             */
/* ===============================================*/
@keyframes slideDownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

@keyframes slideUpBtn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================*/
/*    4. MENERAPKAN ANIMASI                       */
/* ===============================================*/
#splash-screen.start-animation .splash-logo {
    animation: slideDownFadeIn 1s ease-out 0.5s forwards;
}

#splash-screen.start-animation .splash-text-static {
    animation: fadeIn 1s ease-out 1.5s forwards;
}

#splash-screen.start-animation .btn-enter {
    animation: slideUpBtn 1s ease-out 2.5s forwards;
}

/* ===============================================*/
/*    5. STYLE SPESIFIK UNTUK ELEMEN              */
/* ===============================================*/
.splash-logo {
    max-width: 300px;
    margin-bottom: 1.5rem;
}

.splash-text-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.splash-text-static {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.splash-text-dynamic-wrapper {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    height: 1.5rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    min-width: 150px;
    /* Beri lebar minimum yang cukup untuk kata terpanjang */
    text-align: left;
    /* Pastikan teks dimulai dari kiri kontainer */


    /* --- TAMBAHKAN KODE BARU DI BAWAH INI --- */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}

.splash-text-dynamic {
    position: absolute;
    left: 0;
    right: 0;
    /* Keadaan awal untuk teks dinamis, DIKONTROL OLEH JS */
    opacity: 0;
    transform: translateY(100%);
}

.btn-enter {
    font-family: "Abhaya Libre", serif;
    font-weight: 800;
    background-color: transparent;
    border: 1px solid #FFF2D9;
    color: #FFF2D9;
    padding: 10px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.btn-enter:hover {
    background-color: #fad899;
    border: 1px solid #fad899;
    color: #353535;
}

.btn-enter:focus-visible {
    border: none !important;
}

.btn-enter:active {
    background-color: #f3c673;
    border: 1px solid #f3c673;
    color: #353535;

}



/* ===============================================*/
/*    6. RESPONSIVE UNTUK MOBILE (FINAL FIX)      */
/* ===============================================*/

@media (max-width: 768px) {
    .splash-logo {
        max-width: 200px;
        margin-bottom: 1.5rem; /* Tambah jarak bawah */
    }

    /* --- PERUBAHAN UTAMA DI SINI --- */
    /* Kita kembalikan ke layout flex, tapi dengan arah kolom */
    .splash-text-line {
        flex-direction: column;
        gap: 0.5rem; /* Jarak antar baris */
        margin-bottom: 2.5rem; /* Jarak ke tombol */
    }

    .splash-text-static,
    .splash-text-dynamic-wrapper {
        font-size: 1rem; /* Perkecil font */
    }
    
    .splash-text-dynamic-wrapper {
        height: 1.2rem; /* Sesuaikan tinggi */
        text-align: center; /* Tengahkan teks dinamis */
    }
    /* --------------------------------- */

    .btn-enter {
        padding: 8px 24px;
        font-size: 0.9rem;
    }
}