body {
    min-height: 100vh;
    background: url('bgw.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ===========================
   WRAPPER
=========================== */
.chat-wrapper {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
}

/* ===========================
   HEADER
=========================== */
.chat-header {
    padding: 15px;
    background: linear-gradient(135deg, #0d6efd, #3d8bfd);
    color: #fff;
    text-align: center;
    font-weight: 600;
    letter-spacing: .3px;
    font-size: 15px;
}

/* ===========================
   CHAT AREA
=========================== */
.chat-box {
    height: 60vh;
    padding: 16px;
    overflow-y: auto;
    background: #ece5dd;
    scroll-behavior: smooth;
}

/* Scrollbar modern */
.chat-box::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

/* ===========================
   MESSAGE ROW
=========================== */
.msg {
    margin-bottom: 12px;
    display: flex;
}

/* USER RIGHT */
.msg.user {
    justify-content: flex-end;
}

/* BOT LEFT */
.msg.bot {
    justify-content: flex-start;
}

/* ===========================
   BUBBLE
=========================== */
.bubble {
    max-width: 80%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 14px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: fadeIn 0.25s ease-in-out;
}

/* USER */
.user .bubble {
    background: linear-gradient(135deg, #dcf8c6, #c7efae);
    color: #000;
    border-bottom-right-radius: 6px;
}

/* BOT */
.bot .bubble {
    background: #fff;
    color: #000;
    border-bottom-left-radius: 6px;
}

/* LINKS */
.bubble a {
    color: #0d6efd;
    text-decoration: underline;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ===========================
   INPUT AREA
=========================== */
.chat-input {
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* INPUT WRAPPER MODERN */
.input-modern {
    display: flex;
    align-items: center; /* 🔥 FIX tombol agar tidak turun */
    gap: 8px;
    background: #ffffff;
    border-radius: 28px;
    padding: 6px 8px 6px 16px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all .25s ease;
}

/* Focus glow */
.input-modern:focus-within {
    box-shadow: 0 5px 18px rgba(13,110,253,0.2);
}

/* TEXTAREA */
.input-modern textarea {
    flex: 1;
    border: none;
    resize: none;
    outline: none;
    font-size: 14px;
    padding: 10px 0;
    font-family: inherit;
    max-height: 90px;
    line-height: 1.4;
    background: transparent;
}

/* PLACEHOLDER */
.input-modern textarea::placeholder {
    color: #999;
}

/* SEND BUTTON */
.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0d6efd, #3d8bfd);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
    flex-shrink: 0;
}

/* Hover */
.send-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 18px rgba(13,110,253,0.4);
}

/* Click */
.send-btn:active {
    transform: scale(0.92);
}

/* ===========================
   TYPING INDICATOR
=========================== */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 18px;
    width: fit-content;
    max-width: 75%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: fadeIn 0.25s ease-in-out;
}

.typing-bubble::before {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 10px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-radius: 2px;
}

.typing-text {
    font-size: 13px;
    color: #666;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ===========================
   MOBILE
=========================== */
@media (max-width: 480px) {

    .input-modern {
        padding: 6px 6px 6px 14px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* ===========================
   ANIMATION
=========================== */
@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   TEXTAREA ANIMATION
=========================== */

/* Idle breathing */
.input-modern textarea {
    animation: breathing 3s ease-in-out infinite;
}

/* Stop animasi saat fokus */
.input-modern textarea:focus {
    animation: none;
}

/* Breathing effect */
@keyframes breathing {
    0% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.85;
    }
}

.input-modern:focus-within {
    animation: glowPulse 1.8s infinite;
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 0 rgba(13,110,253,0.2);
    }
    50% {
        box-shadow: 0 0 14px rgb(0, 102, 255);
    }
    100% {
        box-shadow: 0 0 0 rgba(13,110,253,0.2);
    }
}

.input-modern textarea {
    transition: all 0.25s ease;
}

.input-modern textarea:not(:placeholder-shown) {
    padding-top: 14px;
    padding-bottom: 14px;
}

.bubble.countdown {
    background: #fff3cd;
    color: #856404;
}
.bubble.success {
    background: #d4edda;
    color: #155724;
}
/* .bubble.typing {
    opacity: .8;
} */

.online-dot {
    width: 7px;
    height: 7px;
    background-color: #22c55e;
    border-radius: 50%;
    position: relative;
}

.online-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: rgba(34, 197, 94, 0.6);
    animation: pulse 1.6s infinite ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.3);
        opacity: 0;
    }
}


