/* Define color variables */
:root {
	--bg: #131313; /* Off-black */
	--color1: #f54b73; /* Pink */
	--foreground: #131313; /* Dark greyish */
	--text-color: #e0e0e0; /* Light grey for text */
	--accent: #d14d7b; /* Pink */
	--error: #ff4444; /* Red for errors */
	--success: #44ff44; /* Green for success */
	--grey-border: #222222;
	--color2: #5c4bf5;
	--color2-dark: #4539c6;
	--header-height: 60px;
	--color1-faded: rgba(73, 36, 49, 0.737);
	--message-bg-color: 2a2a2a;
}

.basic-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 30px;
	background-color: var(--foreground);
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	width: 100%;
	margin: 20px auto;
	max-width: 400px; /* Limit width for larger screens */
}

/* Basic Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	scrollbar-width: thin;
	scrollbar-color: #f54b7331 #222;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--bg);
	color: var(--text-color);
	font-family: Montserrat, sans-serif;
	display: grid;
	grid-template-columns: 1fr; /* Only main content column now */
	grid-template-areas: "main"; /* Only main area now */
	grid-template-rows: 1fr;
	height: 100vh;
	overflow: hidden;
	padding-top: var(--header-height);
	/* background-image: url("https://05f5772df6a6b9847df8c77cc97a2c19.cdn.bubble.io/f1724545077454x336295181208753800/wavey-fingerprint.svg"); */
}

.importIframe {
	width: 100vw;
	max-width: 100vw;
	height: 100%;
	border: none;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.wip-message {
	background-color: var(--foreground);
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	margin: 50px auto;
	max-width: 500px;
	color: white; /* ensures text is visible */
	background:
		linear-gradient(rgba(0, 0, 0, 0.2), /* top black gradient */ rgba(0, 0, 0, 0.3)),
		linear-gradient(to bottom right, #f54b7377, rgba(0, 0, 0, 0.4)),
		url("https://pub-7d5fd4886c1d4f408c18f163c2b1dd86.r2.dev/ani-banner.webp") no-repeat center center;
	background-size: cover;
}
#wipMessage span {
	font-size: 14px;
}

#hero-links span,
a {
	color: #414bdd;
	padding: 4px 8px;
	border-radius: 20px;
	font-weight: 600;
	font-size: 0.85em;
	text-decoration: none;
	cursor: pointer;
}

#supportPopup a {
	width: 200px;
	min-width: 200px;
	text-align: center;
}

/* Black overlay */
#wipMessage::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3); /* adjust opacity as needed */
	z-index: 0;
}

/* Keep content above overlay */
#wipMessage > * {
	position: relative;
	z-index: 1;
}

.wip-message h2 {
	color: #ffffffc4;
	font-size: medium;
}

.row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 10px;
}

.col {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.header {
	grid-area: header;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--header-height);
	z-index: 1000;
}

.header h1 {
	color: var(--color1);
}

.header a {
	text-decoration: none;
	color: var(--color1);
}

.user-area {
	display: flex;
	align-items: center;
}

.login-btn {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	transition: background-color 0.2s;
}

.login-btn:hover {
	background-color: #ff45a3;
}

.user-info {
	display: flex;
	align-items: center;
	gap: 15px;
}

#username {
	font-weight: bold;
}

#tokens {
	display: none;
	background-color: rgba(255, 105, 180, 0.2);
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 0.9em;
}

.left-nav {
	width: 250px;
	/* height: calc(100vh - var(--header-height)); */ /* Full height minus header */
	background-color: #131313;
	border-right: 1px solid #2a2a2a;
	padding: 0px 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1100;
	overflow-y: auto;
	height: 100vh;
}

.nav-item {
	cursor: pointer;
	transition: background-color 0.2s;
	margin-bottom: 5px;
	width: 100%;
	position: relative;
}

.nav-item a {
	display: flex;
	align-items: center;
	padding: 12px 20px;
	text-decoration: none;
	color: inherit;
	width: 100%;
	box-sizing: border-box;
}

.nav-item:hover,
.nav-item.active {
	background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
	border-left: 3px solid var(--color1);
}

.nav-item.active a {
	padding-left: 17px;
}

.nav-item i {
	font-size: 1.2rem;
	margin-right: 12px;
	flex-shrink: 0;
}

.nav-item span {
	flex-grow: 1;
}

.nav-item.premium {
	color: var(--color1);
	margin-top: 10px;
}

.nav-item.premium i {
	color: var(--color1);
}

.nav-item.premium span {
	color: var(--color1);
}

.nav-top {
	display: flex;
	flex-direction: column;
}

.nav-bottom {
	margin-top: auto;
	display: flex;
	flex-direction: column;
}

.nav-footer {
	border-top: 1px solid var(--grey-border);
	padding-top: 0px;
	padding-bottom: 10px;
}

.footer-links {
	display: flex;
	justify-content: center;
	padding: 10px 20px;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.6);
}

.footer-links a {
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
}

.footer-links a:hover {
	text-decoration: underline;
}

.dot-separator {
	margin: 0 5px;
}

.main-content {
	margin-top: 50px;
	grid-area: main;
	padding: 20px;
	overflow-y: auto; /* Allow scrolling if content exceeds height */
	margin-left: 250px; /* Space for fixed left nav */
}

/* Page Management */
.page {
	display: none;
}

.page.active {
	display: block;
}

.hero-section {
	background-color: var(--foreground);
	min-height: 300px; /* Example height */
	margin-bottom: 30px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	border: 1px solid var(--color1);
	padding: 30px;
	text-align: center;
	max-width: 850px;
}

.hero-section h2 {
	margin-bottom: 20px;
	color: var(--color1);
	font-size: 2.5rem;
}

.hero-section p {
	font-size: 1.2rem;
	max-width: 600px;
}

.character-grid h2 {
	margin-top: 25px;
	margin-bottom: 20px;
	color: var(--color1);
}

.grid-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Wider minimum size */
	gap: 25px; /* Increased gap between cards */
	justify-items: center; /* Center cards in grid cells */
	margin-bottom: 20px;
}

.character-card {
	background-color: var(--foreground);
	border-radius: 16px;
	overflow: hidden; /* Ensures image corners are rounded */
	border: none; /* Remove border */
	transition:
		transform 0.2s ease-in-out,
		box-shadow 0.2s ease-in-out;
	cursor: pointer;
	width: 100%; /* Take full width of the grid cell */
	max-width: 350px; /* But not exceed this width */
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
	position: relative; /* For absolute positioning of bottom content */
	height: 600px; /* Increased height for taller image */
	aspect-ratio: 1/2.2; /* Taller portrait ratio */
	min-width: 260px;
}

.character-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 20px rgba(199, 46, 87, 0.5);
}

.character-card img {
	width: 100%;
	height: 100%; /* Fill entire card height */
	object-fit: cover; /* Cover the area, might crop */
	display: block;
	position: absolute; /* Position absolutely */
	top: 0;
	left: 0;
}

.character-card .bottom-content {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 60%, rgba(0, 0, 0, 0.3) 80%, rgba(0, 0, 0, 0) 100%);
	padding: 25px 15px 0; /* Top and side padding */
	padding-bottom: 0; /* Explicit zero bottom padding */
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.character-card .bottom-content:hover {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.2) 80%, rgba(0, 0, 0, 0) 100%);
	padding: 25px 15px 0; /* Top and side padding */
	padding-bottom: 0; /* Explicit zero bottom padding */
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.character-card h3 {
	margin: 0 0 5px 0;
	color: white;
	font-size: 1.6em;
	font-weight: 600;
}

.character-card .tagline {
	margin: 0 0 2px 0;
	font-size: 0.9em;
	color: #ccc;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Age element next to name if needed */
.character-card .age {
	display: inline-block;
	margin-left: 5px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85em;
	vertical-align: text-bottom;
}

/* Age element next to name if needed */
.character-card .name {
	display: inline-block;
	color: rgba(223, 47, 120, 0.866);
	font-size: 22px;
	vertical-align: text-bottom;
	text-shadow: 1px 1px 0 #000;
}

#char-generic-tags > .pill-tag {
	font-size: 0.6em;
	max-width: 500px;
	text-overflow: ellipsis;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
}

#char-generic-tags > .pill-tag.active {
	background-color: var(--color1);
	font-size: 0.6em;
}

#Waifu-Dungeon-intro ul li {
	margin-bottom: 10px;
	font-style: italic;
}

#Waifu-Dungeon-intro ul li a {
}

#Waifu-Dungeon-intro ul li::marker {
	content: "";
}

.pill-home {
	display: flex;
	flex-direction: row;
	overflow-x: auto;
	white-space: nowrap;
	gap: 0.5rem; /* Optional: adds spacing between pill tags */
	padding: 0.5rem 0; /* Optional: gives breathing room */
	scrollbar-width: thin; /* Firefox */
	pointer-events: none;
}

.pill-home::-webkit-scrollbar {
	display: none;
}

.pill-home {
	-ms-overflow-style: none; /* IE/Edge */
	scrollbar-width: none; /* Firefox */
}

.pill-tag {
	flex: 0 0 auto; /* Prevent shrinking, allow horizontal scroll */
}

.pill-tags {
	pointer-events: none;
	overflow-y: hidden;
	white-space: nowrap;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* Internet Explorer and Edge */
	color: var(--text-color);
	padding: 7px 7px;
	margin: 2px;
	font-size: 0.8em;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	user-select: none; /* Prevent text selection during drag */
	margin-right: 0px;
}

.pill-tags::-webkit-scrollbar {
	height: 4px;
}

.pill-tags::-webkit-scrollbar-thumb {
	background: #666;
	border-radius: 4px;
}

.pill-tag {
	background-color: #444444b4; /* Darker background for pills */
	color: var(--text-color);
	padding: 7px 7px;
	border-radius: 15px;
	margin: 2px;
	font-size: 0.8em;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.aboutme {
	font-size: 11px;
	color: #aaa;
	margin-bottom: 10px;
	text-shadow: 1px 1px 0 #000;
}

.icon-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-right: 4px;
	color: white;
}

.character-card .chat-button {
	background-color: var(--color1);
	color: white;
	padding: 10px 0;
	border: none;
	cursor: pointer;
	border-radius: 0 0 16px 0;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	transition: background-color 0.2s;
}

.character-card .chat-button:hover {
	background-color: #ff45a3;
}

.chat-button .chat-icon {
	margin-left: 5px; /* Space between text and icon */
}

/* Login Modal */
.modal {
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.7);
	overflow: auto;
	/* Use flexbox for perfect centering */
	align-items: center;
	flex-direction: column;
}

.modal-content {
	background-color: var(--foreground);
	margin: 0;
	padding: 20px;
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	/* Add viewport height constraints */
	overflow-y: auto;
	position: relative;
	margin-top: auto;
	margin-bottom: auto;
}

/* Show modal when active - override display: none with flexbox */
.modal[style*="block"] {
	display: flex !important;
}

#voiceTokensBtn {
	font-family: Montserrat, sans-serif;
	max-width: 550px; /* Increased max width */
	margin: 0; /* Remove auto margin, flexbox handles centering */
	margin-top: 20px;
	background: linear-gradient(135deg, #5c8ff6 0%, #4644a7 25%, #9333ea 50%, #5d6ec7 75%, #6d28d9 100%);
	background-size: 200% 200%;
	border-radius: 12px; /* Slightly larger border radius */
	color: #fff;
	font-family: sans-serif;
	box-shadow:
		0 8px 16px rgba(0, 0, 0, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Added shadow and inner highlight */
	position: relative;
	overflow: hidden;
	border-radius: 50px;
	padding: 9px 20px;
	font-size: 16px;
	text-shadow: 3px 2px #00000061;
}

#voiceTokensBtn::before {
	content: "";
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Specific fix for lowTokenspopup modal */
#lowTokenspopup.modal {
	background-image: url("/assets/sad.webp");
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	/* Use flexbox for perfect centering */
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	/* Add fade-in animation */
	animation: fadeInModal 0.5s ease-in-out;
	backdrop-filter: blur(20px);
	background-color: rgba(68, 18, 71, 0.632);
}

