:root {
	--primary-dark: #0A1A2F;
	--primary-darker: #050A14;
	--accent-gold: #D4AF37;
	--accent-gold-light: #F5E8C7;
	--accent-gold-dark: #C89B3C;
	--bg-cream: #FFF9EF;
	--bg-cream-light: #FFFBF5;
	--bg-cream-dark: #F5EDDD;
	--text-dark: #2E2C2A;
	--text-light: #FFFFFF;
	--border-light: rgba(212, 175, 55, 0.2);
	--border-medium: rgba(212, 175, 55, 0.3);
}

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

/* Floating Chat Button - Consistent with Barbari Films colors */
#creativeChatBtn {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1A2F, #050A14); /* Your dark blue gradient */
    color: #D4AF37; /* Gold icon instead of white */
    border: 2px solid #D4AF37; /* Cleaner gold border */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 175, 55, 0);
    cursor: pointer;
    z-index: 3000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    animation: breathe 2.5s ease-in-out infinite;
}

@keyframes breathe {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 175, 55, 0);
        border-color: #D4AF37;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(212, 175, 55, 0.25);
        border-color: #D4AF37;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 175, 55, 0);
        border-color: #D4AF37;
    }
}

#creativeChatBtn:hover {
    animation: none;
    
    background: linear-gradient(135deg, #152642, #0A1A2F); /* Lighter blue on hover */
    border: 2px solid #D4AF37;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.4);
    color: #FFFFFF; /* Icon turns white on hover for contrast */
}



#creativeChatBtn:hover i {
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.9);
    
}

/* Light Mode Styling for Floating Button */
[data-theme="light"] #creativeChatBtn {
    background: linear-gradient(135deg, #FFF9EF, #FFF5E6);
    color: #2E2C2A;
    border: 3px solid #D4AF37;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: breatheLight 2.5s ease-in-out infinite;
}

@keyframes breatheLight {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(212, 175, 55, 0.5);
        border-color: #D4AF37;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 0 0 10px rgba(212, 175, 55, 0.2);
        border-color: #E0C28A;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(212, 175, 55, 0);
        border-color: #D4AF37;
    }
}

[data-theme="light"] #creativeChatBtn:hover {
    animation: none;
    transform: scale(1.08) translateY(-3px);
    background: linear-gradient(135deg, #FFFBF0, #FFF8E8);
    border: 3px solid #E0C28A;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 0 20px rgba(212, 175, 55, 0.25);
    color: #1a1a1a;
}

[data-theme="light"] #creativeChatBtn:hover i {
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

/* Creative Chat Container - Dark Mode (default) */
#creativeChatContainer {
	position: fixed;
	bottom: 130px;
	right: 40px;
	width: 500px;
	height: 700px;
	background: linear-gradient(135deg, #0A1A2F, #050A14);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	z-index: 9998;
	overflow: hidden;
	border: 2px solid #D4AF37;
	display: none;
	opacity: 0;
	transform: translateY(30px) scale(0.95);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	font-family: 'Poppins', sans-serif;
}

