﻿/* Reset dasar */
* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	height: 100%;
	font-family: Arial, Helvetica, sans-serif;
	background: #f2f2f2;
}


/* Container utama */
.chat-app {
	width: 100%;
	max-width: 420px;
	height: 100vh;
	margin: auto;
	background: white;
	display: flex;
	flex-direction: column;
}


/* Header */
.chat-header {
	height: 60px;
	background: #1f2937;
	color: white;
	padding: 12px 18px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.chat-title {
	font-size: 20px;
	font-weight: bold;
}

.chat-status {
	font-size: 12px;
	opacity: 0.8;
}


/* Area percakapan */
.chat-log {
	flex: 1;
	overflow-y: auto;
	padding: 15px;
}


/* Pesan */
.message {
	margin-bottom: 15px;
}

.message-label {
	font-size: 12px;
	font-weight: bold;
	margin-bottom: 4px;
}

.message-text {
	padding: 10px;
	border-radius: 8px;
	line-height: 1.4;
	font-size: 14px;
}

.ai-message .message-text {
	background: #eeeeee;
}

.user-message .message-text {
	background: #d9fdd3;
}


/* Konten pesan */
.message-content {
	position: relative;
}


/* Timestamp */
.message-time {
	display: block;
	margin-top: 4px;
	text-align: right;
	font-size: 10px;
	line-height: 1;
	font-weight: 400;
	opacity: 0.55;
	white-space: nowrap;
}

.user-message .message-time {
	text-align: right;
}

.ai-message .message-time {
	text-align: right;
}


/* =========================
   WAIT / THINKING
   ========================= */

.thinking-text {
	font-size: 14px;
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.thinking-wave {
	display: inline-block;
	font-size: 16px;
	line-height: 1;
	transform-origin: 70% 70%;
	animation: waving 1.2s infinite;
}


/* Animasi waving */
@keyframes waving {

	0% {
		transform: rotate(0deg);
	}

	15% {
		transform: rotate(14deg);
	}

	30% {
		transform: rotate(-8deg);
	}

	45% {
		transform: rotate(14deg);
	}

	60% {
		transform: rotate(-4deg);
	}

	75% {
		transform: rotate(10deg);
	}

	100% {
		transform: rotate(0deg);
	}
}


/* Input */
.chat-input-area {
	display: flex;
	padding: 10px;
	border-top: 1px solid #ddd;
	gap: 8px;
}

#messageInput {
	flex: 1;
	resize: none;
	padding: 10px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 8px;
}

#sendButton {
	width: 45px;
	border: none;
	border-radius: 8px;
	background: #1f2937;
	color: white;
	font-size: 20px;
	cursor: pointer;
}


/* Untuk layar besar */
@media (min-width: 600px) {

	.chat-app {
		margin-top: 20px;
		height: calc(100vh - 40px);
		border-radius: 12px;
		overflow: hidden;
		box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	}
}

.message-text {
	text-align: justify;
}