/* Layout Fixed App-like (Desktop & Mobile) */
body, html {
    height: 100vh;
    height: 100dvh; /* Dynamic Viewport: Mencegah tertutup address bar browser di HP */
    margin: 0;
    overflow: hidden; /* Mencegah layar ditarik/scroll secara keseluruhan */
    display: flex;
    flex-direction: column;
    background-color: #121212 !important; 
}

.bg-darker {
    background-color: #0a0a0a !important;
}

/* Pembungkus area bawah navbar */
.chat-wrapper {
    flex-grow: 1;
    display: flex;
    overflow: hidden; /* Pastikan tidak ada bocoran scroll keluar */
    width: 100%;
}

/* Sidebar Chat History */
.sidebar {
    width: 260px;
    background-color: #0a0a0a;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

/* Area Chat Utama */
.main-chat {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #121212;
    position: relative;
}

/* Area Pesan yg bisa di-scroll */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

/* Area Input Chat yang fix di bawah */
.chat-input-area {
    flex-shrink: 0;
    padding: 1rem;
    background-color: #121212;
    border-top: 1px solid #333;
}

/* Kustomisasi Scrollbar (Dark Mode) */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #666; }

/* Animasi Loading ASPRI */
.thinking-anim {
    animation: pulse-spin 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pulse-spin {
    0% { transform: scale(0.95) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.05) rotate(180deg); opacity: 1; }
    100% { transform: scale(0.95) rotate(360deg); opacity: 0.7; }
}

/* Chat Input Styling */
.chat-input-group {
    border-radius: 20px;
    overflow: hidden;
}
.chat-input-group textarea {
    resize: none;
    max-height: 120px;
    box-shadow: none !important;
}
.chat-input-group textarea:focus {
    border-color: #6c757d;
}

/* Animasi Muncul Pesan */
.fade-in {
    animation: fadeIn 0.4s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}