#noVoiceTokens.modal {
	background-image: url("/assets/sadvoice.png");
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(68, 18, 71, 0.632);
	/* Use flexbox for perfect centering */
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	/* Add fade-in animation */
	animation: fadeInModal 0.5s ease-in-out;
	backdrop-filter: blur(20px);
}

/* Fade-in animation for lowTokenspopup modal */
@keyframes fadeInModal {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

#lowTokenspopup .modal-content {
	background-color: #00000035;
	margin: 0;
	padding: 20px;
	border: 0px solid var(--color1);
	border-radius: 8px;
	width: 90%;
	max-width: 500px;
	/* Constrain height to viewport */
	max-height: 85vh;
	overflow-y: auto;
	transform: translateY(-30%);
}

/* Show lowTokenspopup modal when active */
#lowTokenspopup.modal[style*="block"] {
	display: flex !important;
	flex-direction: column;
	justify-content: flex-end;
}

/* Beta Welcome modal - same style as lowTokenspopup */
#betaWelcome.modal {
	background-image: url("/assets/beta.png");
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.829);
	/* Use flexbox for perfect centering */
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	/* Add fade-in animation */
	animation: fadeInModal 0.5s ease-in-out;
}

#betaWelcome .modal-content {
	background-color: #00000035;
	margin: 0;
	padding: 20px;
	border: 0px solid var(--color1);
	border-radius: 8px;
	width: 90%;
	max-width: 500px;
	/* Constrain height to viewport */
	max-height: 85vh;
	overflow-y: auto;
	transform: translateY(-30%);
}

/* Show betaWelcome modal when active */
#betaWelcome.modal[style*="block"],
#betaWelcome.modal[style*="flex"] {
	display: flex !important;
	flex-direction: column;
	justify-content: flex-end;
}

#buyTokensButton {
	padding: 15px 30px;
	font-size: 18px;
	font-weight: bold;
	text-transform: uppercase;
	color: #fff;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	background: linear-gradient(45deg, #ff69b4, #ff1493, #c71585, #9400d3, #ff69b4);
	background-size: 200% 200%;
	animation: colorShift 3s linear infinite;
	box-shadow: 0 0 20px rgba(255, 105, 180, 0.7);
}

@keyframes colorShift {
	0% {
		background-position: 0% 50%;
	}
	100% {
		background-position: 200% 50%;
	}
}

.close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
}

.close:hover {
	color: var(--color1);
}

/* Google Sign-In Styles */
#clerkModal .modal-content {
	background-color: var(--foreground);
	max-width: 400px;
	padding: 0;
	text-align: center;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	border: 1px solid var(--color1);
	transition: all 0.3s ease;
	/* Ensure modal fits within viewport */
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 12px;
}

/* Ensure the modal uses flexbox centering only when shown */
#clerkModal[style*="block"] {
	display: flex !important;
	align-items: center;
	justify-content: center;
}

/* Style the image container to be responsive */
#clerkModal .modal-content > div:first-child {
	position: relative;
	max-height: 60vh; /* Limit image container height */
	overflow: hidden;
}

/* Make the image responsive and constrain its height */
#clerkModal .modal-content img {
	width: 100%;
	height: auto;
	max-height: 60vh; /* Prevent image from being too tall */
	object-fit: cover;
	display: block;
}

/* Ensure the auth content section has proper padding */
#clerkModal .modal-content > div:last-child {
	padding: 20px;
}

#clerkModal .close {
	position: absolute;
	top: 10px;
	right: 15px;
	transition: all 0.2s ease;
	z-index: 10; /* Ensure close button is above image */
}

#google-sign-in {
	margin: 20px auto 10px;
	display: flex;
	justify-content: center;
}

#google-sign-in::before {
	content: "Login or Sign Up";
	display: block;
	font-size: 18px;
	font-weight: 500;
	margin-bottom: 20px;
	position: absolute;
	top: 20px;
	color: #fff;
	text-shadow: 0 0 10px #535353;
}

/* Login Loader */
.login-loader {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	margin-top: 30px;
}

.login-loader p {
	margin-top: 15px;
	color: var(--text-color);
	font-size: 16px;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(245, 75, 115, 0.3);
	border-radius: 50%;
	border-top-color: var(--color1);
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.form-group {
	margin-bottom: 15px;
}

.form-group label {
	display: block;
	margin-bottom: 5px;
}

.form-group input,
textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #444;
	background-color: #252525;
	color: var(--text-color);
	border-radius: 6px;
	margin-top: 10px;
	font-family: Montserrat, sans-serif;
}

/* textarea:focus {
	min-height: 200px !important;
	font-size: 16px;
}
 */
#name-input-sidebar {
	font-size: 20px;
	width: 100%;
	padding: 8px;
	border: 0px solid #444;
	background-color: #22222223;
	color: var(--text-color);
	border-radius: 6px;
	margin-bottom: 10px;
	text-align: center;
}

#name-input-sidebar:hover,
#name-input-sidebar:focus {
	width: 100%;
	padding: 8px;
	border: 1px solid #444;
	background-color: #222;
	color: var(--text-color);
	border-radius: 4px;
	margin-bottom: 10px;
}

input[type="range"] {
	padding: 0;
}

#submitLoginBtn {
	width: 100%;
	padding: 10px;
	background-color: var(--color1);
	color: white;
	border: none;
	border-radius: 4px;
	margin-top: 10px;
}

#submitLoginBtn:hover {
	background-color: #ff45a3;
}

/* Chat Page */
.chat-header {
	display: flex;
	align-items: center;
	gap: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #444;
	margin-bottom: 15px;
}

.chat-header h2 {
	flex: 1;
	margin: 0;
	font-size: 1.3rem;
}

.chat-header-actions {
	display: flex;
	gap: 10px;
}

#header > .action-btn {
	color: red;
	border: 0px;
}

.action-btn {
	background-color: #a5a5a526;
	border: 1px solid #444;
	color: var(--text-color);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	padding: 5px 5px;
}

.action-btn i {
	text-shadow: -1px 1px 6px black;
}

.action-btn:hover {
	border-color: var(--color1);
	color: var(--color1);
}

.call-btn {
	background-color: var(--color1);
	color: white;
	border: none;
}

.call-btn:hover {
	background-color: #ff45a3;
}

.back-btn {
	background-color: transparent;
	border: 1px solid #444;
	color: var(--text-color);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chat-container {
	display: flex;
	margin-top: 19px;
	margin-bottom: 13px;
	height: calc(100vh - 105px);
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 4px 4px 18px -7px #000000bf;
	width: 100%; /* Ensure chat container takes full width on desktop */
}

/* Chat sidebar with contacts */
.chat-sidebar {
	width: 350px;
	border-right: 1px solid #2a2a2a;
	display: flex;
	flex-direction: column;
	background-color: #1313134c;
	backdrop-filter: blur(10px);
}

/* Chat search bar */
.chat-search {
	padding: 15px;
	position: relative;
	border-bottom: 1px solid #2a2a2a;
}

.chat-search input {
	width: 100%;
	background-color: #1f1f1f;
	border: 1px solid #333;
	border-radius: 20px;
	padding: 10px 15px 10px 40px;
	color: var(--text-color);
	font-size: 14px;
}

.chat-search input:focus {
	outline: none;
	border-color: var(--color1);
}

.search-icon {
	position: absolute;
	left: 25px;
	top: 50%;
	transform: translateY(-50%);
	color: #666;
	font-size: 18px;
}

/* Chat contacts list */
.chat-contacts {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

.contact {
	display: flex;
	padding: 15px;
	border-bottom: 1px solid #ffffff29;
	cursor: pointer;
	transition: background-color 0.2s ease;
	position: relative;
}

.contact:hover,
.contact.active {
	background-color: #5f1e439f;
}

/* Load older chats element - always stays at bottom */
.load-older-chats {
	position: sticky;
	bottom: 0;
	background-color: #131313;
	border-top: 1px solid #333;
	margin-top: auto;
	cursor: pointer;
	transition: background-color 0.2s ease;
	z-index: 10;
}

.load-older-chats:hover {
	background-color: #2a2a2a;
}

.load-older-content {
	padding: 15px;
	text-align: center;
}

.load-older-text {
	color: #888;
	font-size: 14px;
	font-weight: 500;
}

.load-older-text i {
	margin-right: 8px;
	font-size: 16px;
}

.conversation-item:hover {
	background-color: #5f1e439f;
}

.contact-image {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	overflow: hidden;
	margin-right: 15px;
	flex-shrink: 0;
}

.contact-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.contact-details {
	flex: 1;
	min-width: 0; /* Allows ellipsis to work properly */
}

.contact-name {
	font-weight: bold;
	margin-bottom: 5px;
	color: #fff;
}

.contact-last-message {
	color: #ededed;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px; /* Adjust based on your layout */
}

.contact-date {
	font-size: 12px;
	color: #777;
	position: absolute;
	top: 15px;
	right: 15px;
}

/* Chat main area */
.chat-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.message {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 18px;
	line-height: 1.4;
	font-size: 14px;
}

.user-message {
	align-self: flex-end;
	background-color: var(--color1);
	color: white;
	border-bottom-right-radius: 4px;
}

.bot-message {
	align-self: flex-start;
	background-color: #2a2a2a;
	border-bottom-left-radius: 4px;
}

.chat-input {
	padding: 15px;
	display: flex;
	gap: 10px;
	background-color: #1a1a1a;
	border-top: 1px solid #2a2a2a;
	position: sticky;
	bottom: 0;
}

/* Updated message input and send button */
#messageInput {
	flex: 1;
	padding: 12px 15px;
	border: 1px solid #333;
	background-color: #1f1f1f;
	color: var(--text-color);
	border-radius: 10px;
	min-height: 45px;
	max-height: 120px;
	font-size: 11px;
	outline: none;
	transition: border-color 0.2s ease;
}

#messageInput:focus {
	border-color: var(--color1);
	font-size: 13px;
}

#sendBtn,
#activateMic,
#companionToggle {
	background-color: #f54b73;
	backdrop-filter: blur(5px);
	color: white;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition:
		transform 0.2s ease,
		background-color 0.2s ease;
}

#sendBtn:hover {
	background-color: #ff5b84; /* Slightly lighter than --color1 */
	transform: scale(1.05);
}

#sendBtn:active {
	transform: scale(0.95);
}

.loading {
	text-align: center;
	padding: 20px;
	color: #aaa;
}

.login-required {
	text-align: center;
	padding: 30px;
	color: #888;
	font-style: italic;
}

/* Conversation list styles */
.conversations-container {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 20px;
}

.conversation-card {
	display: flex;
	background-color: var(--foreground);
	border-radius: 8px;
	padding: 15px;
	gap: 15px;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease;
	border: 1px solid #444;
}

.conversation-card:hover {
	transform: translateY(-3px);
	border-color: var(--color1);
}

