/**
 * Public-facing chat widget styles.
 *
 * @package AI_Website_Chatbot
 */

/* ==========================================================================
   1. Widget Container & Positioning
   ========================================================================== */

#awc-chat-widget {
	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}

#awc-chat-widget *,
#awc-chat-widget *::before,
#awc-chat-widget *::after {
	box-sizing: border-box;
}

.awc-position-bottom-right {
	bottom: 20px;
	right: 20px;
}

.awc-position-bottom-left {
	bottom: 20px;
	left: 20px;
}

/* ==========================================================================
   2. Floating Toggle Button
   ========================================================================== */

#awc-chat-toggle-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var( --awc-primary-color, #0073aa );
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.15 );
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#awc-chat-toggle-btn:hover {
	transform: scale( 1.08 );
	box-shadow: 0 6px 16px rgba( 0, 0, 0, 0.2 );
}

#awc-chat-toggle-btn:focus {
	outline: 2px solid var( --awc-primary-color, #0073aa );
	outline-offset: 3px;
}

/* ==========================================================================
   3. Chat Window
   ========================================================================== */

#awc-chat-window {
	position: absolute;
	bottom: 75px;
	right: 0;
	width: 340px;
	height: 460px;
	background-color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.2 );
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 1;
	transform: translateY( 0 ) scale( 1 );
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.awc-position-bottom-left #awc-chat-window {
	right: auto;
	left: 0;
}

/* Hidden state — controlled via JavaScript by toggling this class */
#awc-chat-window.awc-hidden {
	opacity: 0;
	transform: translateY( 10px ) scale( 0.95 );
	pointer-events: none;
	visibility: hidden;
}

/* ==========================================================================
   4. Chat Header
   ========================================================================== */

.awc-chat-header {
	background-color: var( --awc-primary-color, #0073aa );
	color: #ffffff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.awc-chat-title {
	font-weight: 600;
	font-size: 15px;
}

#awc-chat-close-btn {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	opacity: 0.85;
	transition: opacity 0.15s ease;
}

#awc-chat-close-btn:hover {
	opacity: 1;
}

/* ==========================================================================
   5. Chat Messages Area
   ========================================================================== */

#awc-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background-color: #f7f7f8;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.awc-message {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
}

.awc-message-bot {
	align-self: flex-start;
	background-color: #ffffff;
	color: #222222;
	border: 1px solid #e5e5e5;
	border-bottom-left-radius: 4px;
}

.awc-message-user {
	align-self: flex-end;
	background-color: var( --awc-primary-color, #0073aa );
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

/* ==========================================================================
   6. Chat Input Area
   ========================================================================== */

.awc-chat-input-area {
	display: flex;
	align-items: center;
	padding: 12px;
	border-top: 1px solid #e5e5e5;
	background-color: #ffffff;
	flex-shrink: 0;
	gap: 8px;
}

#awc-chat-input {
	flex: 1;
	border: 1px solid #d5d5d5;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s ease;
}

#awc-chat-input:focus {
	border-color: var( --awc-primary-color, #0073aa );
}

#awc-chat-send-btn {
	background-color: var( --awc-primary-color, #0073aa );
	color: #ffffff;
	border: none;
	border-radius: 20px;
	padding: 9px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
	flex-shrink: 0;
}

#awc-chat-send-btn:hover {
	opacity: 0.9;
}

/* ==========================================================================
   7. Responsive — Small Screens (Mobile)
   ========================================================================== */

@media ( max-width: 480px ) {

	#awc-chat-window {
		width: calc( 100vw - 40px );
		height: 70vh;
	}
}

/* ==========================================================================
   8. Typing Indicator
   ========================================================================== */

.awc-typing-indicator {
	font-style: italic;
	color: #999999;
}