/* EMOTION MIND MAP - PROFESSIONAL DESIGN SYSTEM
 * Created with a modern, minimalist approach
 */

/* TYPOGRAPHY SYSTEM */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* DESIGN TOKENS */
:root {
	/* Color System - More minimalist palette */
	--color-primary: #4361ee;
	--color-primary-light: #6a80ea;
	--color-primary-dark: #3a4cb7;

	/* Minimalist monochrome palette */
	--color-dark: #212529;
	--color-gray-900: #343a40;
	--color-gray-800: #495057;
	--color-gray-700: #6c757d;
	--color-gray-600: #adb5bd;
	--color-gray-500: #ced4da;
	--color-gray-400: #dee2e6;
	--color-gray-300: #e9ecef;
	--color-gray-200: #f0f3f5;
	--color-gray-100: #f8f9fa;
	--color-white: #ffffff;

	/* Semantic colors - more subdued */
	--color-success: #8cc1a0;
	--color-warning: #e9b872;
	--color-danger: #e27d7d;

	/* Spacing System (px) */
	--space-xxs: 4px;
	--space-xs: 8px;
	--space-sm: 12px;
	--space-md: 16px;
	--space-lg: 24px;
	--space-xl: 32px;
	--space-xxl: 48px;

	/* Shadows - more subtle */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05);
	--shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.05);
	--shadow-xl: 0 5px 15px rgba(0, 0, 0, 0.08);

	/* Border Radius */
	--radius-sm: 4px;
	--radius-md: 6px;
	--radius-lg: 8px;
	--radius-xl: 12px;
	--radius-full: 9999px;

	/* Transitions */
	--transition-fast: 150ms ease;
	--transition-normal: 250ms ease;
	--transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

	/* Z-index layers */
	--z-background: -10;
	--z-default: 1;
	--z-header: 100;
	--z-overlay: 200;
	--z-modal: 300;
	--z-highest: 9999;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	line-height: 1.6;
	color: var(--color-gray-900);
	background-color: var(--color-white);
	min-height: 100vh;
	overflow: hidden;
	font-weight: 400;
}

/* LAYOUT */
#mindmap {
	width: 100vw;
	height: 100vh;
	border: none;
	background-color: var(--color-white);
	position: absolute;
	top: 0;
	left: 0;
}

.app-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--space-md) var(--space-lg);
	z-index: var(--z-header);
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border-bottom: 1px solid var(--color-gray-200);
}

h1 {
	color: var(--color-dark);
	font-size: 1.4rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

h1::before {
	content: '❤️';
	display: inline-block;
	margin-right: var(--space-xxs);
}

.controls {
	position: absolute;
	top: var(--space-xl);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	z-index: var(--z-header);
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border-radius: var(--radius-lg);
	padding: var(--space-xs) var(--space-sm);
	box-shadow: var(--shadow-sm);
	flex-wrap: wrap;
	justify-content: center;
}

/* BUTTONS - More minimalist approach */
button {
	font-family: 'Inter', sans-serif;
	font-size: 0.9rem;
	font-weight: 500;
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: all var(--transition-normal);
	border: 1px solid var(--color-gray-300);
	background: var(--color-white);
	color: var(--color-gray-800);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-xxs);
	white-space: nowrap;
	box-shadow: var(--shadow-sm);
}

button:hover {
	background: var(--color-gray-100);
	box-shadow: var(--shadow-md);
	border-color: var(--color-gray-400);
}

button:active {
	transform: translateY(1px);
	box-shadow: var(--shadow-sm);
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Primary Button - simplified */
#tour-btn,
#panel-next-btn {
	background-color: var(--color-primary);
	color: white;
	border-color: var(--color-primary);
}

#tour-btn:hover,
#panel-next-btn:hover {
	background-color: var(--color-primary-dark);
	border-color: var(--color-primary-dark);
}

/* Danger Button - simplified */
#reset-btn {
	background-color: var(--color-white);
	color: var(--color-danger);
	border-color: var(--color-danger);
}

#reset-btn:hover {
	background-color: var(--color-danger);
	color: white;
}

