/* Frontend CSS cho Plugin THX Planning - Premium UI/UX Overhaul */

:root {
	/* Palette */
	--thx-bg-body: #f4f7f6;
	--thx-bg-card: #ffffff;
	--thx-bg-alt: #f8fafc;
	
	/* Typography */
	--thx-text-main: #2d3748;
	--thx-text-muted: #718096;
	--thx-text-light: #a0aec0;
	
	/* Primary Accents */
	--thx-primary: #4299e1;
	--thx-primary-hover: #3182ce;
	--thx-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	
	/* Matrix Colors - Pastel */
	--thx-q1-border: #f56565;
	--thx-q1-bg: #fff5f5;
	--thx-q2-border: #48bb78;
	--thx-q2-bg: #f0fff4;
	--thx-q3-border: #ed8936;
	--thx-q3-bg: #fffaf0;
	--thx-q4-border: #cbd5e0;
	--thx-q4-bg: #f7fafc;
	
	/* Shadows & Radius */
	--thx-radius-sm: 8px;
	--thx-radius-md: 12px;
	--thx-radius-lg: 20px;
	--thx-shadow-sm: 0 2px 4px rgba(0,0,0,0.03);
	--thx-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
	--thx-shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
	--thx-shadow-hover: 0 15px 35px rgba(0,0,0,0.12);
	
	/* Transitions */
	--thx-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.thx-plan-wrapper {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--thx-bg-body);
	color: var(--thx-text-main);
	line-height: 1.6;
	border-radius: var(--thx-radius-lg);
	overflow: hidden;
}

/* =========================================
   HEADER & TABS
========================================= */
.thx-plan-header {
	background: var(--thx-bg-card);
	padding: 35px 35px 0;
	border-radius: var(--thx-radius-lg);
	box-shadow: var(--thx-shadow-md);
	margin-bottom: 30px;
}

.thx-dash-title {
	margin: 0 0 5px 0;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.5px;
	background: var(--thx-primary-gradient);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.thx-dash-subtitle {
	font-size: 15px;
	color: var(--thx-text-muted);
	margin-bottom: 25px;
}

/* Tooltip */
.thx-tooltip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #edf2f7;
	color: var(--thx-text-muted);
	font-size: 12px;
	font-weight: bold;
	margin-left: 6px;
	cursor: help;
	position: relative;
	vertical-align: middle;
	transition: var(--thx-transition);
}
.thx-tooltip:hover {
	background: var(--thx-primary);
	color: white;
}
.thx-tooltip::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 150%;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background: #2d3748;
	color: white;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 400;
	white-space: pre-wrap;
	width: max-content;
	max-width: 280px;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	line-height: 1.5;
	text-align: left;
}
.thx-tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	border: 6px solid transparent;
	border-top-color: #2d3748;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.thx-tooltip:hover::after,
.thx-tooltip:hover::before {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}
.thx-tooltip:hover::after {
	bottom: calc(100% + 12px);
}
.thx-tooltip:hover::before {
	bottom: calc(100% + 1px);
}

/* Tab Underline Style */
.thx-nav-tabs {
	display: flex;
	gap: 20px;
	margin-top: 20px;
	border-bottom: 2px solid #edf2f7;
	padding-bottom: 0;
	overflow-x: auto;
}
.thx-nav-tabs::-webkit-scrollbar {
	display: none;
}
.thx-tab-link {
	background: transparent;
	border: none;
	padding: 12px 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--thx-text-muted);
	cursor: pointer;
	position: relative;
	transition: var(--thx-transition);
	outline: none;
	white-space: nowrap;
}
.thx-tab-link::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 100%;
	height: 3px;
	background: var(--thx-primary);
	transform: scaleX(0);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform-origin: center;
	border-radius: 3px 3px 0 0;
}
.thx-tab-link:hover {
	color: var(--thx-text-main);
}
.thx-tab-link.active {
	color: var(--thx-primary);
}
.thx-tab-link.active::after {
	transform: scaleX(1);
}