.conversation-image {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.conversation-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.conversation-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.conversation-info h3 {
	margin-bottom: 5px;
	color: var(--text-color);
}

.conversation-date {
	color: #aaa;
	font-size: 0.9em;
}

/* Account page styles */
.account-card {
	background-color: var(--foreground);
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
}

.account-fields {
	margin: 20px 0;
}

.account-field {
	margin-bottom: 15px;
	display: flex;
	flex-direction: column;
}

.account-field label {
	font-weight: bold;
	margin-bottom: 5px;
	color: #aaa;
}

.editable-field {
	display: flex;
	align-items: center;
	gap: 10px;
}

.edit-btn {
	background-color: transparent;
	border: 1px solid #555;
	color: var(--text-color);
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 0.8em;
}

.edit-btn:hover {
	border-color: var(--color1);
	color: var(--color1);
}

.edit-field {
	display: flex;
	gap: 10px;
	margin-top: 5px;
}

.edit-field input,
.edit-field select {
	flex: 1;
	background-color: #222;
	border: 1px solid #444;
	padding: 8px;
	border-radius: 4px;
	color: var(--text-color);
}

.save-btn {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 0 10px;
	border-radius: 4px;
}

.save-btn:hover,
#create-core-memory-slot:hover {
	background-color: #ff45a2bb;
}

.account-actions {
	display: flex;
	gap: 15px;
	margin-top: 20px;
}

.logout-btn {
	background-color: transparent;
	border: 1px solid #555;
	color: var(--text-color);
	padding: 8px 16px;
	border-radius: 4px;
}

.logout-btn:hover {
	border-color: var(--error);
	color: var(--error);
}

.delete:hover {
	border-color: var(--error);
	color: red;
}

/* Token purchase styles */
.token-packages {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px;
	margin: 25px 0;
}

.token-package {
	background-color: #2a2a2a;
	border-radius: 8px;
	padding: 20px 15px;
	display: flex;
	flex-direction: column;
	align-items: center;
	border: 1px solid #444;
	position: relative;
	transition: transform 0.2s ease;
}

.token-package:hover {
	transform: translateY(-5px);
}

.token-package.highlight {
	border-color: var(--color1);
	background-color: rgba(255, 105, 180, 0.1);
}

.best-value {
	position: absolute;
	top: -10px;
	right: -10px;
	background-color: var(--color1);
	color: white;
	font-size: 0.8em;
	padding: 3px 8px;
	border-radius: 12px;
	font-weight: bold;
}

.token-package h4 {
	margin-bottom: 10px;
	font-size: 1.2em;
}

.token-price {
	font-size: 1.5em;
	margin-bottom: 15px;
	color: var(--color1);
	font-weight: bold;
}

.buy-package-btn {
	width: 100%;
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 8px;
	border-radius: 4px;
}

.buy-package-btn:hover {
	background-color: #ff45a3;
}

#backToAccountBtn {
	margin-top: 15px;
}

/* Error and success messages */
.error {
	color: var(--error);
	text-align: center;
	padding: 15px;
}

.success {
	color: var(--success);
	text-align: center;
	padding: 15px;
}

/* Feedback Messages */
.feedback-message {
	margin: 10px 0;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 0.9em;
	display: none; /* Hidden by default */
	z-index: 99999;
}

.feedback-message.error {
	display: block;
	background-color: rgba(255, 68, 68, 0.2);
	color: var(--error);
	border: 1px solid var(--error);
}

.feedback-message.success {
	display: block;
	background-color: rgba(68, 255, 68, 0.2);
	color: var(--success);
	border: 1px solid var(--success);
}

.feedback-message.info {
	display: block;
	background-color: rgba(68, 68, 255, 0.2);
	color: #6666ff;
	border: 1px solid #6666ff;
}

/* Feedback Toast (for logout, etc.) */
.feedback-toast {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background-color: #333;
	color: white;
	padding: 15px 20px;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	z-index: 99000;
	/* Remove animation for instant display */
	animation: none;
}

.feedback-toast.success {
	border-left: 4px solid var(--success);
}

.feedback-toast.error {
	border-left: 4px solid var(--error);
}

	#level1 > li > i {
		font-size: 20px;
	}

/* Mobile chat view styles */
@media (max-width: 768px) {
	/* Existing mobile styles */
	body {
		grid-template-areas:
			"header"
			"main";
		grid-template-columns: 1fr;
		grid-template-rows: 60px 1fr;
		margin-bottom: 50px;
	}

	.lastMessageCompanion {
		width: 95vw;
		max-height: 99px;
	}

	#level1 > li > i {
		font-size: 22px;
	}
	

	.vmd-item {
		padding: 5px 7px;
		max-height: 37px;
	}

	.character-card {
		min-width: 260px;
		max-width: 400px; /* Smaller max-width on mobile */
		height: 600px; /* Keep the same height as desktop */
		aspect-ratio: 1/2.2; /* Keep the same aspect ratio as desktop */
	}

	.character-card img {
		height: 100%; /* Use full height of the container */
	}

	.modal-content {
		margin: 0;
		width: 95%;
		max-height: 90vh;
		overflow-y: auto;
	}

	#settingsModalInner {
		min-height: 100vh;
		height: 100vh;
		max-width: 100vw;
		width: 100vw;
	}

	/* Ensure lowTokenspopup modal works properly on mobile */
	#lowTokenspopup .modal-content {
		margin: 0;
		width: 95%;
		max-height: 85vh;
		overflow-y: auto;
	}

	/* Zoom in on background image for mobile - betaWelcome */
	#betaWelcome.modal {
		background-size: 185%; /* Change from contain to cover for zoom effect */
		background-position: center center; /* Keep centered */
	}

	/* Ensure betaWelcome modal content works properly on mobile */
	#betaWelcome .modal-content {
		margin: 0;
		width: 75%;
		max-height: 85vh;
		overflow-y: auto;
	}

	/* New chat mobile styles */
	.chat-container {
		flex-direction: column;
		height: calc(100vh - 120px);
	}

	.chat-sidebar {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #2a2a2a;
		max-height: 100%;
	}

	.chat-main {
		width: 100%;
		height: 100%;
	}

	/* When chat is active, we hide the sidebar and show only chat */
	.mobile-chat-active .chat-sidebar {
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		border: none;
		display: none !important; /* Force hide sidebar when chat is active */
	}

	.mobile-chat-active .chat-main {
		height: 100%;
		display: flex !important; /* Force display chat main */
		flex-direction: column;
	}

	/* When contacts view is active, we hide the chat and show only sidebar */
	.mobile-contacts-active .chat-main {
		display: none !important; /* Force hide the chat main when showing contacts */
	}

	.mobile-contacts-active .chat-sidebar {
		max-height: 100%;
		overflow: auto;
		opacity: 1;
		display: flex !important; /* Force display sidebar */
		flex-direction: column;
		width: 100%;
		height: calc(100vh - 60px);
	}

	/* HIDE CHAT HEADER WHEN VIEWING CONTACTS LIST */
	#chatPage .chat-container.mobile-contacts-active + .chat-header {
		display: none !important;
	}

	/* Also ensure the chat header is hidden in mobile-contacts-active mode */
	.mobile-contacts-active #chatAreaHeader {
		display: none !important;
	}

	/* Mobile toggle button */
	.mobile-toggle-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border-radius: 50%;
		background-color: transparent;
		border: 1px solid #444;
		color: var(--text-color);
		font-size: 18px;
		cursor: pointer;
		margin-right: 10px;
		transition:
			border-color 0.2s,
			color 0.2s,
			background 0.2s;
	}

	.mobile-toggle-btn:hover {
		border-color: var(--color1);
		color: var(--color1);
		background: rgba(245, 75, 115, 0.08);
	}

	.mobile-toggle-btn i {
		font-size: 24px;
		margin-right: 15px;
		color: #e91e63;
	}

	.character-card .bottom-content {
		padding: 20px 10px 0; /* Top and side padding */
		padding-bottom: 0; /* Explicit zero bottom padding */
	}

	.search-tag {
		white-space: nowrap;
		flex-shrink: 0;
		background: #000000;
		padding: 0.5rem 0.85rem;
		border-radius: 999px;
		display: inline-flex;
		align-items: center;
		font-size: 0.94rem;
		border: 0px solid var(--color1);
		margin: 5px;
	}

	.pill-tags {
		margin: 5px 0 5px 0;
	}

	.pill-tag {
		padding: 8px 13px;
		display: flex;
		align-items: center;
		justify-content: center;
		white-space: nowrap;
	}

	/* Old mobile chat-button style - conflicts with new character card buttons
	.chat-button {
		margin-left: -10px; /* Adjust for smaller side padding on mobile 
		margin-right: -10px;
		width: calc(100% + 20px);
		padding: 8px 0;
	}
	*/
}

/* Existing style for generator container in mobile - moved here for organization */
@media (max-width: 768px) {
	.generator-container {
		flex-direction: column;
	}

	.character-preview-container {
		width: 100%;
		margin-right: 0;
		margin-bottom: 20px;
		margin-left: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.character-preview {
		height: 200px;
		width: 250px;
		max-width: 100%;
	}

	.count-options {
		flex-wrap: wrap;
	}

	.count-option {
		min-width: calc(50% - 5px);
	}

	/* Added mobile styles for generator tabs */
	.generator-tabs {
		display: flex;
		flex-wrap: wrap;
		gap: 12px;
		margin-bottom: 15px;
		padding-bottom: 10px;
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none; /* Firefox */
	}

	.generator-tabs::-webkit-scrollbar {
		display: none; /* Chrome, Safari, Edge */
	}

	.generator-tab {
		margin-right: 0;
		padding: 8px 12px;
		font-size: 14px;
		white-space: nowrap;
		flex: 0 0 auto;
	}

	.main-content {
		padding: 0px;
	}
}

/* Add additional mobile styles for smaller screens */
@media (max-width: 500px) {
	.search-input-container {
		width: 90vw;
		width: 90vw !important;
	}

	.generator-tabs {
		padding: 0 15px;
		margin: 0 -15px 15px -15px;
		width: calc(100% + 30px);
	}

	.generator-tab {
		padding: 8px 10px;
		font-size: 13px;
	}

	.generator-options {
		padding: 15px;
	}

	#logoutBtn {
		visibility: hidden;
		display: none;
	}

	#logoRow {
		display: none;
	}

	.character-card {
		aspect-ratio: 1/2.2; /* Keep the same aspect ratio as desktop */
		height: 550px; /* Slightly shorter for very small screens */
	}

	.character-card .bottom-content {
		/* Make gradient taller to create more space for content */
		background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 70%, rgba(0, 0, 0, 0.5) 90%, rgba(0, 0, 0, 0) 100%);
		padding-top: 35px; /* Increase top padding to give more room */
	}

	.character-card img {
		height: 100%; /* Use full height of the container */
	}
}

/* 
just a random cool background pattern
https://05f5772df6a6b9847df8c77cc97a2c19.cdn.bubble.io/f1724548841072x644097138023475700/liquid-cheese.svg
 

wavy background
https://05f5772df6a6b9847df8c77cc97a2c19.cdn.bubble.io/f1724545077454x336295181208753800/wavey-fingerprint.svg


 */

