/* ============================================
   CHAT WIDGET - CENTER SCREEN (MODAL STYLE)
   ============================================ */

/* Chat widget container - tombol tetap di kanan bawah */
#chatWidget {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 9999 !important;
}

/* Chat Panel - menjadi center screen seperti modal */
#chatPanel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    bottom: auto !important;
    right: auto !important;
    width: 90% !important;
    max-width: 400px !important;
    height: auto !important;
    max-height: 90vh !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    z-index: 10000 !important;
}

/* Ukuran chat messages */
#chatMessages {
    height: 400px !important;
    max-height: 50vh !important;
}

/* Backdrop gelap saat chat terbuka (opsional) */
body.chat-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9995;
}

/* Animasi fade in untuk chat panel */
#chatPanel:not(.hidden) {
    animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Tombol close di header tetap ada */
#closeChat {
    cursor: pointer;
}

/* Responsif untuk mobile */
@media (max-width: 576px) {
    #chatPanel {
        width: 95% !important;
        max-width: 95% !important;
        border-radius: 20px !important;
    }

    #chatMessages {
        height: 350px !important;
        max-height: 60vh !important;
    }
}