.thx-tab-pane { display: none; }
.thx-tab-pane.active {
	display: block;
	animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* =========================================
   FORMS, INPUTS & BUTTONS
========================================= */
.thx-plan-content {
	padding: 0 10px;
}

.thx-roles-section {
	max-width: 700px;
}
.thx-mission-section {
	width: 100%;
}
.thx-mission-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 30px;
}

.thx-hint {
	font-size: 13px;
	color: var(--thx-text-light);
	margin-top: -10px;
	margin-bottom: 15px;
}

input[type="text"], textarea, select {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #e2e8f0;
	border-radius: var(--thx-radius-sm);
	background: #f8fafc;
	font-family: inherit;
	font-size: 14px;
	color: var(--thx-text-main);
	transition: var(--thx-transition);
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.01);
}
input[type="text"]:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--thx-primary);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

textarea {
	resize: vertical;
	min-height: 80px;
}
.thx-mission-section .wp-editor-wrap {
	margin-bottom: 15px;
}
.thx-add-cv-inputs .wp-editor-wrap {
	width: 100%;
}
.thx-add-role-form {
	align-items: flex-start !important;
}
.thx-add-role-form .wp-editor-wrap {
	width: 100%;
}

/* TinyMCE Editor Fixes */
.mce-container .mce-btn:hover,
.mce-container .mce-btn:focus,
.mce-container .mce-btn.mce-active,
.mce-container .mce-btn button:hover,
.mce-container .mce-btn button:focus {
	background: #edf2f7 !important;
	border-color: #cbd5e0 !important;
}
.mce-container .mce-btn:hover i.mce-ico,
.mce-container .mce-btn:focus i.mce-ico,
.mce-container .mce-btn.mce-active i.mce-ico,
.mce-container .mce-btn button:hover i.mce-ico,
.mce-container .mce-btn button:focus i.mce-ico {
	color: #2b6cb0 !important;
}

.button-primary {
	background: var(--thx-primary-gradient) !important;
	border: none !important;
	color: white !important;
	font-weight: 600 !important;
	border-radius: var(--thx-radius-md) !important;
	padding: 10px 20px !important;
	cursor: pointer;
	transition: var(--thx-transition) !important;
	box-shadow: 0 4px 6px rgba(102, 126, 234, 0.25) !important;
	text-shadow: none !important;
}
.button-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 7px 14px rgba(102, 126, 234, 0.35) !important;
}
.button-primary:active {
	transform: translateY(0);
}

/* =========================================
   CORE VALUES & ROLES (Lists)
========================================= */
.thx-cv-list, #thx-roles-list {
	list-style: none;
	padding: 0;
	margin: 0 0 20px 0;
}
.thx-cv-item, #thx-roles-list li {
	background: var(--thx-bg-card);
	border: 1px solid #edf2f7;
	padding: 12px 18px;
	margin-bottom: 10px;
	border-radius: var(--thx-radius-md);
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: var(--thx-shadow-sm);
	transition: var(--thx-transition);
}
.thx-cv-item:hover, #thx-roles-list li:hover {
	transform: translateX(4px);
	box-shadow: var(--thx-shadow-md);
	border-color: #e2e8f0;
	position: relative;
	z-index: 99999;
}

.thx-cv-info strong {
	color: var(--thx-text-main);
	display: block;
	font-size: 15px;
}
.thx-cv-info span {
	color: var(--thx-text-muted);
	font-size: 13px;
	margin-top: 3px;
}
.thx-cv-remove, .thx-role-remove {
	color: #fc8181;
	cursor: pointer;
	background: rgba(254, 215, 215, 0.3);
	border: none;
	font-size: 18px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--thx-transition);
}
.thx-cv-remove:hover, .thx-role-remove:hover {
	background: #feb2b2;
	color: #c53030;
	transform: scale(1.1);
}