.message-card {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Remove the fadeIn animation definition or keep it for potential future use */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Slow fade-in animation for message-actions (no slide, just opacity) */
@keyframes fadeInActions {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Fade-out animation for message deletion */
@keyframes messageDelete {
	from {
		opacity: 1;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(0.9);
	}
}

.message-avatar {
	width: 36px;
	height: 56px;
	border-radius: 5px;
	background-color: #2a2a2a;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #e0e0e0;
	font-size: 0.9em;
	font-weight: bold;
	flex-shrink: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.message-avatar:hover {
	transform: scale(1.05);
}

.message-bot .message-avatar {
	background-color: rgba(245, 75, 115, 0.15);
	color: var(--color1);
}

.message-bubble {
	background-color: #2a2a2aeb;
	border-radius: 19px 19px 19px 0px;
	padding: 12px 12px;
	max-width: calc(100% - 50px);
	word-wrap: break-word;
	line-height: 1.4;
	font-size: 14px;
	color: var(--text-color);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	position: relative;
	min-width: 90px;
	white-space: normal;
	word-break: keep-all;
	font-weight: 500;
	margin-bottom: 6px;
}

.message-user {
	justify-content: flex-start;
	margin-left: auto;
	margin-right: 0;
	max-width: 80%;
	min-width: 200px;
}

.message-user .row {
	flex-direction: row-reverse;
}

.message-user .message-bubble {
	background-color: #f54b73d6;
	color: white;
	border-radius: 19px 19px 0px 19px;
}

/* .message-user .message-bubble:after {
	content: "";
	position: absolute;
	bottom: 0;
	right: -6px;
	width: 12px;
	height: 12px;
	background-color: var(--color1);
	clip-path: polygon(0 0, 0% 100%, 100% 100%);
}


.message-bot .message-bubble:after {
	content: "";
	position: absolute;
	bottom: 0;
	left: -6px;
	width: 12px;
	height: 12px;
	background-color: #2a2a2a;
	clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}
 */
#chatMessages {
	/* DESKTOP RULES, DONT TOUCH */
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 15px;
	overflow-y: auto;
	height: calc(100vh - 200px);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
	background-color: #00000019;
}

/* Loading State Styles for Chat Messages */
.conversation-loading-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 200px;
	gap: 15px;
	color: var(--text-color);
}

.loading-spinner {
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading-icon {
	font-size: 32px;
	color: var(--color1);
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	font-size: 16px;
	color: var(--text-color);
	opacity: 0.8;
}

/* Error State Styles for Chat Messages */
.conversation-error-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 200px;
	gap: 15px;
	color: var(--text-color);
}

.error-icon {
	font-size: 32px;
	color: var(--error);
}

.error-text {
	font-size: 16px;
	color: var(--text-color);
	opacity: 0.8;
	text-align: center;
}

.retry-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background-color: var(--color1);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.2s;
}

.retry-btn:hover {
	background-color: var(--accent);
}

/* Loading state for chat messages container */
#chatMessages.loading-conversation {
	justify-content: center;
	align-items: center;
}

#chatMessages.error-conversation {
	justify-content: center;
	align-items: center;
}

/* Image Generator Page Styles */
.page-title {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}

.page-title i {
	margin-right: 10px;
}

.generator-container {
	display: flex;
	margin-bottom: 20px;
}

/* Character preview styles */
.character-preview-container {
	width: 250px;
	margin-right: 20px;
	flex-shrink: 0;
}

.character-preview {
	background-color: #131313;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	height: 300px;
}

.character-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.character-info {
	position: absolute;
	bottom: 10px;
	left: 10px;
	right: 10px;
	background-color: rgba(0, 0, 0, 0.7);
	padding: 10px;
	border-radius: 8 8 0 0;
}

.character-name {
	color: #fff;
	font-weight: bold;
	font-size: 20px;
}

/* Prompt container styles */
.prompt-container {
	flex: 1;
	background-color: #131313;
	border-radius: 8px;
	padding: 15px;
	position: relative;
	display: flex;
	flex-direction: column;
}

.prompt-input-area {
	flex: 1;
	margin-bottom: 10px;
}

.prompt-textarea {
	width: 100%;
	height: 100%;
	padding: 15px;
	background-color: #1a1a1a;
	border: 1px solid #333;
	border-radius: 8px;
	color: white;
	resize: none;
	font-family: inherit;
	min-height: 120px;
}

.generator-textarea {
	width: 100%;
	height: auto;
}

.generate-btn:hover {
	background-color: #d6365e;
}

.generate-btn:disabled {
	background-color: #854353;
	cursor: not-allowed;
}

.token-info {
	font-size: 14px;
	color: #aaa;
	display: flex;
	align-items: center;
}

.token-info i {
	margin-right: 5px;
}

.token-info a {
	color: #f54b73;
	text-decoration: none;
	margin-left: 5px;
}

/* Generator options styles */
.generator-options {
	background-color: #131313;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.generator-tabs {
	display: flex;
	margin-bottom: 20px;
	border-bottom: 1px solid #333;
}

.generator-tab {
	margin-right: 20px;
	padding-bottom: 10px;
	color: #777;
	cursor: pointer;
}

.generator-tab:hover {
	color: white;
}

.generator-tab.active-tab {
	color: white;
	font-weight: bold;
	border-bottom: 2px solid #f54b73;
}

.tab-content-container {
	margin-bottom: 30px;
}

.option-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.image-option {
	padding: 10px;
	border-radius: 10px;
	background-color: #1a1a1a;
	border: 2px solid transparent;
	cursor: pointer;
	text-align: center;
	transition: transform 0.2s;
	margin-bottom: 10px;
}

.image-option:hover {
	transform: translateY(-3px);
}

.image-option.selected {
	border: 2px solid #f54b73;
}

.option-img-container {
	width: 100px;
	height: 100px;
	background-color: #1a1a1a;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 5px;
	border: 2px solid transparent;
}

.option-img-container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.option-label {
	color: #aaa;
	font-size: 14px;
}

.count-selector {
	margin-top: 20px;
}

.count-label {
	margin-bottom: 10px;
	color: white;
}

.count-options {
	display: flex;
	gap: 10px;
}

.count-option {
	flex: 1;
	padding: 10px;
	background-color: #222;
	border: 1px solid #333;
	border-radius: 8px;
	text-align: center;
	color: #777;
	cursor: pointer;
}

.count-option.selected {
	border: 1px solid #f54b73;
	color: white;
}

.count-option:hover {
	border-color: #f54b73;
}

.count-option i {
	margin-right: 5px;
}

.count-option.selected i {
	color: #f54b73;
}

/* Generated images section */
.generated-images-section {
	background-color: #131313;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.generated-images-section h2 {
	margin-bottom: 15px;
	color: white;
}

.generated-images-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
}

.generated-image-container {
	display: flex;
	flex-direction: column;
	position: relative;
	border-radius: 8px;
	aspect-ratio: 3/4;
	box-shadow: #f54b732b 0px 0px 10px 0px;
}

.generateImagesDecoy {
	display: flex;
	flex-direction: column;
	position: relative;
	border-radius: 8px;
	aspect-ratio: 3/4;
	box-shadow: #f54b732b 0px 0px 10px 0px;
	background:
		linear-gradient(rgba(0, 0, 0, 0.2), /* top black gradient */ rgba(0, 0, 0, 0.3)),
		linear-gradient(to bottom right, #f54b7377, rgba(0, 0, 0, 0.4)),
		url("https://pub-7d5fd4886c1d4f408c18f163c2b1dd86.r2.dev/ani-banner.webp") no-repeat center center;
	background-size: cover;
}

.generated-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 10px;
	cursor: pointer;
}

.download-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background-color: rgba(0, 0, 0, 0.7);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 20px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
}

.generated-image-container:hover .download-btn {
	opacity: 1;
}

.download-btn:hover {
	background-color: #f54b73;
}

/* Character selection for image generator */
.character-select-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 15px;
	padding: 15px 0;
	max-height: 550px;
	overflow-y: auto;
}

.character-select-card {
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.2s;
	background-color: #222;
	border: 1px solid #333;
}

.character-select-card:hover {
	transform: translateY(-3px);
	border-color: var(--color1);
	border: 1px solid var(--color1);
}

.character-select-card img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

.character-select-name {
	padding: 10px;
	text-align: center;
	background-color: #1a1a1a;
	color: white;
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Feedback message styles */
.feedback-message {
	padding: 10px 15px;
	border-radius: 8px;
	margin-bottom: 15px;
}

.feedback-message.error {
	background-color: rgba(255, 87, 87, 0.2);
	border: 1px solid #ff5757;
	color: #ff8a8a;
}

.feedback-message.success {
	background-color: rgba(87, 255, 133, 0.2);
	border: 1px solid #57ff85;
	color: #8aff9d;
}

.feedback-message.info {
	background-color: rgba(87, 169, 255, 0.2);
	border: 1px solid #57a9ff;
	color: #8ac3ff;
}

/* Chat mode toggle styles */
.chat-mode-toggle {
	margin-right: 10px;
}

/* Chat input container with mode toggle */
.chat-input {
	padding: 15px;
	display: flex;
	align-items: center;
	gap: 10px;
	background-color: #1a1a1a;
	border-top: 1px solid #2a2a2a;
	position: sticky;
	bottom: 0;
}

/* Chat image styles */
.chat-image {
	max-width: 100%;
	max-height: 300px;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

.message-content {
	position: relative;
}

.image-download-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background-color: rgba(0, 0, 0, 0.7);
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 16px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
}

.message-content:hover .image-download-btn {
	opacity: 1;
}

.image-download-btn:hover {
	background-color: var(--color1);
}

/* Message with image specific styling */
.message.message-character .chat-image,
.message.message-user .chat-image {
	margin-bottom: -5px; /* Remove unnecessary space at bottom of image */
}

/* Add styles for the new chat area header */
.chat-header.chat-area-header {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px;
	border-bottom: 1px solid #444;
	margin-bottom: 0px;
	background-color: var(--background-secondary, #1e1e1e);
	width: 100%;
	position: sticky;
	top: 0;
	z-index: 10;
}

.chat-header.chat-area-header #chatCharacterName {
	flex: 1;
	margin: 0;
	font-size: 1.3rem;
	font-weight: 500;
	color: var(--text-primary, #fff);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat-header.chat-area-header #chatHeaderPfp {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 10px;
	cursor: pointer;
}

#chatHeaderPfp:hover {
	cursor: pointer;
	border: 2px solid var(--color1);
}

/* Settings Modal Styles */
.settings-modal-content {
	background-color: #1a1a1a; /* Slightly lighter than main bg */
	border: 1px solid var(--grey-border);
	border-radius: 12px;
	max-width: 650px; /* Wider modal */
	padding: 0; /* Remove default padding, handle internally */
	color: var(--text-color);
	z-index: 1000;
	height: 80vh;
	flex-grow: 1;
}

.settings-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 25px;
	border-bottom: 1px solid var(--grey-border);
}

.settings-tabs {
	display: flex;
	gap: 10px;
}

.settings-tab {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.6);
	padding: 8px 15px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1rem;
	display: flex;
	align-items: center;
	gap: 8px;
	transition:
		background-color 0.2s,
		color 0.2s;
}

.settings-tab:hover {
	background-color: rgba(255, 255, 255, 0.05);
	color: var(--text-color);
}

.settings-tab.active {
	color: var(--color1);
	background-color: rgba(245, 75, 115, 0.1);
	font-weight: 500;
}

.settings-tab i {
	font-size: 1.1rem;
	font-weight: normal;
}

.scroll-x {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	gap: 0.5rem;
	padding: 0.5rem 0;
	scroll-behavior: smooth;
}

.scroll-x::-webkit-scrollbar {
	height: 6px;
}

.scroll-x::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}

.settings-body {
	padding: 25px;
	overflow-y: auto;
}

.settings-section {
	margin-bottom: 25px;
}

.settings-section label {
	display: block;
	font-weight: 500;
	margin-bottom: 8px;
	color: #bdbdbd;
	font-size: 0.95rem;
}

.settings-section label i {
	color: #888;
	cursor: help;
}

