/**
 * Dispora AI Assistant - Premium Stylesheet v3.5
 * Desain Modern, Profesional, dan Elegan.
 */

/* =========================================
   1. TOMBOL FLOATING (TOGGLE)
========================================= */
#dispora-chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    color: #fff;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#dispora-chat-toggle:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 15px 35px rgba(29, 78, 216, 0.6);
}

#dispora-chat-toggle svg {
    transition: transform 0.3s ease;
}

#dispora-chat-toggle:hover svg {
    transform: rotate(-10deg);
}

/* =========================================
   2. KOTAK CHAT UTAMA
========================================= */
#dispora-chat-box {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 620px;
    background: #f8fafc; /* Abu-abu sangat terang untuk kesan bersih */
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.8);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transform-origin: bottom right;
    animation: chatPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes chatPop {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* =========================================
   3. HEADER PREMIUM
========================================= */
#dispora-chat-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #ffffff;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bot-avatar {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(255,255,255,0.2);
}

.bot-details h3 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.bot-details p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #93c5fd;
    display: flex;
    align-items: center;
}

.status-dot {
    height: 8px;
    width: 8px;
    background-color: #34d399; /* Hijau terang */
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

#dispora-close {
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
    font-size: 20px;
}

#dispora-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* =========================================
   4. AREA PESAN (CHAT BODY)
========================================= */
#dispora-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#dispora-chat-body::-webkit-scrollbar { width: 6px; }
#dispora-chat-body::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.chat-user, .chat-bot {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-user { align-self: flex-end; align-items: flex-end; }
.chat-bot { align-self: flex-start; align-items: flex-start; }

.chat-user span {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 20px 20px 4px 20px;
    font-size: 14.5px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.chat-bot span {
    background: #ffffff;
    color: #334155;
    padding: 14px 18px;
    border-radius: 20px 20px 20px 4px;
    font-size: 14.5px;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

/* =========================================
   5. INDIKATOR MENGETIK (TYPING) PREMIUM
========================================= */
/* Membuat kotak bubble khusus ngetik lebih ramping */
.chat-bot.typing-bubble span {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 24px;
}

.typing-indicator { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.typing-indicator span { 
    width: 8px; 
    height: 8px; 
    background: #94a3b8; 
    border-radius: 50%; 
    animation: typingWave 1.3s linear infinite; 
}

/* Jeda animasi agar bergelombang mulus */
.typing-indicator span:nth-child(1) { animation-delay: -0.6s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.4s; }
.typing-indicator span:nth-child(3) { animation-delay: -0.2s; }

@keyframes typingWave {
    0%, 60%, 100% { 
        transform: translateY(0); 
        opacity: 0.5; 
    }
    30% { 
        transform: translateY(-5px); 
        opacity: 1; 
        background: #2563eb; /* Titik menyala biru saat melompat */
    }
}
/* =========================================
   6. FOOTER & INPUT MODERN
========================================= */
#dispora-chat-footer {
    padding: 18px 24px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#dispora-chat-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 14px 50px 14px 20px;
    border-radius: 30px;
    outline: none;
    font-size: 14.5px;
    color: #0f172a;
    transition: all 0.3s;
}

#dispora-chat-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#dispora-send-btn {
    position: absolute;
    right: 6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#dispora-send-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#dispora-send-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}
@keyframes chatPopOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

/* =========================================
   7. RESPONSIVE DESIGN
========================================= */
@media(max-width: 480px) {
    #dispora-chat-box { width: 100%; height: 100%; bottom: 0; right: 0; border-radius: 0; animation: slideUp 0.3s ease forwards; }
    #dispora-chat-toggle { bottom: 20px; right: 20px; }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
}