.thx-role-hidden {
	opacity: 0.5;
	filter: grayscale(100%);
}
.thx-role-hidden strong {
	font-weight: normal;
	text-decoration: line-through;
}
.thx-role-toggle-hide {
	display: flex;
	align-items: center;
	justify-content: center;
}
.thx-role-toggle-hide:hover {
	color: var(--thx-primary) !important;
	transform: scale(1.1);
}

details[open] > summary .thx-details-icon {
	transform: rotate(90deg);
}
summary .thx-details-icon {
	transition: transform 0.2s ease-in-out;
}

.thx-add-cv-form {
	background: var(--thx-bg-alt);
	border: 1px dashed #cbd5e0;
	padding: 15px;
	border-radius: var(--thx-radius-md);
	margin-bottom: 25px;
	transition: var(--thx-transition);
}
.thx-add-cv-form:focus-within {
	border-color: var(--thx-primary);
	background: var(--thx-bg-card);
	box-shadow: var(--thx-shadow-sm);
}
.thx-add-cv-inputs {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 15px;
}
.thx-add-cv-actions {
	text-align: right;
}

.role-color-badge {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	margin-right: 12px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	border: 2px solid white;
}

.thx-add-role-wrapper {
	margin-bottom: 20px;
}
.thx-add-role-form {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 8px;
}
.thx-add-role-form input[type="text"] {
	flex-grow: 1;
}
.thx-color-picker-wrapper {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	position: relative;
	flex-shrink: 0;
	transition: var(--thx-transition);
	z-index: 1;
}
.thx-color-picker-wrapper:hover {
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
	transform: scale(1.05);
	z-index: 9999;
}
.thx-saved-colors-container {
	display: none !important;
	flex-direction: column;
	align-items: flex-start;
	position: absolute;
	top: 100%;
	left: -5px;
	background: #ffffff;
	padding: 10px;
	border-radius: 8px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.15);
	z-index: 99999;
	margin-top: 10px;
	border: 1px solid #e2e8f0;
	min-width: 150px;
}
.has-colors:hover {
	z-index: 99999;
}
.has-colors:hover .thx-saved-colors-container {
	display: flex !important;
}
.thx-saved-colors-container::after {
	content: '';
	position: absolute;
	top: -15px;
	left: 0;
	width: 100%;
	height: 15px;
	background: transparent;
}
.thx-saved-colors-container::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 18px;
	border-width: 0 6px 6px 6px;
	border-style: solid;
	border-color: transparent transparent #ffffff transparent;
	filter: drop-shadow(0 -1px 1px rgba(0,0,0,0.05));
}
#new-role-color {
	border-radius: 50%;
}
.thx-saved-colors-list {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.thx-saved-color-item {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
	position: relative;
	transition: var(--thx-transition);
}
.thx-saved-color-item:hover {
	transform: scale(1.15);
}
.thx-saved-color-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 14px;
	height: 14px;
	background: white;
	color: #e53e3e;
	border-radius: 50%;
	font-size: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	opacity: 0;
	transition: var(--thx-transition);
}
.thx-saved-color-item:hover .thx-saved-color-remove {
	opacity: 1;
}

/* =========================================
   COMPASS TAB (Sidebar + Main)
========================================= */
#thx-section-vision,
#thx-section-tasks,
#thx-section-calendar,
#thx-section-reflection {
	scroll-margin-top: 80px;
}

.thx-compass-container {
	display: flex;
	gap: 30px;
}
.thx-compass-sidebar {
	width: 320px;
	flex-shrink: 0;
}
.thx-compass-main {
	flex-grow: 1;
	background: var(--thx-bg-card);
	border-radius: var(--thx-radius-lg);
	padding: 20px;
	box-shadow: var(--thx-shadow-md);
	border: 1px solid #edf2f7;
}