.settings-section select,
.settings-section input[type="tel"],
input,
.select {
	width: 100%;
	background-color: #252525;
	border: 1px solid var(--grey-border);
	color: var(--text-color);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 1rem;
	font-family: inherit;
	-webkit-appearance: none; /* Remove default dropdown arrow on WebKit */
	-moz-appearance: none; /* Remove default dropdown arrow on Firefox */
	appearance: none; /* Remove default dropdown arrow */
	/* Add custom arrow for select if needed using background image */
}

.settings-section select {
	background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27292.4%27%20height%3D%27292.4%27%3E%3Cpath%20fill%3D%27%23aaa%27%20d%3D%27M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%27%2F%3E%3C%2Fsvg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px 10px;
	padding-right: 35px; /* Make space for custom arrow */
}

.settings-section input:focus,
.settings-section select:focus {
	outline: none;
	border-color: var(--color1);
	box-shadow: 0 0 0 2px rgba(245, 75, 115, 0.2);
}

.settings-description {
	font-size: 0.85rem;
	color: #888;
	margin-top: 8px;
	line-height: 1.4;
}

.language-select-wrapper {
	display: flex;
	align-items: center;
	position: relative;
}

.language-flag {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: auto;
	pointer-events: none; /* Allow clicking the select */
}

.language-select-wrapper select {
	padding-left: 45px; /* Make space for flag */
}

.settings-divider {
	border: none;
	border-top: 1px solid var(--grey-border);
	margin: 30px 0;
}

.account-info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	padding: 8px 0;
}

.account-info-item span:first-child {
	color: #bdbdbd;
}

.account-info-item div {
	display: flex;
	align-items: center;
	gap: 15px;
}

.settings-link {
	color: var(--color1);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 0.2s;
}

.settings-link:hover {
	color: #ff78a0; /* Lighter pink on hover */
	text-decoration: underline;
}

.user-credits-section {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: rgba(245, 75, 115, 0.05);
	padding: 15px 20px;
	border-radius: 8px;
	border: 1px solid rgba(245, 75, 115, 0.2);
}

.user-credits-section h3 {
	margin: 0;
	font-size: 1.1rem;
	color: var(--text-color);
}

#buyTokensBtn {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background-color 0.2s;
}

#buyTokensBtn i {
	font-size: 1.1rem;
}

#buyTokensBtn:hover {
	background-color: #e04067; /* Slightly darker pink */
}

.pinkButton {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 500;
}

.pinkButton:hover {
	background-color: #e04067;
}

.icon-btn {
	background: none;
	border: none;
	color: var(--text-color);
	font-size: 1.5rem; /* Adjust size as needed */
	cursor: pointer;
	padding: 5px;
	margin-right: 15px; /* Spacing from login button */
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.icon-btn:hover {
	color: var(--color1);
}

/* AI Creator Styles */
.ai-creator-container {
	max-width: 800px;
	margin: 20px auto;
	background-color: var(--foreground);
	padding: 30px;
	border-radius: 12px;
	border: 1px solid var(--grey-border);
}

#createAiPage h2 {
	color: var(--color1);
	margin-bottom: 25px;
	text-align: center;
	font-size: 1.8rem;
}

#createAiPage h2 i {
	margin-right: 10px;
	vertical-align: middle;
}

/* Stepper */
.stepper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 40px;
	flex-grow: 1;
	flex-wrap: wrap;
	gap: 10px;
}

.step {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: #666; /* Dimmed color for inactive steps */
	font-size: 0.9rem;
	text-align: center;
	position: relative;
	flex-shrink: 0; /* Prevent steps from shrinking */
}

.step span {
	display: inline-block;
	width: 30px;
	height: 30px;
	line-height: 30px;
	border-radius: 50%;
	background-color: #444; /* Darker grey for inactive step number */
	color: #888;
	margin-bottom: 8px;
	font-weight: bold;
	cursor: pointer;
}

.step.active span {
	background-color: var(--color1);
	color: white;
}

.step.active {
	color: var(--text-color); /* Active step text color */
	font-weight: bold;
}

.step-line {
	flex-grow: 1;
	height: 2px;
	background-color: #444; /* Line color */
	margin: 0 10px; /* Space between line and steps */
	/* Position below the number circle */
	position: relative;
	top: -24px; /* Adjust based on step span height and desired alignment */
	z-index: -1; /* Place behind step text */
}

/* Form Steps */
.form-step {
	display: none;
}

.form-step.active {
	display: block;
}

.form-step h3 {
	color: var(--color1);
	margin-top: 30px;
	margin-bottom: 20px;
	font-size: 1.3rem;
	border-bottom: 1px solid var(--grey-border);
	padding-bottom: 10px;
}

/* Choice Grids (for images) */
.choice-grid {
	display: grid;
	gap: 20px;
	margin-bottom: 30px;
}

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

.choice-grid.five-cols {
	/* Adjust minmax for smaller cards */
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.choice-card {
	display: block;
	background-color: #2a2a2a; /* Slightly lighter background for cards */
	border-radius: 8px;
	padding: 10px;
	text-align: center;
	cursor: pointer;
	border: 2px solid transparent;
	transition:
		border-color 0.2s,
		transform 0.2s;
	position: relative;
}

.choice-card img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 10px;
	display: block;
}

.choice-card input[type="radio"] {
	display: none; /* Hide the actual radio button */
}

.choice-card .choice-label {
	display: block;
	color: var(--text-color);
	font-weight: 500;
}

.choice-card:hover {
	border-color: #555;
	transform: translateY(-3px);
}

.choice-card input[type="radio"]:checked + img + .choice-label {
	color: var(--color1);
}

/* Style the parent label when checked */
.choice-card input[type="radio"]:checked ~ * {
	/* Optional: could add more styles here if needed */
}

.choice-card input[type="radio"]:checked {
	/* Target the label itself */
	/* This requires JS to add a class, or use :has (limited support) */
	/* For now, we style the label text color directly */
}

/* Apply border to the label when checked */
:has(> input[type="radio"]:checked).choice-card {
	border-color: var(--color1);
}

/* Disabled State for Cards */
.choice-card.disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.choice-card.disabled:hover {
	border-color: transparent;
	transform: none;
}

.choice-card.disabled .choice-label i {
	margin-right: 5px;
	color: #aaa; /* Grey out lock icon */
}

/* Choice Pills (for text options) */
.choice-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
}

.choice-pills label {
	background-color: #333;
	color: var(--text-color);
	padding: 8px 15px;
	border-radius: 20px;
	cursor: pointer;
	transition:
		background-color 0.2s,
		color 0.2s;
	display: inline-flex; /* Align items */
	align-items: center;
	font-size: 0.9rem;
}

.choice-pills input[type="radio"] {
	display: none; /* Hide radio */
}

.choice-pills label:hover {
	background-color: #444;
}

.choice-pills input[type="radio"]:checked + span {
	/* Style the sibling span (color swatch) or text directly */
}

/* Style the label when its radio is checked */
:has(> input[type="radio"]:checked).choice-pills label,
.choice-pills label:has(input[type="radio"]:checked) {
	background-color: var(--color1);
	color: white;
	font-weight: bold;
}

/* Disabled Pills */
.choice-pills label.disabled {
	background-color: #2a2a2a;
	color: #666;
	cursor: not-allowed;
	opacity: 0.7;
}

.choice-pills label.disabled i {
	margin-left: 5px;
}

.choice-pills label.disabled:hover {
	background-color: #2a2a2a;
}

/* Color Swatches */
.color-swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	margin-right: 8px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	vertical-align: middle;
}

.eye-colors .brown,
.hair-colors .brown {
	background-color: #964b00;
}
.eye-colors .blue,
.hair-colors .blue {
	background-color: #007bff;
}
.eye-colors .green,
.hair-colors .green {
	background-color: #28a745;
}
.hair-colors .blonde {
	background-color: #f5e0a0;
}
.hair-colors .brunette {
	background-color: #a56a44;
}
.hair-colors .black {
	background-color: #222;
}
.hair-colors .red {
	background-color: #dc3545;
}
.hair-colors .pink {
	background-color: #e83e8c;
}

/* Text Inputs & Textarea */
.form-step .form-group {
	margin-bottom: 20px;
}

.form-step .form-group label {
	display: block;
	margin-bottom: 8px;
	color: #ccc;
	font-weight: 500;
}

.form-step .form-group input[type="text"],
.form-step .form-group textarea {
	width: 100%;
	padding: 12px;
	background-color: #2b2b2b;
	border: 1px solid #444;
	border-radius: 6px;
	color: var(--text-color);
	font-size: 1rem;
}

.form-step .form-group input[type="text"]:focus,
.form-step .form-group textarea:focus {
	outline: none;
	border-color: var(--color1);
	box-shadow: 0 0 0 2px rgba(245, 75, 115, 0.3);
}

.form-step .form-group textarea {
	resize: vertical;
	min-height: 80px;
}

/* Navigation Buttons */
.form-navigation {
	display: flex;
	justify-content: space-between;
	margin-top: 40px;
	border-top: 1px solid var(--grey-border);
	padding-top: 20px;
}

button {
	background-color: var(--color1);
	color: white;
	padding: 10px 25px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1rem;
	font-weight: bold;
	transition:
		background-color 0.2s,
		color 0.2s;
}

.prev-btn {
	background-color: #444;
	color: #ccc;
}

.prev-btn:hover {
	background-color: #555;
}

.next-btn:hover,
.submit-btn:hover {
	background-color: #ff45a3; /* Lighter pink on hover */
}

/* Keyframes for fade in */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Chat active only elements */
.chat-active-only {
	display: none; /* Hidden by default */
}

/* Show these elements when in active chat */
.active-conversation .chat-active-only {
	display: block; /* Or flex/inline depending on the element */
}

.active-conversation .chat-header.chat-active-only {
	display: flex;
	align-items: center;
	gap: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #444;
	margin-bottom: 0px;
}

.active-conversation .chat-header-actions {
	display: flex;
	gap: 10px;
}

.active-conversation #chatHeaderPfp {
	display: inline-block;
}

/* Combined Header Styles */
.chat-header.chat-area-header {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px;
	border-bottom: 1px solid #444;
	margin-bottom: 0px;
	background-color: var(--background-secondary, #1e1e1e);
	width: 100%;
	position: sticky;
	top: 0;
	z-index: 10;
}

.chat-header.chat-area-header #chatCharacterName {
	flex: 1;
	margin: 0;
	font-size: 1.3rem;
	font-weight: 500;
	color: var(--text-primary, #fff);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat-header.chat-area-header #chatHeaderPfp {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 10px;
	cursor: pointer;
}

/* Mobile styles for the combined header */
@media (max-width: 768px) {
	.chat-header.chat-area-header {
		padding: 10px;
	}

	#tagline1 {
		display: none;
	}

	.chat-header.chat-area-header #chatHeaderPfp {
		width: 36px;
		height: 36px;
	}

	.chat-header.chat-area-header #chatCharacterName {
		font-size: 1.1rem;
		max-width: 60%;
	}

	/* Ensure the header displays correctly in mobile contact active view */
	.mobile-contacts-active .chat-main .chat-header.chat-area-header {
		display: none !important;
	}

	/* Hide specific elements on mobile when viewing chat page */
	#chatPage.active #logoImg {
		display: none !important;
	}

	#chatPage.active #userProfilePic {
		display: none !important;
	}
}

