:root {
	--primary-red: #8B0000;
	--accent-orange: #FF8C00;
	--light-orange: #FFF3E0;
	--dark-gray: #2d3748;
	--light-gray: #f7fafc;
	--gradient-red-orange: linear-gradient(135deg, #8B0000, #FF4500, #FF8C00);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* Floating Chat Button with breathing effect */
#creativeChatBtn {
	width: 70px;
	height: 70px;
	position: fixed;
	bottom: 40px;
	right: 40px;
	background: var(--gradient-red-orange);
	border: none;
	border-radius: 50%;
	color: white;
	font-size: 28px;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
	z-index: 10000;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {

	0%,
	100% {
		transform: scale(1);
		box-shadow:
			0 10px 30px rgba(139, 0, 0, 0.4),
			0 0 0 0 rgba(255, 69, 0, 0.7);
	}

	50% {
		transform: scale(1.08);
		box-shadow:
			0 15px 40px rgba(255, 69, 0, 0.6),
			0 0 0 10px rgba(255, 69, 0, 0);
	}

	75% {
		transform: scale(1.05);
		box-shadow:
			0 12px 35px rgba(255, 140, 0, 0.5),
			0 0 0 5px rgba(255, 140, 0, 0.2);
	}
}

#creativeChatBtn:hover {
	transform: scale(1.15) rotate(10deg);
	animation: none;
	box-shadow:
		0 15px 40px rgba(255, 69, 0, 0.7),
		0 0 0 5px rgba(255, 140, 0, 0.3);
}

/* Creative Chat Container */
#creativeChatContainer {
	position: fixed;
	bottom: 130px;
	right: 40px;
	width: 500px;
	height: 700px;
	background: white;
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(139, 0, 0, 0.15);
	z-index: 9998;
	overflow: hidden;
	border-left: 5px solid var(--accent-orange);
	display: none;
	opacity: 0;
	transform: translateY(30px) scale(0.95);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	font-family: 'Poppins', sans-serif;
}

#creativeChatContainer.open {
	display: flex !important;
	flex-direction: column;
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Chat Header */
.creative-chat-header {
	background: linear-gradient(135deg, var(--primary-red), #A52A2A);
	color: white;
	padding: 10px;
	position: relative;
	flex-shrink: 0;
	border-bottom: 3px solid var(--accent-orange);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.assistant-title {
	display: flex;
	align-items: center;
	gap: 15px;
}

.assistant-icon {
	font-size: 1.8rem;
	color: white;
	animation: gentleSway 3s ease-in-out infinite;
}

@keyframes gentleSway {

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

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

.close-creative-chat {
	background: rgba(255, 255, 255, 0.2);
	border: 2px solid rgba(255, 255, 255, 0.4);
	color: white;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	cursor: pointer;
}

.close-creative-chat:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: rotate(90deg);
}

/* Quick Topics Section */
.quick-topics-section {
	height: 220px;
	background: var(--light-orange);
	border-bottom: 2px solid #FFE0B2;
	padding: 20px;
	flex-shrink: 0;
}

/* Creative Tabs */
.creative-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	border-bottom: 2px solid #FFE0B2;
	padding-bottom: 15px;
}

.creative-tab {
	flex: 1;
	background: white;
	border: 2px solid #FFE0B2;
	color: #666;
	padding: 12px;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 0.85rem;
	position: relative;
	overflow: hidden;
}

.creative-tab.active {
	background: var(--accent-orange);
	color: white;
	border-color: var(--accent-orange);
	box-shadow: 0 5px 15px rgba(255, 140, 0, 0.2);
}

.creative-tab:hover:not(.active) {
	border-color: var(--accent-orange);
	color: var(--accent-orange);
	transform: translateY(-2px);
}

/* Topics Grid */
.topics-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px 12px;
	row-gap: 6px;
	height: 140px;
	overflow-y: auto;
	padding: 10px;
	background: white;
	border-radius: 10px;
	border: 2px solid #FFE0B2;
	align-content: start;
}

.topics-grid::-webkit-scrollbar {
	width: 6px;
}

.topics-grid::-webkit-scrollbar-thumb {
	background: linear-gradient(var(--primary-red), var(--accent-orange));
	border-radius: 3px;
}

/* Topic Buttons */
.topic-button {
	height: 38px;
	background: white;
	border: 2px solid #FFE0B2;
	color: var(--dark-gray);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 0.7rem;
	font-family: 'Poppins', sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 8px;
	overflow: hidden;
}

.topic-button:hover {
	background-color: dimgray;
	color: white;
	font-weight: 300;
}

/* Messages Area */
.creative-messages {
	flex: 1;
	overflow-y: auto;
	padding: 25px;
	background: var(--light-orange);
	will-change: transform;
}

