#mdwc-container { position: fixed; bottom: 20px; right: 20px; z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; display: flex; flex-direction: column; align-items: flex-end; }

/* Floating Button & Icons */
#mdwc-trigger-btn { width: 60px; height: 60px; border-radius: 50%; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.3s; padding: 0; outline: none; }
#mdwc-trigger-btn:hover { transform: scale(1.05); }
.mdwc-custom-icon { width: 34px; height: 34px; object-fit: contain; }
.mdwc-default-icon { width: 34px; height: 34px; }

/* Animated Floating Text */
#mdwc-floating-text { background: #fff; color: #333; padding: 10px 16px; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); font-size: 14px; font-weight: 500; white-space: nowrap; position: absolute; right: 75px; bottom: 12px; opacity: 0; transform: translateX(20px); animation: mdwc-slide-in-text 0.5s ease forwards; animation-delay: 1s; pointer-events: none; }
#mdwc-floating-text::after { content: ''; position: absolute; top: 50%; right: -6px; transform: translateY(-50%); border-width: 6px 0 6px 6px; border-style: solid; border-color: transparent transparent transparent #fff; }
@keyframes mdwc-slide-in-text { to { opacity: 1; transform: translateX(0); } }

/* Popup Window */
#mdwc-popup { width: 320px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); margin-bottom: 15px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.mdwc-popup-header { color: #fff; padding: 25px 20px; position: relative; }
.mdwc-header-content { padding-right: 30px; }
.mdwc-header-content h4 { margin: 0 0 5px 0; font-size: 17px; color:#fff; }
.mdwc-header-content p { margin: 0; font-size: 13px; opacity: 0.9; line-height: 1.3; }

/* Modern Close Button */
#mdwc-close-btn { position: absolute; top: 15px; right: 15px; width: 30px; height: 30px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; border: none; color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.3s ease; padding: 0; line-height: 1; }
#mdwc-close-btn:hover { background: rgba(255, 255, 255, 0.4); }

/* Department List */
.mdwc-dept-list { padding: 15px; max-height: 300px; overflow-y: auto; }
.mdwc-dept-btn { display: flex; align-items: center; width: 100%; background: #f9f9f9; border: none; padding: 12px; margin-bottom: 10px; border-radius: 8px; cursor: pointer; transition: background 0.2s; text-align: left; }
.mdwc-dept-btn:hover { background: #f1f1f1; }
.mdwc-dept-btn-avatar { width: 40px; height: 40px; border-radius: 50%; background: #ddd; display: flex; justify-content: center; align-items: center; overflow: hidden; margin-right: 12px; flex-shrink: 0; }
.mdwc-dept-btn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mdwc-dept-btn-info { flex-grow: 1; display: flex; flex-direction: column; }
.mdwc-dept-btn-name { font-weight: 600; font-size: 14px; color: #333; }
.mdwc-dept-btn-status { font-size: 12px; margin-top: 2px; }
.mdwc-online { color: #25D366; }
.mdwc-offline { color: #999; }

/* Chat View */
#mdwc-chat-view { padding: 15px; display: flex; flex-direction: column; }
#mdwc-back-btn { background: none; border: none; color: #666; font-size: 13px; cursor: pointer; text-align: left; padding: 0 0 10px 0; }
.mdwc-chat-profile { display: flex; align-items: center; margin-bottom: 15px; }
#mdwc-chat-img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; margin-right: 12px; border: 1px solid #eee; }
#mdwc-chat-name { font-size: 15px; color: #333; }
#mdwc-chat-status { font-size: 12px; }
.mdwc-chat-bubble { background: #f1f1f1; padding: 12px 15px; border-radius: 0 12px 12px 12px; font-size: 14px; color: #333; margin-bottom: 20px; line-height: 1.4; }
.mdwc-chat-input-area { display: flex; flex-direction: column; gap: 10px; }
#mdwc-user-msg { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px; font-size: 14px; font-family: inherit; resize: none; box-sizing: border-box; }
#mdwc-send-btn { border: none; color: #fff; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 14px; }

/* Animations */
.mdwc-animated #mdwc-popup { animation: mdwc-slide-up 0.3s ease-out; }
@keyframes mdwc-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive adjustments */
@media (max-width: 480px) { 
    #mdwc-container { right: 15px; bottom: 15px; } 
    #mdwc-popup { width: 300px; } 
    #mdwc-floating-text { display: none; /* Hidden on very small screens to prevent overlap */ }
}