/* Mobile styles for full height chat page */
@media (max-width: 768px) {
	#chatPage .chat-container {
		/* Lines 2798-2806 */
		flex: 1;
		/* height: calc(100vh - 60px); MODIFIED: Removed */
		/* max-height: calc(100vh - 60px); MODIFIED: Removed */
		margin: 0;
		border-radius: 0;
		box-shadow: none;
		display: flex; /* ADDED */
		flex-direction: column; /* ADDED */
		min-height: 0; /* ADDED */
	}

	#chatPage .chat-main {
		/* Lines 2807-2812 */
		flex: 1; /* MODIFIED: Was max-height: 100% */
		display: flex;
		flex-direction: column;
		min-height: 0; /* ADDED */
	}

	/* Fix for mobile browsers with floating navigation bars */
	body.chat-active {
		/* Lines 2830-2837 */
		height: 100%;
		overflow: hidden;
		position: fixed;
		width: 100%;
		top: 0; /* ADDED */
		left: 0; /* ADDED */
		right: 0; /* ADDED */
		bottom: 0; /* ADDED */
		display: flex; /* ADDED */
		flex-direction: column; /* ADDED */
	}

	/* Ensure the header doesn't add extra padding */
	.chat-active .header {
		/* MODIFIED: Targeted .header under .chat-active */
		margin-bottom: 0;
		/* padding: 10px; */ /* Kept commented, review if default padding is desired */
		height: 60px;
		flex-shrink: 0; /* ADDED */
	}

	/* Ensure the main content container doesn't add padding */
	.chat-active .main-content {
		/* Lines 2845-2850 */
		padding: 0;
		margin: 0;
		flex: 1; /* ADDED */
		display: flex; /* ADDED */
		flex-direction: column; /* ADDED */
		min-height: 0; /* ADDED */
	}
}

/* Character Profile Sidebar Styles */
.profile-sidebar {
	width: 400px;
	height: 100%;
	position: absolute;
	top: 0;
	right: 0;
	background-color: #343434;
	border-left: 1px solid #2a2a2a;
	overflow-y: auto;
	padding: 20px;
	box-sizing: border-box;
	display: none;
	z-index: 1001;
}

.profile-sidebar-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
}

.profile-sidebar-close {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 28px;
	color: #e91e63;
	cursor: pointer;
	z-index: 10;
	transition: transform 0.2s;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #00000045;
}

.profile-sidebar-close:hover {
	background: #fff;
}

.profile-sidebar-name {
	font-size: 24px;
	font-weight: bold;
	margin-bottom: 15px;
	color: #ffffff;
}

.profile-sidebar-section {
	width: 100%;
	margin-bottom: 20px;
	padding-bottom: 15px;
}

.profile-sidebar-section h3 {
	font-size: 16px;
	margin: 8px;
}

.profile-sidebar-section p {
	font-size: 14px;
	color: #ffffff;
	line-height: 1.5;
}

.attribute-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 15px;
}

.attribute-item,
#pushNotificationsContainer {
	display: flex;
	justify-content: flex-start;
	flex-direction: row;
	align-items: center;
	padding: 12px;
	background-color: #3f3f3f;
	border-radius: 8px;
	color: #fff;
}

.attribute-item i {
	font-size: 24px;
	margin-right: 15px;
	color: #fff;
}

.attribute-item span {
	font-size: 12px;
	margin-right: 10px;
	min-width: 80px;
}

.attribute-item strong {
	font-size: 14px;
	flex: 1;
}

.editable-attribute strong {
	cursor: pointer;
	position: relative;
	transition: background-color 0.2s;
	padding: 2px 6px;
	border-radius: 4px;
}

.editable-attribute strong:hover {
	background-color: rgba(233, 30, 99, 0.1);
}

.editable-attribute strong:hover::after {
	content: "✏️";
	font-size: 12px;
	position: absolute;
	right: -20px;
	top: 50%;
	transform: translateY(-50%);
}

.edit-input:focus {
	border-color: #e91e63;
	outline: none;
	box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

.save-changes-btn {
	width: 90%;
	background-color: #5cb85c;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 22px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	margin-bottom: 60px;
	margin-top: -10px;
	transition: background-color 0.2s;
}

.save-changes-btn:hover {
	background-color: #6dd76d;
}

.profile-sidebar-section .feedback-message {
	text-align: center;
	padding: 8px;
	border-radius: 4px;
	margin-top: 10px;
	font-size: 14px;
	display: block;
}

.profile-sidebar-section .feedback-message.success {
	background-color: rgba(76, 175, 80, 0.2);
	color: #4caf50;
	border: 1px solid rgba(76, 175, 80, 0.5);
}

.profile-sidebar-section .feedback-message.error {
	background-color: rgba(244, 67, 54, 0.2);
	color: #f44336;
	border: 1px solid rgba(244, 67, 54, 0.5);
}

/* Mobile responsive styles for profile sidebar */
@media (max-width: 768px) {
	.profile-sidebar {
		width: 100% !important;
		max-width: 100% !important;
		height: 100% !important;
		overflow-y: auto !important;
		box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
		z-index: 2000 !important; /* Higher z-index for mobile overlay */
		background: linear-gradient(rgb(207, 29, 109), rgb(0, 0, 0)) !important;
	}

	.profile-sidebar-close {
		font-size: 32px !important;
		top: 15px !important;
		left: 15px !important;
	}

	/* Improved scrolling on mobile */
	body.sidebar-open {
		overflow: hidden;
	}
}

@media (max-width: 400px) {
	.grid-container {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
		gap: 10px;
	}

	.character-card {
		min-width: 200px;
		max-width: 300px;
		aspect-ratio: 1/2; /* Taller cards */
	}

	.character-card h3 {
		font-size: 1.3em; /* Smaller font size */
	}

	.character-card .name {
		font-size: 18px; /* Smaller font size */
	}

	.aboutme {
		font-size: 10px; /* Smaller about me text */
		-webkit-line-clamp: 3; /* Show fewer lines */
	}
}

.ascii-art {
	font-family: monospace; /* Ensures fixed-width characters */
	white-space: pre; /* Preserves spaces and line breaks */
	line-height: 1; /* Prevents extra spacing between lines */
	letter-spacing: 0; /* Ensures no extra spacing between chars */
	word-break: keep-all; /* Prevents unwanted line breaks */
	display: block; /* Ensures proper block-level rendering */
	overflow-x: auto; /* Adds horizontal scroll if needed */
	padding: 10px; /* Optional: adds some padding */
}

/* Add this after other chat container styles */

/* Chat content wrapper - flex container for chat main and profile sidebar */
.chat-content-wrapper {
	display: flex;
	flex: 1;
	overflow: hidden;
	position: relative;
}

/* Adjust chat-main to take available space */
.chat-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0; /* Prevent flex item from overflowing */
}

/* Style profile sidebar within the wrapper */
.chat-content-wrapper .profile-sidebar {
	flex: 0 0 auto; /* Don't grow, don't shrink, use defined width */
	height: 100%;
	overflow-y: auto;
	border-left: 1px solid var(--border-color);
	background-color: var(--secondary-bg-color);
	position: relative; /* Not absolute anymore */
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
	.chat-content-wrapper {
		flex-direction: column;
	}

	.chat-content-wrapper .profile-sidebar {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100;
	}
}

/* Message action buttons */
.message-actions {
	display: flex;
	justify-content: flex-end;
	gap: 5px;
	margin-top: 1px;
	padding: 0 5px;
	transition: opacity 0.2s ease;
	margin-left: 50px;
	margin-right: 50px;
	background-color: #2a2a2a8a;
	border-radius: 18px;
	padding: 3px 7px;
	color: var(--text-color);
}

.message-action-btn {
	background: none;
	border: none;
	color: #e2e2e2dd;
	font-size: 14px;
	padding: 2px;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	text-shadow: 0px 0px 4px rgb(0 0 0);
}

.message-action-btn:hover {
	background-color: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.action-button {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-style: normal;
}

.action-button a {
	font-style: normal;
}
#homePage > section > div.col > a {
	font-style: normal;
}

a.action-button.secondary-button {
	text-decoration: none;
}

.action-button:hover {
	background-color: var(--color1-dark);
}

.secondary-button {
	background-color: var(--color2);
}

.secondary-button:hover {
	background-color: var(--color2-dark);
}

.message-action-btn.delete:hover {
	color: #ff4d4d;
}

.message-action-btn.edit:hover {
	color: #4d94ff;
}

.message-action-btn.refresh:hover {
	color: #4dff4d;
}

.message-bot .message-actions {
	justify-content: flex-start;
}

.message-user .message-actions {
	justify-content: flex-end;
}

#editMessageTextarea {
	background-color: #2b2b2b;
	border: 1px solid #444;
	border-radius: 6px;
	color: var(--text-color);
	padding: 10px;
	font-family: inherit;
	font-size: 1rem;
}

#editMessageTextarea:focus {
	outline: none;
	border-color: var(--color1);
}

#saveMessageEditBtn {
	background-color: var(--color1);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	transition: background-color 0.2s;
}

#saveMessageEditBtn:hover {
	background-color: #e04067; /* Slightly darker pink */
}

.profile-tabs.row {
	text-align: center;
	display: flex;
	flex-grow: 1; /* Allows each item to grow and take available space */
	gap: 10px; /* Adjust the value as needed */
	justify-content: space-evenly;
	background-color: #1c1c1c;
	width: 100%;
	padding: 10px;
	border-radius: 9px 9px 0px 0px;
	color: #fff;
	background-color: #3f3f3f;
	font-size: 0.8em;
}

.profile-tab:hover {
	color: var(--color1);
	cursor: pointer;
}

.profile-tab.active {
	color: var(--color1);
}

/* MOBILE STYLES */

/* Mobile styles for the combined header */
@media (max-width: 768px) {
	.chat-header.chat-area-header {
		padding: 10px;
	}

	.chat-header.chat-area-header #chatHeaderPfp {
		width: 36px;
		height: 36px;
	}

	.chat-header.chat-area-header #chatCharacterName {
		font-size: 1.1rem;
		max-width: 60%;
	}

	/* Ensure the header displays correctly in mobile contact active view */
	.mobile-contacts-active .chat-main .chat-header.chat-area-header {
		display: none !important;
	}

	/* Hide specific elements on mobile when viewing chat page */
	#chatPage.active #logoImg {
		display: none !important;
	}

	#chatPage.active #userProfilePic {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.ai-creator-container {
		margin: 0px;
	}

	#createChar {
		margin: 0px;
		height: calc(100vh - 60px);
	}

	.left-nav {
		display: none;
		height: 100vh;
		width: 100vw;
		padding-bottom: 20px; /* Add bottom padding */
		padding-top: 0px;
	}

	/* Ensure the navigation footer stays at the bottom and is fully visible */
	.left-nav .nav-footer {
		margin-top: auto;
		padding-bottom: 10px;
	}

	.left-nav.visible {
		left: 0; /* Show nav by setting left to 0 */
		transform: none; /* Remove transform */
		display: flex;
		box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
	}

	/* Add overlay when menu is visible */
	.left-nav.visible::after {
		content: "";
		position: fixed;
		top: var(--header-height);
		left: 250px;
		width: calc(100vw - 250px);
		height: calc(100vh - var(--header-height));
		background-color: rgba(0, 0, 0, 0.5);
		z-index: -1;
	}
}

@media (max-width: 600px) {
	.aboutme {
		display: -webkit-box;
		-webkit-line-clamp: 4;
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
		max-height: 6em; /* Adjust as needed for your font-size/line-height */
	}
}