.thx-constitution-reminder {
	background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
	border-left: 4px solid #319795;
	padding: 15px;
	margin-bottom: 25px;
	border-radius: 0 var(--thx-radius-md) var(--thx-radius-md) 0;
	box-shadow: var(--thx-shadow-sm);
}
.thx-constitution-item {
	margin-bottom: 10px;
}
.thx-constitution-item:last-child {
	margin-bottom: 0;
}
.thx-constitution-item summary {
	color: #2c7a7b;
	text-transform: uppercase;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	cursor: pointer;
	outline: none;
	user-select: none;
	list-style: none;
}
.thx-constitution-item summary::-webkit-details-marker {
	display: none;
}
.thx-constitution-item summary::before {
	content: '▶';
	display: inline-block;
	margin-right: 5px;
	font-size: 10px;
	transition: transform 0.2s ease;
}
.thx-constitution-item[open] summary::before {
	transform: rotate(90deg);
}
.thx-constitution-item p {
	margin: 5px 0 0 15px;
	font-size: 14px;
	color: #4a5568;
	line-height: 1.5;
}
.thx-constitution-item .thx-tags-list {
	margin: 10px 0 0 15px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.thx-constitution-item .thx-cv-tag {
	font-size: 11px;
	padding: 4px 10px;
	background: #319795;
	color: white;
	border-radius: 12px;
}

.role-block {
	background: var(--thx-bg-card);
	border-radius: var(--thx-radius-sm);
	padding: 15px;
	margin-bottom: 15px;
	box-shadow: var(--thx-shadow-sm);
	border: 1px solid #edf2f7;
	transition: var(--thx-transition);
}
.role-block:hover {
	box-shadow: var(--thx-shadow-md);
}

/* =========================================
   MATRIX TAB
========================================= */
.thx-matrix-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-top: 20px;
}

.matrix-cell {
	border-radius: var(--thx-radius-lg);
	padding: 25px;
	min-height: 250px;
	box-shadow: var(--thx-shadow-sm);
	transition: var(--thx-transition);
	position: relative;
	overflow: hidden;
}
.matrix-cell:hover {
	box-shadow: var(--thx-shadow-lg);
	transform: translateY(-2px);
}

.matrix-title {
	margin: 0 0 5px 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--thx-text-main);
	position: relative;
	z-index: 2;
}
.matrix-desc {
	font-size: 13px;
	color: var(--thx-text-muted);
	margin-top: 0;
	margin-bottom: 20px;
	position: relative;
	z-index: 2;
}

/* Pastel Backgrounds for Matrix */
.matrix-cell.q1 { background: var(--thx-q1-bg); border-top: 4px solid var(--thx-q1-border); }
.matrix-cell.q2 { background: var(--thx-q2-bg); border-top: 4px solid var(--thx-q2-border); }
.matrix-cell.q3 { background: var(--thx-q3-bg); border-top: 4px solid var(--thx-q3-border); }
.matrix-cell.q4 { background: var(--thx-q4-bg); border-top: 4px solid var(--thx-q4-border); }

.task-item {
	background: var(--thx-bg-card);
	border: 1px solid rgba(0,0,0,0.05);
	padding: 12px 16px;
	margin-bottom: 10px;
	border-radius: var(--thx-radius-sm);
	cursor: grab;
	box-shadow: var(--thx-shadow-sm);
	font-size: 14px;
	font-weight: 500;
	transition: var(--thx-transition);
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	position: relative;
	z-index: 2;
	color: var(--thx-text-main);
}
.task-item:hover {
	box-shadow: var(--thx-shadow-md);
	transform: translateY(-2px);
}
.task-item:active {
	cursor: grabbing;
	transform: scale(0.98);
}

