/* =============================================
   UTILITIES.CSS — Elemen floating: preloader, scroll progress, back-to-top, WhatsApp
   Berisi elemen UI fixed/floating yang tampil di seluruh halaman.
   ============================================= */

/* --- Preloader (animasi loading saat website pertama kali dibuka) --- */
.preloader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--sky-500) 0%, var(--sky-600) 40%, var(--sky-700) 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    text-align: center;
}

.preloader-logo {
    animation: preloaderPulse 1.5s ease-in-out infinite;
}

.preloader-logo img {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.3));
}

.preloader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 30px auto 16px;
    overflow: hidden;
}

.preloader-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--cloud-white);
    border-radius: 4px;
    animation: preloaderFill 1.8s ease-in-out forwards;
}

.preloader-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes preloaderPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes preloaderFill {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* --- Scroll Progress Bar (garis progress di atas halaman) --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--sky-400), var(--sky-300), var(--sky-200));
    z-index: 10001;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* --- Back to Top Button (tombol kembali ke atas) --- */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-button);
    color: var(--cloud-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-cloud);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s var(--ease-smooth);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-cloud-hover);
}

/* --- WhatsApp Floating Button (tombol WA mengambang) --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s var(--ease-smooth);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}

/* Pulse ring animasi */
.wa-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: waPulse 2s ease-out infinite;
}

@keyframes waPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Tooltip teks */
.wa-tooltip {
    position: absolute;
    right: 70px;
    background: var(--cloud-white);
    color: var(--deep-blue);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-float:hover .wa-tooltip {
    opacity: 1;
    transform: translateX(0);
}