/* Creative Chat Container - Light Mode */
[data-theme="light"] #creativeChatContainer {
	background: linear-gradient(135deg, #FFF9EF, #FFF5E6);
	border: 2px solid #D4AF37;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

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

/* Chat Header - Dark Mode */
.creative-chat-header {
	background: linear-gradient(135deg, #0A1A2F, #050A14);
	color: #FFFFFF;
	padding: 10px;
	position: relative;
	flex-shrink: 0;
	border-bottom: 3px solid #D4AF37;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* Chat Header - Light Mode */
[data-theme="light"] .creative-chat-header {
	background: linear-gradient(135deg, #FFF9EF, #FFF5E6);
	color: #2E2C2A;
	border-bottom: 3px solid #D4AF37;
}

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

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

[data-theme="light"] .assistant-icon {
	color: #C5A267;
}

@keyframes gentleSway {
	0%, 100% {
		transform: rotate(0deg);
	}
	50% {
		transform: rotate(10deg);
	}
}

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

[data-theme="light"] .close-creative-chat {
	background: rgba(212, 175, 55, 0.15);
	border: 2px solid rgba(212, 175, 55, 0.4);
	color: #2E2C2A;
}

.close-creative-chat:hover {
	background: rgba(212, 175, 55, 0.4);
	transform: rotate(90deg);
	border-color: #D4AF37;
}

[data-theme="light"] .close-creative-chat:hover {
	background: rgba(212, 175, 55, 0.3);
	color: #1a1a1a;
}

/* Quick Topics Section - Dark Mode */
.quick-topics-section {
	height: 220px;
	background: rgba(10, 26, 47, 0.9);
	border-bottom: 2px solid rgba(212, 175, 55, 0.3);
	padding: 20px;
	flex-shrink: 0;
}

/* Quick Topics Section - Light Mode */
[data-theme="light"] .quick-topics-section {
	background: rgba(255, 249, 239, 0.95);
	border-bottom: 2px solid rgba(212, 175, 55, 0.25);
}

/* Creative Tabs - Dark Mode */
.creative-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	border-bottom: 2px solid rgba(212, 175, 55, 0.3);
	padding-bottom: 15px;
}

.creative-tab {
	flex: 1;
	background: rgba(5, 10, 20, 0.6);
	border: 2px solid rgba(212, 175, 55, 0.3);
	color: #E1E4E8;
	padding: 12px;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 0.85rem;
	position: relative;
	overflow: hidden;
}

/* Creative Tabs - Light Mode */
[data-theme="light"] .creative-tab {
	background: rgba(255, 255, 255, 0.8);
	border: 2px solid rgba(212, 175, 55, 0.3);
	color: #5E5A55;
}

.creative-tab.active {
	background: linear-gradient(135deg, #D4AF37, #C89B3C);
	color: #050A14;
	border-color: #D4AF37;
	box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
	font-weight: 600;
}

[data-theme="light"] .creative-tab.active {
	background: linear-gradient(135deg, #E0C28A, #C5A267);
	color: #2E2C2A;
	box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.creative-tab:hover:not(.active) {
	border-color: #D4AF37;
	color: #D4AF37;
	transform: translateY(-2px);
}

[data-theme="light"] .creative-tab:hover:not(.active) {
	color: #C5A267;
}

/* Topics Grid - Dark Mode */
.topics-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px 12px;
	row-gap: 6px;
	height: 140px;
	overflow-y: auto;
	padding: 10px;
	background: rgba(5, 10, 20, 0.4);
	border-radius: 10px;
	border: 2px solid rgba(212, 175, 55, 0.2);
	align-content: start;
}

/* Topics Grid - Light Mode */
[data-theme="light"] .topics-grid {
	background: rgba(255, 255, 255, 0.7);
	border: 2px solid rgba(212, 175, 55, 0.2);
}

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

.topics-grid::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #D4AF37, #C89B3C);
	border-radius: 3px;
}

/* Topic Buttons - Dark Mode */
.topic-button {
	height: 38px;
	background: rgba(10, 26, 47, 0.8);
	border: 2px solid rgba(212, 175, 55, 0.3);
	color: #E1E4E8;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 0.7rem;
	font-family: 'Poppins', sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 8px;
	overflow: hidden;
}

/* Topic Buttons - Light Mode */
[data-theme="light"] .topic-button {
	background: rgba(255, 255, 255, 0.9);
	border: 2px solid rgba(212, 175, 55, 0.3);
	color: #5E5A55;
}

.topic-button:hover {
	background: linear-gradient(135deg, #D4AF37, #C89B3C);
	color: #050A14;
	font-weight: 500;
	border-color: #D4AF37;
}

[data-theme="light"] .topic-button:hover {
	background: linear-gradient(135deg, #E0C28A, #C5A267);
	color: #2E2C2A;
}

/* Messages Area - Dark Mode */
.creative-messages {
	flex: 1;
	overflow-y: auto;
	padding: 25px;
	background: rgba(5, 10, 20, 0.6);
	will-change: transform;
}

/* Messages Area - Light Mode */
[data-theme="light"] .creative-messages {
	background: rgba(255, 249, 239, 0.7);
}

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

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

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

/* Assistant Message - Dark Mode */
.assistant-message {
	background: rgba(10, 26, 47, 0.9);
	border: 2px solid rgba(212, 175, 55, 0.4);
	border-left: 4px solid #D4AF37;
	align-self: flex-start;
	border-top-left-radius: 5px;
	color: #E1E4E8;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Assistant Message - Light Mode */
[data-theme="light"] .assistant-message {
	background: rgba(255, 255, 255, 0.95);
	border: 2px solid rgba(212, 175, 55, 0.3);
	border-left: 4px solid #D4AF37;
	color: #2E2C2A;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* User Message - Dark Mode */
.user-message {
	background: linear-gradient(135deg, #D4AF37, #C89B3C);
	align-self: flex-end;
	border-top-right-radius: 5px;
	color: #050A14;
	font-weight: 500;
	box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* User Message - Light Mode */
[data-theme="light"] .user-message {
	background: linear-gradient(135deg, #E0C28A, #C5A267);
	color: #2E2C2A;
	box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

/* Input Section - Dark Mode */
.creative-input-section {
	height: 100px;
	padding: 20px;
	background: rgba(5, 10, 20, 0.9);
	border-top: 2px solid rgba(212, 175, 55, 0.3);
	flex-shrink: 0;
	position: relative;
}

/* Input Section - Light Mode */
[data-theme="light"] .creative-input-section {
	background: rgba(255, 255, 255, 0.95);
	border-top: 2px solid rgba(212, 175, 55, 0.25);
}

.creative-input-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, #D4AF37, #C89B3C);
}

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

/* Input Field - Dark Mode */
.creative-input {
	flex: 1;
	height: 50px;
	background: rgba(10, 26, 47, 0.8);
	border: 2px solid rgba(212, 175, 55, 0.3);
	border-radius: 10px;
	padding: 0 25px;
	color: #E1E4E8;
	font-family: 'Poppins', sans-serif;
	font-size: 1rem;
	transition: all 0.2s ease;
}

/* Input Field - Light Mode */
[data-theme="light"] .creative-input {
	background: rgba(255, 249, 239, 0.9);
	border: 2px solid rgba(212, 175, 55, 0.3);
	color: #2E2C2A;
}

.creative-input:focus {
	outline: none;
	border-color: #D4AF37;
	box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
	background: rgba(10, 26, 47, 1);
}

[data-theme="light"] .creative-input:focus {
	background: #FFFFFF;
	box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.creative-input::placeholder {
	color: #8A8D93;
}

[data-theme="light"] .creative-input::placeholder {
	color: #B8B2A8;
}

/* Send Button - Dark Mode */
.creative-send {
	width: 50px;
	height: 50px;
	background: linear-gradient(135deg, #D4AF37, #C89B3C);
	border: none;
	border-radius: 10px;
	color: #050A14;
	font-size: 1.2rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Send Button - Light Mode */
[data-theme="light"] .creative-send {
	background: linear-gradient(135deg, #E0C28A, #C5A267);
	color: #2E2C2A;
}

.creative-send:hover {
	transform: scale(1.1) rotate(10deg);
	box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

/* Typing Indicator - Dark Mode */
.creative-typing {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 15px 20px;
	background: rgba(10, 26, 47, 0.9);
	border-radius: 15px;
	width: fit-content;
	border: 2px solid rgba(212, 175, 55, 0.4);
	margin-bottom: 20px;
	opacity: 0;
	animation: fadeIn 0.3s ease forwards;
	will-change: transform, opacity;
}

/* Typing Indicator - Light Mode */
[data-theme="light"] .creative-typing {
	background: rgba(255, 255, 255, 0.95);
	border: 2px solid rgba(212, 175, 55, 0.3);
}

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

.creative-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #D4AF37;
	animation: creativeBounce 1.4s infinite ease-in-out;
}

[data-theme="light"] .creative-dot {
	background: #C5A267;
}

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

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

@keyframes creativeBounce {
	0%, 80%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	40% {
		transform: scale(1.2);
		opacity: 1;
	}
}

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

	.topics-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	
	#creativeChatBtn {
		width: 52px;
		height: 52px;
		font-size: 22px;
		border-width: 2.5px;
		animation-duration: 2s;
	}
}

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

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

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

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

#creativeChatContainer.open {
	display: flex;
}

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

.xlinks a {
	color: #D4AF37;
	text-decoration: none;
	transition: color 0.2s ease;
}

.xlinks a:hover {
	color: #F5E8C7;
}

[data-theme="light"] .xlinks a {
	color: #C5A267;
}

[data-theme="light"] .xlinks a:hover {
	color: #D4AF37;
}

/********************** output text **********************/

/* Chatbot Link and Text Styling - Dark Mode */
.creative-message.assistant-message a {
    color: #14FFEC;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.creative-message.assistant-message a:hover {
    color: #39FF14;
    text-decoration: none;
}

.creative-message.assistant-message strong,
.creative-message.assistant-message b {
    color: #39FF14;
    font-weight: 600;
}



/* Light mode - Using your site's gold/cream palette */
[data-theme="light"] .creative-message.assistant-message {
    color: #5E5A55 !important;
}

[data-theme="light"] .creative-message.assistant-message a {
    color: #C5A267;
    text-decoration: underline;
    font-weight: 500;
}

[data-theme="light"] .creative-message.assistant-message a:hover {
    color: #D4AF37;
}

[data-theme="light"] .creative-message.assistant-message strong,
[data-theme="light"] .creative-message.assistant-message b {
    color: #C5A267;
    font-weight: 700;
}

[data-theme="light"] .creative-message.assistant-message p,
[data-theme="light"] .creative-message.assistant-message span,
[data-theme="light"] .creative-message.assistant-message div {
    color: #5E5A55;
}

/* User messages in light mode - matching site theme */
[data-theme="light"] .user-message {
    background: linear-gradient(135deg, #E0C28A, #C5A267);
    color: #2E2C2A;
}

[data-theme="light"] .user-message strong,
[data-theme="light"] .user-message b {
    color: #2E2C2A;
    font-weight: 700;
}

/* Touch Device Fixes */
@media (hover: hover) and (pointer: fine) {
    /* Desktop styles - keep as is */
}

@media (hover: none) and (pointer: coarse) {
    /* Touch devices - enhance button tap area and ensure clickability */
    
    #creativeChatBtn {
        width: 64px;
        height: 64px;
        bottom: 20px;
        right: 20px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        z-index: 999999 !important;
        position: fixed;
    }
    
    /* Remove hover animation on touch devices */
    #creativeChatBtn:hover {
        animation: breathe 2.5s ease-in-out infinite;
        transform: none;
    }
    
    [data-theme="light"] #creativeChatBtn:hover {
        animation: breatheLight 2.5s ease-in-out infinite;
        transform: none;
    }
    
    /* Ensure chat container is above everything */
    #creativeChatContainer {
        z-index: 999998 !important;
        touch-action: pan-y pinch-zoom;
    }
    
    #creativeChatContainer.open {
        touch-action: auto;
    }
    
    /* Make all interactive elements have proper touch targets */
    .creative-tab,
    .topic-button,
    .creative-send,
    .close-creative-chat,
    .xlinks a {
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
    }
    
    /* Prevent hover states from persisting after tap */
    .creative-tab:active,
    .topic-button:active,
    .creative-send:active {
        transform: scale(0.98);
        transition: transform 0.05s ease;
    }
    
    /* Increase tap area for send button */
    .creative-send {
        min-width: 50px;
        min-height: 50px;
    }
    
    /* Ensure input field is tappable */
    .creative-input {
        touch-action: manipulation;
        cursor: text;
    }
    
    /* Close button larger tap area */
    .close-creative-chat {
        min-width: 44px;
        min-height: 44px;
    }
}