/* Prevent layout jumping when toolbar appears */
.thx-subtask-item {
	position: relative;
}
.task-actions {
	position: absolute !important;
	right: 6px !important;
	top: 4px !important;
	background: #fff !important;
	padding: 2px 6px !important;
	border-radius: 6px !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
	z-index: 10 !important;
	display: flex !important;
	align-items: center !important;
	gap: 6px;
}
.subtask-actions {
	position: absolute !important;
	right: 2px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background: #fff !important;
	padding: 2px 6px !important;
	border-radius: 6px !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
	z-index: 10 !important;
	display: flex !important;
	align-items: center !important;
	gap: 6px;
	min-height: 24px;
}
.subtask-actions i {
	opacity: 0.7 !important;
	color: #4a5568; /* Default color for icons on white bg */
	display: inline-block !important;
	visibility: visible !important;
}
.subtask-actions i.dashicons-trash {
	color: #e53e3e !important;
}
.subtask-actions i:hover {
	opacity: 1 !important;
}

.task-actions i {
	color: #4a5568 !important; /* Default color for icons on white bg */
}
.task-actions i.dashicons-edit {
	color: #3182ce !important;
}
.task-actions i.dashicons-trash {
	color: #e53e3e !important;
}

/* Toolbar Desktop Hover */
@media screen and (min-width: 769px) {
	.task-item:hover:not(:has(.thx-subtask-item:hover)) > .task-actions,
	.thx-subtask-item:hover:not(:has(.thx-subtask-item:hover)) > .subtask-actions,
	.thx-subtask-item:hover:not(:has(.thx-subtask-item:hover)) > div > .subtask-actions {
		opacity: 1 !important;
		visibility: visible !important;
		display: flex !important;
	}
}