/* Add styles for the formatting help button and tooltip */
.format-help-btn {
	position: absolute;
	right: 60px;
	top: 10px;
	background: transparent;
	border: none;
	color: var(--color1);
	cursor: pointer;
	font-size: 18px;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.format-help-btn:hover {
	opacity: 1;
}

.format-help-tooltip {
	position: fixed;
	bottom: 90px;
	right: 20px;
	width: 280px;
	background-color: #202020;
	border: 1px solid var(--color1);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 100;
	padding: 15px;
	font-size: 14px;
	color: #fff;
}

.tooltip-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	border-bottom: 1px solid #444;
	padding-bottom: 5px;
}

.tooltip-header h3 {
	margin: 0;
	font-size: 16px;
	color: var(--color1);
}

.tooltip-header button {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
}

.format-options {
	list-style: none;
	padding: 0;
	margin: 0;
}

.format-options li {
	margin-bottom: 8px;
	padding: 5px;
	border-radius: 4px;
}

.format-options li:hover {
	background-color: #2a2a2a;
}

/* Mobile specific styles for message input */
@media (max-width: 768px) {
	/* Extra safe area for devices with bottom navigation bars */
	@supports (-webkit-touch-callout: none) {
		#chatPage .chat-input {
			padding-bottom: 30px; /* Extra padding for iOS devices */
			margin-bottom: 15px;
		}
	}

	/* Add visual indication for the input area */
	.chat-mode-toggle {
		margin-right: 12px; /* Extra space between toggle and input */
	}
}

/* Message input wrapper styling */
.message-input-wrapper {
	position: relative;
	flex: 1;
	display: flex;
}

/* Mobile specific styles for message input */
@media (max-width: 768px) {
	.message-input-wrapper {
		position: relative;
		flex: 1;
	}

	#chatMessages {
		/* MOBILE RULES, DONT TOUCH */
		flex-grow: 1;
		margin-bottom: 160px;
	}


	/* Extra safe area for devices with bottom navigation bars */
	/* IPHONE  */
	@supports (-webkit-touch-callout: none) {
		#chatPage .chat-input {
			padding-bottom: 35px; /* Extra padding for iOS devices */
			/* margin-bottom: 20px; */
		}
	}

	/* Add visual indication for the input area */
	.chat-mode-toggle {
		margin-right: 12px; /* Extra space between toggle and input */
	}

	/* Always ensure chat input is visible */
	body.chat-active .chat-input {
		display: flex !important;
	}
}

#chatPage {
	width: 90%;
	min-width: 320px;
}

/* Override the previous @media styles to avoid conflicts */
@media (max-width: 768px) {


	#chatPage .chat-container {
		flex: 1;
		margin: 0;
		border-radius: 0;
		box-shadow: none;
		display: flex;
		flex-direction: column;
		min-height: 0;
		position: relative;
		overflow: visible !important; /* Ensure nothing gets hidden */
	}

	#chatPage .chat-main {
		flex: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
		position: relative;
		overflow: visible !important;
	}

	/* Fix z-index issues by resetting all related z-indexes */
	.chat-header.chat-area-header {
		z-index: 20;
	}

	/* Ensure the input is always displayed at the bottom */
	#chatPage .chat-input {
		position: fixed !important;
		bottom: 0 !important;
		width: 100% !important;
		padding: 15px !important;
		padding-bottom: 25px !important;
		margin-top: auto !important; /* Push to the bottom */
		background-color: #1a1a1a !important;
		border-top: 0px solid #333 !important;
		z-index: 50 !important;
		display: flex !important;
		align-items: center !important;
		min-height: 90px !important;
		box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2) !important;
	}

	/* Focus styles for even better visibility when inputting text */
	#messageInput:focus {
		border-color: var(--color1) !important;
		background-color: #2a2a2a !important; /* Slightly lighter when focused */
	}

	/* Ensure input wrapper takes proper space */
	.message-input-wrapper {
		position: relative;
		flex: 1;
		min-height: 60px;
	}
}

/* Add these CSS rules after the last media query in the file */

@media (max-width: 768px) {
	/* Use CSS custom properties for important dimensions */
	:root {
		--header-height: 60px;
		--chat-input-height: 90px;
		--safe-bottom-area: 20px;
	}

	#chatContacts {
		margin-bottom: 0px;
	}

	/* Set fixed heights for key elements to ensure proper layout */
	.header {
		height: var(--header-height);
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 0;
	}

	#chatPage {
		width: 100vw;
		height:100vh;
		margin-top: var(--header-height);
		overflow: hidden !important;
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 0;
		min-height: 100% !important;
		padding-bottom: 30px !important;

	}

	#chatContainer {
		flex: 1;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		height: 100%;
	}

	.chat-main {
		flex: 1;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		position: relative;
	}

	.chat-header.chat-area-header {
		flex: 0 0 auto;
		height: auto;
	}

	#userInfo {
		display: none !important;
	}

	.chat-input {
		position: absolute !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		z-index: 200 !important;
		background-color: #1a1a1a75 !important;
		border-top: 0px solid #333 !important;
		padding: 8px 8px !important;
		min-width: 97vw;
		margin: 0px auto;
	}

	#messageInput {
		height: 60px;
		min-height: 60px;
		max-height: 60px;
		padding: 9px;
		width: 100%;
	}

	/* iOS specific adjustments */
	@supports (-webkit-touch-callout: none) {
		:root {
			--safe-bottom-area: 35px; /* Larger safe area for iOS home indicator */
		}

		.chat-input {
			padding-bottom: var(--safe-bottom-area) !important;
		}
	}

	/* Ensure the page doesn't scroll when keyboard appears */
	body.keyboard-visible {
		height: 100% !important;
		overflow: hidden !important;
	}

	body.keyboard-visible #chatPage {
		height: 100% !important;
	}

	/* Fixed positioning for mobile view modes */
	.mobile-chat-active .chat-sidebar,
	.mobile-contacts-active .chat-main {
		display: none !important;
	}

	.mobile-contacts-active .chat-sidebar,
	.mobile-chat-active .chat-main {
		display: flex !important;
		flex-direction: column !important;
		height: 100% !important;
		width: 100% !important;
	}

	/* Hide specific elements on mobile when viewing chat page */
	.mobile-contacts-active .chat-main .chat-header.chat-area-header {
		display: none !important;
	}
}

/* settings tab */

.clickable-icon {
	cursor: pointer;
}

.clickable-icon:hover {
	color: var(--color1);
}

/* Gender selection icons */
.active-gender {
	transform: scale(1.2);
	border-bottom: 2px solid var(--color1);
	padding-bottom: 3px;
	opacity: 1 !important; /* 100% opacity for active icon */
}

.ph-gender-male,
.ph-gender-female,
.ph-gender-intersex {
	font-size: 24px;
	margin-right: 10px;
	transition: all 0.2s ease;
	opacity: 0.8; /* 40% opacity for inactive icons */
}

button:disabled {
	background-color: #888;
}
.disabled {
	opacity: 0.2;
}

/* Gender Icon Opacity for My Profile Settings */
#myProfileTabContent .ph[class*="ph-gender-"] {
	opacity: 0.4; /* Lower opacity for unselected icons */
	transition: opacity 0.3s ease;
	cursor: pointer;
}

#myProfileTabContent .ph[class*="ph-gender-"].active-gender {
	opacity: 1; /* Full opacity for the selected icon */
}

.profile-tabs i {
	font-size: 1.5rem;
}

#myProfileTabContent .ph[class*="ph-gender-"]:not(.active-gender):hover {
	opacity: 0.7; /* Slightly more opaque on hover for unselected icons */
}

/* Ensure settings modal content is scrollable if it gets too long */

.search-filter-container {
	max-width: 900px;
	display: flex;
	flex-direction: column;
	gap: 15px;
	width: 100%;
	padding: 10px;
	margin: 20px;
	margin-left: 0;
	align-items: left;
}

#searchInput {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #333;
	border-radius: 8px;
	background-color: #1a1a1a;
	color: white;
	font-size: 16px;
	transition: border-color 0.3s ease;
}

#searchInput:focus {
	border-color: var(--color1);
	outline: none;
}

/* Search input container with clear button */
.search-input-container {
	position: relative;
	width: 100%;
}

.search-clear-btn {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 18px;
	color: #888;
	cursor: pointer;
	transition: color 0.3s ease;
	z-index: 10;
}

.search-clear-btn:hover {
	color: var(--color1);
}

#charFilterGender i {
	font-size: 28px;
	cursor: pointer;
	transition: all 0.3s ease;
	padding: 8px;
	border-radius: 8px;
}

#charFilterGender i:hover {
	transform: scale(1.1);
	background-color: rgba(255, 255, 255, 0.1);
}

#charFilterGender i.disabled {
	opacity: 0.3;
}

/* Style Filter Row */
.style-filter-row {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.outline {
	text-align: center;
	flex: 1;
	max-width: 120px;
	padding: 8px 16px;
	border: 2px solid var(--color1);
	border-radius: 6px;
	background-color: #1a1a1a;
	color: white;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
	border-radius: 100px;
}

.outline:hover {
	border-color: var(--color1);
	background-color: rgba(245, 75, 115, 0.1);
	box-shadow: 0 0 10px rgba(245, 75, 115, 0.622);
}

.style-filter-row button.disabled {
	opacity: 0.3;
}

.style-filter-row button.disabled:hover {
	border-color: #333;
	background-color: #1a1a1a;
}

/* Desktop responsive adjustments */
@media (min-width: 768px) {
	.search-filter-container {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		padding: 0;
	}

	#searchInput {
		flex: 1;
		margin-right: 20px;
	}

	.filter-options {
		flex-direction: column;
		min-width: 140px;
	}

	#charFilterGender {
		gap: 15px;
	}

	.style-filter-row {
		gap: 8px;
	}

	.style-filter-row button {
		font-size: 13px;
		padding: 6px 12px;
	}
}

/* MOBILE responsive adjustments */
@media (max-width: 500px) {
	.search-filter-container {
		flex-direction: column;
		align-items: center;
		justify-content: space-between;
		gap: 15px;
		padding: 0;
		margin: 20px auto;
		width: 90%;
	}
	.user-info-text {
		display: none;
	}

	#searchInput {
		flex: 1;
		margin-right: 20px;
	}

	.filter-options {
		flex-direction: column;
		min-width: 140px;
	}

	#charFilterGender {
		gap: 15px;
	}

	.style-filter-row {
		gap: 8px;
	}

	.style-filter-row button {
		font-size: 13px;
		padding: 6px 12px;
	}

	#hero-links {
		flex-direction: column;
	}

	.character-grid h2 {
		font-size: 1.5em;
	}

	#lightbox-prev {
		position: fixed !important; /* stays at the edge regardless of scroll */
		left: 0 !important;
		top: 50% !important;
		transform: translateY(-50%) !important;
		z-index: 9999 !important; /* ensure it's on top */
	}

	#lightbox-next {
		position: fixed !important;
		right: 0 !important;
		top: 50% !important;
		transform: translateY(-50%) !important;
		z-index: 9999 !important;
	}
}

.character-card .chat-icon {
	margin-left: 5px; /* Space between text and icon */
}

.views-counter {
	position: absolute;
	top: 8px;
	right: 8px;
	background-color: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 0.75em;
	display: flex;
	align-items: center;
	gap: 4px;
	z-index: 2;
}

.views-counter i {
	font-size: 12px;
}

.creator-username {
	position: absolute;
	top: 8px;
	left: 8px;
	background-color: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 0.75em;
	display: flex;
	align-items: center;
	gap: 4px;
	z-index: 2;
}