.messages-wrapper {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Creative Message Bubbles */
.creative-message {
	max-width: 95%;
	padding: 20px;
	border-radius: 15px;
	line-height: 1.6;
	font-size: 0.95rem;
	position: relative;
	animation: creativeMessageAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
	transform-origin: center;
	opacity: 0;
	will-change: transform, opacity;
}

@keyframes creativeMessageAppear {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.assistant-message {
	background: white;
	border: 2px solid #FFE0B2;
	align-self: flex-start;
	border-top-left-radius: 5px;
	color: var(--dark-gray);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.user-message {
	background: linear-gradient(135deg, var(--accent-orange), #FF7043);
	align-self: flex-end;
	border-top-right-radius: 5px;
	color: white;
	box-shadow: 0 5px 15px rgba(255, 140, 0, 0.2);
}

/* Input Section */
.creative-input-section {
	height: 100px;
	padding: 20px;
	background: white;
	border-top: 2px solid #FFE0B2;
	flex-shrink: 0;
	position: relative;
}

.creative-input-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, var(--primary-red), var(--accent-orange));
}

.input-group-creative {
	display: flex;
	gap: 15px;
	align-items: center;
}

.creative-input {
	flex: 1;
	height: 50px;
	background: var(--light-orange);
	border: 2px solid #FFE0B2;
	border-radius: 10px;
	padding: 0 25px;
	color: var(--dark-gray);
	font-family: 'Poppins', sans-serif;
	font-size: 1rem;
	transition: all 0.2s ease;
}

.creative-input:focus {
	outline: none;
	border-color: var(--accent-orange);
	box-shadow: 0 0 20px rgba(255, 140, 0, 0.1);
	background: white;
}

.creative-input::placeholder {
	color: #999;
}

.creative-send {
	width: 50px;
	height: 50px;
	background: linear-gradient(135deg, var(--accent-orange), #FF7043);
	border: none;
	border-radius: 10px;
	color: white;
	font-size: 1.2rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.creative-send:hover {
	transform: scale(1.1) rotate(10deg);
	box-shadow: 0 10px 25px rgba(255, 140, 0, 0.3);
}

/* Typing Indicator */
.creative-typing {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 15px 20px;
	background: white;
	border-radius: 15px;
	width: fit-content;
	border: 2px solid #FFE0B2;
	margin-bottom: 20px;
	opacity: 0;
	animation: fadeIn 0.3s ease forwards;
	will-change: transform, opacity;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.creative-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--accent-orange);
	animation: creativeBounce 1.4s infinite ease-in-out;
}

.creative-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.creative-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes creativeBounce {

	0%,
	80%,
	100% {
		transform: scale(0.8);
		opacity: 0.5;
	}

	40% {
		transform: scale(1.2);
		opacity: 1;
	}
}

/* Responsive */
@media (max-width: 768px) {
	#creativeChatContainer {
		width: 95vw;
		right: 2.5vw;
		height: 85vh;
		bottom: 20px;
	}

	#creativeChatBtn {
		width: 60px;
		height: 60px;
		bottom: 20px;
		right: 20px;
		font-size: 24px;
	}

	.topics-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.sos-container {
		padding: 20px;
	}

	.sos-container h1 {
		font-size: 2rem;
	}
}

/* CRITICAL FIXES */
#creativeChatContainer {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	transition: all 0.3s ease !important;
}

#creativeChatContainer.open {
	display: flex !important;
	flex-direction: column !important;
	opacity: 1 !important;
	visibility: visible !important;
	z-index: 999998 !important;
}

#creativeChatBtn {
	z-index: 999999 !important;
	cursor: pointer !important;
	pointer-events: auto !important;
}

/* Show the chat container when .open class is added */
#creativeChatContainer {
	display: none;
}

#creativeChatContainer.open {
	display: flex;
}


.assistant-message {
	background: #ffffff !important;
	border-left: 4px solid #1a73e8 !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
	color: #2d3748 !important;
	/* Darker gray for better readability */
}

.user-message {
	background: linear-gradient(135deg, #1a73e8, #0d62d9) !important;
	box-shadow: 0 2px 4px rgba(26, 115, 232, 0.15) !important;
}

.assistant-message span[style*="color: #1a73e8"] {
	color: #0d47a1 !important;
	/* Darker blue for emphasis */
	font-weight: 600 !important;
}

/* Improve spacing between messages */
.messages-wrapper > div {
	margin-bottom: 12px !important;
}


.xlinks {
	margin-left: 30px;
	display: flex;
	font-size: 12px;
	gap: 20px;
	margin-top: -10px;
	margin-bottom: 5px;
	z-index: 100;
}