/* FullCalendar Overrides for Premium Feel */
.fc .fc-toolbar-title {
	font-size: 1.2em !important;
	font-weight: 700 !important;
}
.fc .fc-button-primary {
	background-color: #edf2f7 !important;
	border-color: transparent !important;
	color: #4a5568 !important;
	text-transform: none !important;
	box-shadow: none !important;
	transition: var(--thx-transition) !important;
}
.fc .fc-button-primary:hover {
	background-color: #e2e8f0 !important;
	color: #2d3748 !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active, 
.fc .fc-button-primary:not(:disabled):active {
	background-color: var(--thx-primary) !important;
	color: white !important;
}
.fc .fc-timegrid-slot {
	height: 2.5em !important; /* Taller slots */
}
.fc-event {
	border-radius: 4px !important;
	box-shadow: var(--thx-shadow-sm) !important;
	border: none !important;
	padding: 2px 4px !important;
	transition: var(--thx-transition);
}
.fc-event:hover {
	box-shadow: var(--thx-shadow-md) !important;
	filter: brightness(1.05);
}

/* =========================================
   MOBILE NAV SHORTCUTS
========================================= */
.thx-mobile-nav-shortcuts {
	display: none;
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */
/* Prevent text selection on tasks */
.task-item, .thx-subtask-item, .task-title-text {
	-webkit-user-select: none !important;
	-moz-user-select: none !important;
	-ms-user-select: none !important;
	user-select: none !important;
}

/* Ensure consistent spacing between checkbox and text */
.task-item {
	display: flex !important;
	gap: 8px !important;
}

/* Universal spacing for task checkbox */
input.task-complete-cb {
	margin: 2px 0 0 8px !important;
}

@media screen and (max-width: 768px) {
	.thx-mobile-nav-shortcuts {
		display: flex;
		justify-content: space-around;
		background: #fff;
		border: 1px solid #e2e8f0;
		border-radius: 12px;
		padding: 10px 5px;
		margin-bottom: 0;
		box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
		position: fixed;
		bottom: 15px;
		left: 15px;
		right: 15px;
		z-index: 9999;
	}
	.thx-mobile-nav-btn {
		display: flex;
		flex-direction: column;
		align-items: center;
		color: #4a5568;
		font-size: 11px;
		text-decoration: none;
		font-weight: 600;
		transition: color 0.2s;
	}
	.thx-mobile-nav-btn i {
		font-size: 20px;
		height: 20px;
		width: 20px;
		margin-bottom: 4px;
		color: #3182ce;
	}
	.thx-mobile-nav-btn:hover, .thx-mobile-nav-btn:active {
		color: #2b6cb0;
		text-decoration: none;
	}
	
	.thx-plan-header {
		padding: 20px 20px 0;
	}
	
	.thx-header-inner {
		flex-direction: column;
		align-items: flex-start !important;
		gap: 20px;
	}
	
	.thx-dash-title-wrapper {
		padding: 15px 20px !important;
	}
	
	.thx-dash-title {
		font-size: 24px !important;
	}
	.thx-dash-subtitle {
		font-size: 13px !important;
	}
	
	.thx-header-right {
		width: 100%;
		justify-content: flex-start !important;
		flex-wrap: wrap;
	}
	
	.thx-header-artwork {
		display: none !important;
	}
	
	.thx-plan-content {
		padding: 0;
	}
	
	.thx-compass-container {
		flex-direction: column;
		gap: 20px;
		padding-bottom: 80px; /* Space for fixed bottom nav */
	}
	.thx-compass-sidebar {
		width: 100%;
		max-height: 65vh;
		overflow-y: auto;
		border-bottom: 2px dashed #cbd5e0;
		padding-bottom: 15px;
	}
	.thx-compass-main {
		width: 100%;
	}
	
	.thx-matrix-grid {
		grid-template-columns: 1fr;
	}
	.fc-toolbar { flex-wrap: wrap; }
	.fc-toolbar-title { font-size: 14px !important; margin: 5px 0 !important; }
	
	/* Chặn double-tap zoom (zoom bằng cách gõ 2 lần) trên Mobile */
	.thx-plan-wrapper, input, button, select, textarea, a, .task-item, .thx-subtask-item {
		touch-action: manipulation !important;
	}


	/* --- Cải thiện giao diện Định hướng cốt lõi trên Mobile (Hiển thị gọn gàng) --- */
	.thx-constitution-reminder {
		flex-wrap: nowrap !important;
		overflow-x: auto;
		padding-bottom: 5px !important;
		gap: 12px !important;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none; /* Firefox */
	}
	.thx-constitution-reminder::-webkit-scrollbar {
		display: none; /* Chrome/Safari */
	}
	.thx-constitution-item {
		flex: 0 0 85% !important; /* Chiếm 85% chiều rộng để lộ một phần thẻ tiếp theo */
		min-width: auto !important;
	}
	
	/* Tăng kích thước nút chạm trên Mobile (Touch Targets) */
	input.task-complete-cb {
		width: 18px !important;
		height: 18px !important;
		margin: 2px 0 0 8px !important;
	}
	i.thx-subtasks-icon {
		font-size: 18px !important;
		width: 18px !important;
		height: 18px !important;
	}
	.subtask-edit-btn, .subtask-delete-btn {
		font-size: 20px !important;
		width: 20px !important;
		height: 20px !important;
		padding: 4px;
	}
	/* Mobile sử dụng chung logic click mở rộng như Desktop, không force hiện action nữa */
	/* Phóng to font chữ trên mobile để cân đối với nút bấm */
	.thx-subtask-item {
		padding: 8px 0 !important;
		font-size: 14px !important;
	}
	.task-title-text {
		font-size: 15px !important;
		line-height: 1.4 !important;
	}
	
	.thx-mission-grid {
		grid-template-columns: 1fr;
	}
	
	.thx-nav-tabs {
		display: none !important;
	}
	.thx-nav-tabs-mobile {
		display: block !important;
	}
	
	.thx-history-layout {
		display: flex !important;
		flex-direction: column;
		align-items: stretch !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}
	#thx-habit-streaks-container { order: 1; }
	#thx-history-analytics { 
		order: 2; 
		flex-direction: column; 
		width: 100% !important;
		box-sizing: border-box !important;
	}
	/* Cân bằng cuộc sống & Tiến độ hoàn thành trên mobile chuyển thành 1 cột dọc */
	#thx-history-analytics > div:first-child,
	.thx-history-insights-journal-row {
		flex-direction: column !important;
	}
	#thx-history-analytics > div:first-child > div,
	.thx-history-insights-journal-row > div {
		width: 100% !important;
		box-sizing: border-box !important;
	}
	/* Col 1 (Filters/Cal) */
	.thx-history-layout > div:nth-child(3) { order: 3; }
	
	.thx-history-sidebar {
		width: 100% !important;
		position: static !important;
	}
	.thx-history-list-wrapper {
		order: 5;
		width: 100% !important;
		box-sizing: border-box !important;
		height: auto !important;
		max-height: 80vh;
	}
}
/* Right-aligned tooltip for edges */
.thx-tooltip.thx-tooltip-right::after {
	left: auto;
	right: 0;
	transform: translateX(0) translateY(10px);
}
.thx-tooltip.thx-tooltip-right::before {
	left: auto;
	right: 3px;
	transform: translateX(0) translateY(10px);
}
.thx-tooltip.thx-tooltip-right:hover::after,
.thx-tooltip.thx-tooltip-right:hover::before {
	transform: translateX(0) translateY(0);
}

/* =========================================
   ĐỊNH HƯỚNG CỐT LÕI (CONSTITUTION WRAPPER)
========================================= */
@keyframes thx-orange-border-pulse {
	0% {
		border-color: #fb923c;
		box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5), 0 2px 4px rgba(0,0,0,0.04);
	}
	50% {
		border-color: #ea580c;
		box-shadow: 0 0 12px 3px rgba(249, 115, 22, 0.45), 0 4px 10px rgba(234, 88, 12, 0.2);
	}
	100% {
		border-color: #fb923c;
		box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5), 0 2px 4px rgba(0,0,0,0.04);
	}
}

