:root {
    --bs-primary-rgb: 8, 86, 172;
    --bs-body-bg: #f0f2f5;
}

html, body {
    height: 100%;
    overflow: hidden; /* Mencegah double scrollbar */
}

#app {
    height: 100%;
}

.app-header {
    height: 60px;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.app-main {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

#tree {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* Chatroom Floating */
.chatroom-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--bs-primary);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1050;
    transition: transform 0.2s ease-in-out;
}
.chatroom-fab:hover {
    transform: scale(1.1);
}

.chatroom-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    z-index: 1049;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}
.chatroom-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.messages-area {
    flex-grow: 1;
    overflow-y: auto;
}
.message-wrapper { margin-bottom: 10px; display: flex; }
.message-bubble { padding: 8px 15px; border-radius: 20px; max-width: 80%; }
.message-sender { font-weight: bold; font-size: 0.8rem; margin-bottom: 2px; }
.my-message { background-color: #0d6efd; color: white; margin-left: auto; }
.my-message .message-sender { color: #e0e0e0; }
.alert-sm { padding: 0.5rem 1rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 991.98px) {
    html, body { overflow: auto; }
    #app, .app-main { overflow: visible; }
    .chatroom-window {
        width: calc(100% - 40px);
    }
}