body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    background: #f8f9fa;
}

#chat-box {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.msg-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.msg-row.user {
    justify-content: flex-end;
}

.msg-row.admin {
    justify-content: flex-start;
}

.bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    word-break: break-word;
    position: relative;
}

.user .bubble {
    background: #dd5c36;
    color: #fff;
    border-bottom-right-radius: 6px;
}

.admin .bubble {
    background: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 6px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
}

.name {
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: 2px;
    word-break: break-word;
}

.time {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 4px;
    display: block;
}

.msg-row.user .time {
    text-align: right;
}

.msg-row.admin .time {
    text-align: left;
}

.msg-img {
    max-width: 220px;
    border-radius: 8px;
    display: block;
}

.chat-card {
    position: absolute;
    width: 350px;
    height: 470px;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    font-family: 'Alan Sans', sans-serif;

    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    /* sementara hidden */
}

.chat-card.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    /* aktif saat muncul */
}

/* Inner chat box */
.chat-card-inner {
    padding: 12px;
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    color: #fff;
    /* text putih agar terbaca */
}

/* Chat box area */
.chat-box {
    flex: 1;
    min-height: 50px;
    /* minimal tinggi */
    max-height: 355px;
    /* jangan lebih dari container */
    overflow-y: auto;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background-color: #ffffff;
    /* sedikit lebih terang dari card */
    box-shadow: inset 0 1px 1px rgba(130, 130, 130, 0.1);
    color: #fff;
}

/* File attachment label */
.chat-file-label {
    cursor: pointer;
    display: flex;
    align-items: center;
}

#chat-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* ambil ruang sisa */
}

/* Hide chat-card inner login/chat separately */
#chat-card.d-none {
    display: none;
}

#chat-card.flex-column {
    display: flex;
}

#typing {
    min-height: 20px;
    /* atau tinggi font */
}

/* Animasi Fade & Slide */
#confirm-close.show #confirm-card {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1);
}

#confirm-close.show {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Tombol WA Mini yang lebih 'Stand Out' */
.btn-wa-mini {
    background-color: #25D366 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    padding: 6px 15px !important;
    border: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    white-space: nowrap;
    /* Biar tulisan gak kepotong jadi 2 baris */
}

/* Efek Berdenyut supaya mata user langsung nengok */
.pulse-green {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(37, 211, 102, 0);
    }
}

/* Tambahkan sedikit background gelap tipis pada container-nya 
   biar kontras dengan teks putih */
.wa-hint-container {
    background: #f9f9f9;
    /* Warna abu sangat muda biar putihnya tombol makin keluar */
    border-bottom: 2px solid #25D366;
    border-radius: 15px;
}

/* Container utama yang menutupi seluruh chat-box */
.timeout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    /* Efek blur/transparan putih */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    /* Pastikan paling atas di dalam chat-box */
    padding: 20px;
}

/* Kotak Popup-nya */
.timeout-popup {
    background: white;
    border-radius: 20px;
    padding: 25px 20px;
    width: 100%;
    max-width: 280px;
    border: 1px solid #f0f0f0;
}

.timeout-icon-circle {
    width: 50px;
    height: 50px;
    background: #fff4e5;
    color: #ffa117;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 20px;
}

.timeout-body h5 {
    margin-bottom: 8px;
}

.timeout-body p {
    line-height: 1.5;
    margin-bottom: 15px;
}