.thx-constitution-wrapper {
	margin-bottom: 25px;
	background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
	border: 1px solid #bbf7d0;
	border-left: 4px solid #22c55e;
	border-radius: 8px;
	padding: 15px 20px;
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thx-constitution-header {
	margin-top: 0;
	margin-bottom: 12px;
	color: #166534;
	font-size: 14px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	transition: color 0.2s ease;
}

.thx-constitution-title-left {
	display: flex;
	align-items: center;
	gap: 6px;
}

.thx-constitution-title-left .dashicons-visibility {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #22c55e;
	transition: color 0.2s ease;
}

.thx-constitution-toggle-btn {
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	width: 24px;
	height: 24px;
	padding: 0;
	color: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.thx-constitution-toggle-btn:hover {
	background: #ffffff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.08);
	transform: scale(1.1);
}

.thx-constitution-toggle-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.thx-constitution-reminder {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin: 0;
	background: transparent;
	border: none;
	padding: 0;
	box-shadow: none;
}

.thx-constitution-item {
	flex: 1;
	min-width: 200px;
	margin: 0;
	background: rgba(255, 255, 255, 0.7);
	padding: 12px;
	border-radius: 6px;
	border: 1px solid rgba(0,0,0,0.02);
	box-shadow: 0 1px 2px rgba(0,0,0,0.02);
	position: relative;
}

.thx-constitution-item .thx-maximize-btn {
	font-weight: 700;
	cursor: pointer;
	color: #166534;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Khi ở trạng thái thu hẹp */
.thx-constitution-wrapper.is-collapsed {
	padding: 10px 18px;
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border: 2px solid #f97316;
	border-left: 5px solid #ea580c;
	animation: thx-orange-border-pulse 2s infinite ease-in-out;
}

.thx-constitution-wrapper.is-collapsed .thx-constitution-header {
	margin-bottom: 0;
	color: #c2410c;
}

.thx-constitution-wrapper.is-collapsed .thx-constitution-title-left .dashicons-visibility {
	color: #ea580c;
}

.thx-constitution-wrapper.is-collapsed .thx-constitution-toggle-btn {
	background: rgba(255, 255, 255, 0.95);
	border-color: rgba(234, 88, 12, 0.35);
	color: #c2410c;
}

.thx-constitution-wrapper.is-collapsed .thx-constitution-reminder {
	display: none !important;
}