/* PANEL STYLES */
.panel {
	position: fixed;
	top: var(--space-xl);
	right: var(--space-xl);
	width: 380px;
	max-width: calc(100vw - 2 * var(--space-xl));
	max-height: calc(100vh - 2 * var(--space-xl));
	background: var(--color-white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	padding: var(--space-xl);
	z-index: var(--z-modal);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	transition: transform var(--transition-slow), opacity var(--transition-slow);
	border: 1px solid var(--color-gray-300);
}

.panel.hidden {
	opacity: 0;
	transform: translateX(50px);
	pointer-events: none;
}

#panel-close-btn {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-white);
	border-radius: var(--radius-full);
	font-size: 0.9rem;
	padding: 0;
	color: var(--color-gray-700);
	border-color: var(--color-gray-300);
}

#panel-close-btn:hover {
	background: var(--color-gray-100);
	color: var(--color-gray-900);
}

#panel-title {
	margin-bottom: var(--space-md);
	color: var(--color-primary-dark);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
}

/* Create a description container with fixed height */
.description-container {
	height: 120px;
	/* Fixed height for description */
	overflow-y: auto;
	/* Allow scrolling for longer descriptions */
	margin-bottom: var(--space-lg);
	padding-right: var(--space-xs);
	/* Space for scrollbar */
}

/* Style the scrollbar for the description container */
.description-container::-webkit-scrollbar {
	width: 6px;
}

.description-container::-webkit-scrollbar-track {
	background: var(--color-gray-100);
	border-radius: 3px;
}

.description-container::-webkit-scrollbar-thumb {
	background-color: var(--color-gray-400);
	border-radius: 3px;
}

#panel-description {
	color: var(--color-gray-800);
	font-size: 1rem;
	line-height: 1.6;
	margin: 0;
	/* Remove margin as container handles spacing */
}

.panel hr {
	border: none;
	height: 1px;
	background: var(--color-gray-300);
	margin: 0 0 var(--space-lg) 0;
	/* Adjusted margins */
}

/* Panel content area with consistent height */
.panel-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	min-height: 350px;
	/* Minimum height to ensure consistency */
}

/* Update panel action layout to be more consistent */
.panel-actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.feel-group {
	display: flex;
	align-items: center;
	background: var(--color-gray-100);
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-md);
	gap: var(--space-sm);
	border: 1px solid var(--color-gray-200);
}

.feel-question {
	color: var(--color-gray-800);
	font-weight: 500;
	margin-right: auto;
}

#panel-feel-yes-btn,
#panel-feel-no-btn {
	min-width: 60px;
	font-size: 0.85rem;
	padding: var(--space-xxs) var(--space-sm);
}

#panel-feel-yes-btn {
	background: var(--color-success);
	color: white;
	border-color: var(--color-success);
}

#panel-feel-no-btn {
	background: var(--color-gray-600);
	color: white;
	border-color: var(--color-gray-600);
}

/* Selected Feel Button States - enhanced */
.panel-actions button.selected-feel {
	box-shadow: var(--shadow-md);
	transform: scale(1.05);
	font-weight: 600;
	border-width: 2px;
}

/* Individual button selected states */
#panel-feel-yes-btn.selected-feel {
	background-color: #3c9a55 !important;
	color: white !important;
	border-color: white !important;
}

#panel-feel-no-btn.selected-feel {
	background-color: var(--color-gray-800) !important;
	color: white !important;
	border-color: white !important;
}

/* Panel notes section with consistent spacing */
.panel-notes {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	margin-top: var(--space-lg);
	padding-top: var(--space-lg);
	border-top: 1px solid var(--color-gray-300);
}

.panel-notes label {
	color: var(--color-gray-800);
	font-weight: 500;
	font-size: 0.9rem;
}

.panel-notes textarea {
	width: 100%;
	min-height: 100px;
	border: 1px solid var(--color-gray-300);
	border-radius: var(--radius-md);
	padding: var(--space-sm);
	font-family: inherit;
	font-size: 0.9rem;
	color: var(--color-gray-900);
	background: var(--color-white);
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
	resize: vertical;
}

.panel-notes textarea:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}

/* Reset Instructions */
#reset-instructions {
	position: fixed;
	bottom: var(--space-lg);
	left: var(--space-lg);
	background: var(--color-white);
	padding: var(--space-sm) var(--space-md);
	border-radius: var(--radius-md);
	font-size: 0.8rem;
	color: var(--color-gray-700);
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--color-gray-300);
	z-index: var(--z-overlay);
	transition: opacity var(--transition-normal);
}

#reset-instructions:hover {
	opacity: 0.7;
}

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

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

