/*
 * Frontend Chat Widget Styles
 */

/* Floating Wrapper */
.manus-chat-floating-wrapper {
    position: fixed;
    bottom: 40px; /* เพิ่มระยะห่างจากด้านล่าง */
    right: 40px; /* เพิ่มระยะห่างจากด้านขวา */
    z-index: 9999;
}

/* Embedded Wrapper */
.manus-chat-embedded-wrapper {
    position: relative;
    margin: 20px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}

/* Chat Button (Closed State) */
#manus-chat-button {
    background-color: #0073aa; /* WordPress Blue */
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

#manus-chat-button:hover {
    background-color: #005177;
}

#manus-chat-button .dashicons {
    font-size: 20px;
    margin-right: 10px;
}

/* Chat Window (Open State) */
#manus-chat-window {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    width: 350px;
    height: 450px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
}

/* Floating Window Positioning */
.manus-chat-floating-wrapper #manus-chat-window {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    position: absolute;
    bottom: 0;
    right: 0;
}

/* State Management */
.manus-chat-closed #manus-chat-button {
    display: flex;
}
.manus-chat-closed #manus-chat-window {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    display: none;
}

.manus-chat-open #manus-chat-button {
    display: none;
}
.manus-chat-open #manus-chat-window {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    display: flex;
}

/* Fullscreen Mode (for floating wrapper) */
.manus-chat-floating-wrapper.manus-chat-fullscreen #manus-chat-window {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    z-index: 10000;
}

/* Header */
#manus-chat-header {
    background-color: #0073aa;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

	#manus-chat-header .manus-chat-controls button {
	    background: none !important;
	    border: none !important;
	    color: white !important;
	    cursor: pointer !important;
	    margin-left: 5px !important;
	    padding: 0 !important;
	    line-height: 1 !important;
	    font-size: 20px !important; /* เพิ่มขนาดไอคอน */
	}

	/* New Minimize Button at the bottom */
	#manus-chat-minimize-bottom {
	    background-color: #0073aa !important;
	    color: white !important;
	    border: none !important;
	    padding: 0 !important; /* แก้ไขปัญหาปุ่มหาย */
	    cursor: pointer !important;
	    font-size: 16px !important;
	    line-height: 1 !important;
	    border-radius: 4px !important;
	    margin-left: 5px !important;
	    display: flex !important;
	    align-items: center !important;
	    justify-content: center !important;
	    height: 38px !important; /* Match send button height */
	    width: 38px !important; 
	}

/* Announcement */
#manus-chat-announcement {
    background-color: #fff3cd; /* Light yellow background for visibility */
    color: #856404; /* Dark yellow text */
    padding: 10px;
    font-size: 16px;
    border-bottom: 1px solid #ffeeba;
    text-align: center;
    font-weight: bold; /* Make it stand out */
}

/* Messages Area */
#manus-chat-messages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f4f4f4;
}

.manus-chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.manus-chat-message.user-message {
    background-color: #0073aa;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.manus-chat-message.admin-message {
    background-color: #e5e5ea;
    color: #333;
    align-self: flex-start;
    margin-right: auto;
}

.manus-chat-message.system-message {
    text-align: center;
    background: none;
    font-style: italic;
    font-size: 14px;
    color: #666;
    max-width: 100%;
}

.manus-chat-message.announcement-message {
    background-color: #fff3cd; /* Light yellow background for visibility */
    color: #856404; /* Dark yellow text */
    font-weight: bold;
    border-radius: 5px;
    margin: 10px auto;
    padding: 10px;
    max-width: 90%;
    font-style: normal;
}

/* Input Area */
#manus-chat-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    align-items: flex-end; /* จัดให้ปุ่มอยู่ด้านล่าง */
}

#manus-chat-input {
    flex-grow: 1;
    resize: none;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 5px; /* ลดระยะห่าง */
    height: 38px; /* กำหนดความสูงคงที่ */
}

#manus-chat-send-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    height: 38px; /* กำหนดความสูงคงที่ */
}

#manus-chat-send-button:hover {
    background-color: #218838;
}