/* Character Profile Page Styles */
.character-profile {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.character-profile-header {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 40px;
	align-items: center;
}

.character-image-container {
	width: 100%;
	max-width: 800px;
}

.character-image {
	width: 100%;
	max-height: 600px;
	object-fit: contain;
	border-radius: 16px;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
	border-radius: 16px;
}

.character-basic-info {
	width: 100%;
	max-width: 800px;
	text-align: center;
}

.character-name {
	font-size: 2.5rem;
	color: var(--color1);
	margin-bottom: 15px;
	font-weight: 700;
}

.character-actions {
	display: flex;
	gap: 0;
	margin-top: 20px;
	max-width: 500px;
	font-size: 16px;
	justify-content: center;
	align-items: center;
	width: 100%;
	max-width: none; /* or a larger value */
}

.tag-label {
	margin-right: 6px;
}

.character-actions .chat-button {
	background-color: var(--color1);
	color: white;
	padding: 10px 18px;
	border: none;
	border-radius: 0 8px 8px 0;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	transition: background-color 0.2s;
	flex: 1;
}

.character-actions .chat-button:hover {
	background-color: #ff45a3;
}

.character-actions .profile-button {
	background-color: #5cf6b8;
	color: white;
	padding: 8px 18px;
	border: none;
	cursor: pointer;
	border-radius: 0 0 0 16px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	transition: background-color 0.2s;
}

.character-actions .profile-button:hover {
	background-color: #4ae8a8;
}

.character-details {
	display: flex;
	gap: 30px;
	flex-direction: column;
	align-items: center;
}

.character-section {
	background-color: var(--foreground);
	padding: 25px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	max-width: 900px;
	width: 100%;
}

.character-section h2 {
	color: var(--color1);
	margin-bottom: 15px;
	font-size: 1.5rem;
	font-weight: 600;
}

.character-section p {
	line-height: 1.6;
	color: var(--text-color);
}

.character-details-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px 30px;
	margin-top: 15px;
}

.detail-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-label {
	font-weight: 600;
	color: var(--color1);
}

.detail-value {
	color: var(--text-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.character-profile {
		padding: 15px;
	}

	.character-profile-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 15px;
	}

	.character-image {
	}

	.character-name {
		font-size: 1.8rem;
	}

	.character-actions {
		justify-content: center;
	}

	.character-section {
		margin-bottom: 25px;
	}

	.character-details-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
}

@media (max-width: 480px) {
	.character-profile {
		padding: 10px;
		max-width: 460px;
	}

	.character-image {
		width: 100%;
		height: 250px;
	}

	.character-name {
		font-size: 1.8rem;
	}

	.character-actions .chat-button,
	.character-actions .profile-button {
		padding: 10px 20px;
		font-size: 14px;
	}

	.character-section h2 {
		font-size: 1.3rem;
	}
}

.char-placeholder {
	font-weight: bold;
	color: var(--color1);
}

.user-placeholder {
	font-weight: bold;
	color: #3b82f6; /* Blue */
}

/* Character card buttons container */
.character-card .buttons-container {
	display: flex;
	gap: 0;
	margin: 0;
	width: calc(100% + 30px);
	margin-left: -15px;
	margin-right: -15px;
}

.character-card .profile-button {
	background-color: #b14ae8;
	color: white;
	padding: 10px 0;
	border: none;
	cursor: pointer;
	border-radius: 0 0 0 16px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	transition: background-color 0.2s;
}

.character-card .profile-button:hover {
	background-color: #4ae8a8;
}

.character-card .chat-button {
	background-color: var(--color1);
	color: white;
	padding: 10px 0;
	border: none;
	cursor: pointer;
	border-radius: 0 0 16px 0;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	transition: background-color 0.2s;
}

.character-card .chat-button:hover {
	background-color: #ff45a3;
}

/* Mobile responsive styles for character card buttons */
@media (max-width: 768px) {
	.character-card .buttons-container {
		margin-left: -10px;
		margin-right: -10px;
		width: calc(100% + 20px);
	}

	.character-card .chat-button,
	.character-card .profile-button {
		padding: 8px 0;
	}

	#header-introduction {
		font-size: 12px;
		color: #a9a9a9;
	}

	#header-title {
		font-weight: 400;
		max-width: 450px;
		text-align: center;
	}
}

.page-footer {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: var(--foreground);
	z-index: 1000;
	border-top: 1px solid var(--grey-border);
	padding: 10px 0;
}

#header-introduction {
	font-size: 15px;
	color: #ffffffcf;
	font-weight: 400;
	max-width: 450px;
	text-align: center;
}

@media (max-width: 768px) {
	body {
		grid-template-columns: 1fr;
		grid-template-areas: "main";
		grid-template-rows: 1fr;
	}

	.main-content {
		margin-left: 0; /* No left margin on mobile since nav is hidden/overlaid */
		padding: 15px;
	}
}

table tr:nth-child(odd) {
	background-color: #242424;
}

#clerkModal.modal {
	z-index: 2000;
}

/* Hide image in login modal on short screens */
@media (max-height: 600px) {
	#clerkModal .modal-content img {
		display: none;
	}

	#clerkModal .modal-content > div:first-child {
		height: 0;
		max-height: 0;
		overflow: hidden;
	}

	#clerkModal .modal-content {
		max-height: 95vh;
	}
}

#chatPage.active #logoContainer {
	display: none !important;
}

#chatPage.active #logoImg {
	display: none !important;
}

#chatPage.active #logoText {
	display: none !important;
}

#chatPage.active #userProfilePic {
	display: none !important;
}

#character-popular-tags {
	user-select: none; /* Prevent text selection during drag */
}

#Waifu-Dungeon-intro .pill-tag {
	margin-bottom: 9px;
	max-width: 200px;
	width: auto;
}

.search-tag {
	white-space: nowrap;
	flex-shrink: 0;
	background: #000000;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	font-size: 0.875rem;
	border: 2px solid var(--color1);
}

.search-tag.active {
	background-color: var(--color1);
}

#generator-character-selector1 {
	cursor: pointer;
}

#alreadyhaveanaccountspan:hover {
	color: var(--color1) !important;
	cursor: pointer;
}

.welcome-text {
	display: inline-block;
	color: #fff;
	padding: 10px 14px;
	background-color: #333333a4;
	border-radius: 14px 14px 14px 4px; /* Bubble tail effect */
	margin: 0 0 12px 12px; /* Distance from left & bottom */
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	line-height: 1.3;
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%); /* This centers it horizontally */
}

#userProfilePic:hover {
	cursor: pointer;
	border: 2px solid var(--color1);
}

/* The switch - the box around the slider */
.switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

/* The slider */
.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	-webkit-transition: 0.4s;
	transition: 0.4s;
	min-width: 20px !important;
	margin-right: 0px !important;
}

.slider:before {
	position: absolute;
	content: "";
	height: 26px;
	width: 26px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	-webkit-transition: 0.4s;
	transition: 0.4s;
}

input:checked + .slider {
	background-color: green;
}

input:focus + .slider {
	box-shadow: 0 0 1px green;
}

input:checked + .slider:before {
	-webkit-transform: translateX(26px);
	-ms-transform: translateX(26px);
	transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
	border-radius: 34px;
}

.slider.round:before {
	border-radius: 50%;
}

#editCharBtn:hover {
	background-color: darken(var(--color1), 10%);
	color: var(--color1);
}

#lastMessageTimeBubble {
	color: var(--text-color);
	padding: 11px 24px;
	margin: 0px auto;
	border-radius: 16px;
	text-align: center;
	font-size: 11px;
	width: fit-content;
	border: 0px solid #555;
	background-color: #2a2a2a8a;
	cursor: pointer;
	display: none;
}

.scenario:hover {
	cursor: pointer;
	opacity: 0.95;
}

.message-actions i {
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.circle {
	border-radius: 50%;
	width: 10px;
	height: 10px;
	border: 0px;
	display: inline-block;
	margin-right: 5px;
	margin-top: 2px;
}

/*
 Animation List Styling */
#animlist {
	background: rgba(0, 0, 0, 0);
	/* 	backdrop-filter: blur(10px); */
	border-radius: 0px;
	padding: 15px;
	margin: 0px;
	overflow-y: hidden;
}

.lastMessageCompanion {
	display: block;
	position: fixed;
	bottom: 20%;
	left: 50%;
	transform: translateX(-50%);
	list-style: none;
	padding: 10px 16px;
	padding-right: 38px;
	margin: 4px;
	background: rgba(12, 12, 12, 0.42);
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 1rem;
	color: var(--text-color);
	z-index: 1000;
	word-wrap: break-word;
	white-space: pre-line;
	line-height: 1.4;
	max-height: 200px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 105, 180, 0.3) transparent;
	  flex: 0 0 auto;
	  

  width: auto;          /* ensure width is defined by content */
  white-space: normal;  /* or nowrap if you never want wrapping */

}

.lastMessageCompanion::-webkit-scrollbar {
	width: 4px;
}

.lastMessageCompanion::-webkit-scrollbar-track {
	background: transparent;
}

.lastMessageCompanion::-webkit-scrollbar-thumb {
	background: rgba(255, 105, 180, 0.3);
	border-radius: 2px;
}

.lastMessageCompanion:hover {
	background: rgba(245, 75, 115, 0.2);
}

.lastMessageCompanion .close-btn {
	position: absolute;
	top: 5px;
	right: 8px;
	font-size: 16px;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	padding: 2px;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, 0.3);
	transition: all 0.2s ease;
}

.lastMessageCompanion .close-btn:hover {
	color: rgba(255, 255, 255, 1);
	background-color: rgba(0, 0, 0, 0.5);
	transform: scale(1.1);
}

.vmd-item {
	display: flex;
	align-items: center;
	list-style: none;
	padding: 5px 7px;
	margin: 4px;
	background: rgba(12, 12, 12, 0.42);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	border-left: 3px solid transparent;
	font-size: 13px;
	color: var(--text-color);
	max-width: 290px;
	max-height: 37px;
	text-align: center;
}

.vmd-item:hover {
	border-left-color: var(--color1);
}

.vmd-item.active {
	background: rgba(245, 75, 115, 0.3);
	border-left-color: var(--color1);
	color: #ffffff;
	font-weight: 500;
}

.vmd-item.active::before {
	content: "▶  ";
	color: var(--color1);
	font-weight: bold;
}

/* Scrollbar styling for animation list */
#animlist::-webkit-scrollbar {
	width: 8px;
}

#animlist::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

#animlist::-webkit-scrollbar-thumb {
	background: var(--color1);
	border-radius: 4px;
}

#animlist::-webkit-scrollbar-thumb:hover {
	background: var(--accent);
}
#vmd-file-list {
	/* Remove browser default styles that can cause misalignment */
	margin: 0;
	padding: 0;
	list-style: none; /* Removes the default bullet points */
}
#animlist ul {
	margin: 0; /* Removes default top/bottom margin */
	padding: 0; /* Removes default side padding */
	list-style: none; /* Optional: removes bullets */
}

/* TTS Usage Bar Styles */
.tts-usage-container {
	margin-top: 10px;
}

.tts-usage-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 14px;
	color: var(--text-secondary, #bdbdbd);
}

.tts-usage-info #ttsCreditsUsed {
	font-weight: bold;
	color: var(--text-primary, #ffffff);
}

.tts-usage-bar {
	width: 100%;
	height: 20px;
	background-color: var(--background, #1a1a1a);
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--border-color, #333);
}

.tts-usage-fill {
	height: 100%;
	background: linear-gradient(90deg, #4caf50 0%, #8bc34a 50%, #ffc107 75%, #ff5722 100%);
	transition: width 0.3s ease;
	border-radius: 10px;
}