/* Loading overlay styles */
#loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.95);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: var(--z-highest);
}

#loading-overlay p {
	margin-top: var(--space-md);
	font-size: 1.1rem;
	color: var(--color-primary);
	font-weight: 500;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--color-gray-300);
	border-radius: 50%;
	border-top-color: var(--color-primary);
	animation: spin 1s ease-in-out infinite;
}

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

/* Show loading overlay when needed */
#loading-overlay.hidden {
	display: none;
}

/* Enhance the visuals for the nodes in the mind map - more minimalist */
.vis-network .vis-node {
	transition: all var(--transition-normal) !important;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
	.controls {
		padding: var(--space-xxs) var(--space-xs);
		flex-wrap: wrap;
		justify-content: center;
		width: calc(100% - 2 * var(--space-lg));
		gap: 4px;
	}

	button {
		padding: var(--space-xxs) var(--space-sm);
		font-size: 0.8rem;
	}

	.panel {
		top: var(--space-md);
		right: var(--space-md);
		max-width: calc(100vw - 2 * var(--space-md));
		max-height: calc(100vh - 2 * var(--space-md));
		padding: var(--space-lg);
	}

	#panel-title {
		font-size: 1.3rem;
	}
}

/* RTL SUPPORT FOR PERSIAN */
html[lang="fa"] {
	direction: rtl;
}

html[lang="fa"] body {
	font-family: 'Inter', Tahoma, Arial, sans-serif;
}

html[lang="fa"] .controls {
	flex-direction: row-reverse;
}

html[lang="fa"] button {
	font-family: 'Inter', Tahoma, Arial, sans-serif;
}

html[lang="fa"] #emotion-panel {
	left: var(--space-xl);
	right: auto;
}

html[lang="fa"] #panel-close-btn {
	left: var(--space-sm);
	right: auto;
}

html[lang="fa"] #reset-instructions {
	right: var(--space-lg);
	left: auto;
}

/* Subtle button click effect */
button:active::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.05);
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(0);
	animation: ripple 0.6s linear;
}

@keyframes ripple {
	0% {
		transform: translate(-50%, -50%) scale(0);
		opacity: 1;
	}

	100% {
		transform: translate(-50%, -50%) scale(2.5);
		opacity: 0;
	}
}

/* Add or update the hidden class definition to explicitly hide elements */
.hidden {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Buy Me a Coffee button */
.bmc-button {
	position: fixed;
	bottom: var(--space-lg);
	right: var(--space-lg);
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-xs) var(--space-lg);
	background-color: #FFDD00;
	color: #000000;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	border-radius: var(--radius-full);
	box-shadow: var(--shadow-md);
	transition: all var(--transition-normal);
	z-index: var(--z-overlay);
	border: 2px solid #FFDD00;
}

.bmc-button:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
	background-color: #FFDD00;
}

.bmc-button i {
	font-size: 1.1rem;
}

/* Adjust position for RTL languages */
html[lang="fa"] .bmc-button {
	left: var(--space-lg);
	right: auto;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
	.bmc-button {
		bottom: var(--space-md);
		right: var(--space-md);
		padding: var(--space-xxs) var(--space-md);
		font-size: 0.8rem;
	}

	html[lang="fa"] .bmc-button {
		left: var(--space-md);
		right: auto;
	}
}

/* Footer credit styling */
.footer-credit {
	position: fixed;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	font-size: 0.85rem;
	color: var(--color-gray-600);
	background-color: rgba(255, 255, 255, 0.8);
	padding: 6px 12px;
	border-radius: var(--radius-md);
	z-index: var(--z-overlay);
	box-shadow: var(--shadow-sm);
	transition: all var(--transition-normal);
}

.footer-credit p {
	margin: 0;
}

.footer-credit i {
	color: #e25555;
	margin: 0 2px;
	animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
	0% {
		transform: scale(1);
	}

	15% {
		transform: scale(1.2);
	}

	30% {
		transform: scale(1);
	}

	45% {
		transform: scale(1.2);
	}

	60% {
		transform: scale(1);
	}
}

/* Adjust for RTL languages */
html[lang="fa"] .footer-credit i {
	margin: 0 2px;
}

/* Mobile adjustment */
@media (max-width: 768px) {
	.footer-credit {
		bottom: 40px;
		font-size: 0.75rem;
		padding: 4px 8px;
	}
}