/**
 * Mbilletech Virtual - HTML5 Vector Whiteboard & Math Stencils Stylesheet
 * File: assets/css/canvas-stencils.css
 * Description: Geometry overlays, interactive measurement rulers, 0-180° protractors,
 * adjustable compasses, coordinate grids, equation typing palettes, sticky notes,
 * and vector toolbar mechanics.
 * Version: 1.0.0
 */

/* ==========================================================================
   1. MATHEMATICAL GRID & AXES OVERLAYS
   ========================================================================== */
.mtc-wb-canvas-wrapper.has-grid,
.mbt-canvas-viewport-wrap.has-grid {
	background-size: 20px 20px;
	background-image:
		linear-gradient(to right, rgba(203, 213, 225, 0.45) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(203, 213, 225, 0.45) 1px, transparent 1px);
}

.mtc-wb-canvas-wrapper.has-grid-isometric,
.mbt-canvas-viewport-wrap.has-grid-isometric {
	background-size: 30px 52px;
	background-image:
		linear-gradient(30deg, rgba(203, 213, 225, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(203, 213, 225, 0.4) 87.5%, rgba(203, 213, 225, 0.4)),
		linear-gradient(150deg, rgba(203, 213, 225, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(203, 213, 225, 0.4) 87.5%, rgba(203, 213, 225, 0.4)),
		linear-gradient(30deg, rgba(203, 213, 225, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(203, 213, 225, 0.4) 87.5%, rgba(203, 213, 225, 0.4)),
		linear-gradient(150deg, rgba(203, 213, 225, 0.4) 12%, transparent 12.5%, transparent 87%, rgba(203, 213, 225, 0.4) 87.5%, rgba(203, 213, 225, 0.4));
	background-position: 0 0, 0 0, 15px 26px, 15px 26px;
}

.mtc-wb-canvas-wrapper.has-axes::before,
.mbt-canvas-viewport-wrap.has-axes::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background: rgba(37, 99, 235, 0.5);
	pointer-events: none;
	z-index: 2;
}

.mtc-wb-canvas-wrapper.has-axes::after,
.mbt-canvas-viewport-wrap.has-axes::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: rgba(37, 99, 235, 0.5);
	pointer-events: none;
	z-index: 2;
}

/* ==========================================================================
   2. INTERACTIVE GEOMETRIC RULER STENCIL
   ========================================================================== */
.mtc-stencil-ruler {
	position: absolute;
	top: 100px;
	left: 100px;
	width: 420px;
	height: 60px;
	background: rgba(255, 255, 255, 0.88);
	border: 1.5px solid #2563eb;
	border-radius: 4px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
	cursor: move;
	user-select: none;
	touch-action: none;
	z-index: 30;
	backdrop-filter: blur(4px);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.mtc-ruler-ticks {
	position: relative;
	width: 100%;
	height: 22px;
	border-bottom: 1px solid #94a3b8;
	background-image: repeating-linear-gradient(
		to right,
		#1e293b 0px,
		#1e293b 1px,
		transparent 1px,
		transparent 10px
	);
}

.mtc-ruler-ticks-major {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: repeating-linear-gradient(
		to right,
		#2563eb 0px,
		#2563eb 1.5px,
		transparent 1.5px,
		transparent 50px
	);
}

.mtc-ruler-numbers {
	display: flex;
	justify-content: space-between;
	padding: 0 4px;
	font-family: monospace;
	font-size: 10px;
	font-weight: 700;
	color: #1e3a8a;
}

.mtc-ruler-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 2px 8px;
	background: rgba(239, 246, 255, 0.85);
	border-top: 1px solid #cbd5e1;
}

.mtc-ruler-angle-readout {
	font-size: 11px;
	font-weight: 800;
	color: #2563eb;
	font-family: monospace;
}

.mtc-stencil-rotate-handle {
	width: 18px;
	height: 18px;
	background: #2563eb;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	cursor: grab;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mtc-stencil-close-handle {
	width: 16px;
	height: 16px;
	background: #ef4444;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
	line-height: 1;
}

/* ==========================================================================
   3. 0-180° PROTRACTOR STENCIL OVERLAY
   ========================================================================== */
.mtc-stencil-protractor {
	position: absolute;
	top: 120px;
	left: 120px;
	width: 320px;
	height: 160px;
	background: rgba(255, 255, 255, 0.85);
	border: 2px solid #0d9488;
	border-bottom: 2px solid #0d9488;
	border-radius: 160px 160px 0 0;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
	cursor: move;
	user-select: none;
	touch-action: none;
	z-index: 31;
	backdrop-filter: blur(4px);
	overflow: hidden;
}

.mtc-protractor-origin {
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 12px;
	height: 12px;
	background: #0d9488;
	border-radius: 50%;
}

.mtc-protractor-crosshair-v {
	position: absolute;
	bottom: 0;
	left: 50%;
	height: 35px;
	width: 1px;
	background: #0d9488;
}

.mtc-protractor-crosshair-h {
	position: absolute;
	bottom: 0;
	left: 10%;
	width: 80%;
	height: 1px;
	background: #0d9488;
}

.mtc-protractor-degrees-ring {
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	bottom: 0;
	border: 1px dashed rgba(13, 148, 136, 0.6);
	border-radius: 150px 150px 0 0;
}

.mtc-protractor-readout-badge {
	position: absolute;
	top: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(13, 148, 136, 0.15);
	color: #0f766e;
	padding: 2px 8px;
	border-radius: 10px;
	font-family: monospace;
	font-size: 11px;
	font-weight: 800;
	border: 1px solid rgba(13, 148, 136, 0.3);
}

/* ==========================================================================
   4. CIRCULAR COMPASS STENCIL
   ========================================================================== */
.mtc-stencil-compass {
	position: absolute;
	top: 140px;
	left: 140px;
	width: 220px;
	height: 220px;
	border: 1.5px dashed #9333ea;
	border-radius: 50%;
	background: rgba(250, 245, 255, 0.6);
	box-shadow: 0 6px 18px rgba(147, 51, 234, 0.15);
	cursor: move;
	user-select: none;
	touch-action: none;
	z-index: 32;
	backdrop-filter: blur(2px);
}

.mtc-compass-pivot {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 14px;
	height: 14px;
	background: #9333ea;
	border-radius: 50%;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px #9333ea;
}

.mtc-compass-arm {
	position: absolute;
	top: 50%;
	left: 50%;
	height: 2px;
	background: #9333ea;
	transform-origin: 0% 50%;
	width: 50%;
}

.mtc-compass-pencil {
	position: absolute;
	right: 0;
	top: -6px;
	width: 14px;
	height: 14px;
	background: #7e22ce;
	border-radius: 50%;
	border: 2px solid #ffffff;
	cursor: ew-resize;
}

.mtc-compass-radius-label {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	font-family: monospace;
	font-size: 11px;
	font-weight: 800;
	color: #7e22ce;
	background: #ffffff;
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid #e9d5ff;
}

/* ==========================================================================
   5. STICKY NOTES & INLINE TEXT BOX OVERLAYS
   ========================================================================== */
.mtc-sticky-note {
	position: absolute;
	width: 180px;
	min-height: 150px;
	padding: 12px;
	background: #fef08a;
	color: #713f12;
	border-radius: 4px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
	z-index: 25;
	border-top: 14px solid #fde047;
	box-sizing: border-box;
	cursor: move;
}

.mtc-sticky-note.color-blue {
	background: #bfdbfe;
	color: #1e3a8a;
	border-top-color: #93c5fd;
}

.mtc-sticky-note.color-pink {
	background: #fbcfe8;
	color: #831843;
	border-top-color: #f9a8d4;
}

.mtc-sticky-note.color-green {
	background: #bbf7d0;
	color: #14532d;
	border-top-color: #86efac;
}

.mtc-sticky-textarea {
	width: 100%;
	height: 100px;
	background: transparent;
	border: none;
	outline: none;
	font-family: var(--mbt-font-main);
	font-size: 13px;
	line-height: 1.4;
	color: inherit;
	resize: none;
	cursor: text;
}

.mtc-sticky-close {
	position: absolute;
	top: -12px;
	right: 4px;
	background: transparent;
	border: none;
	color: rgba(0, 0, 0, 0.4);
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
}

.mtc-sticky-close:hover {
	color: #dc2626;
}

/* Inline Dynamic Text Inputs */
.mtc-inline-textbox {
	position: absolute;
	min-width: 100px;
	border: 1.5px dashed #2563eb;
	background: rgba(255, 255, 255, 0.9);
	padding: 4px 8px;
	font-size: 15px;
	color: #0f172a;
	outline: none;
	z-index: 26;
	border-radius: 4px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   6. MATHEMATICAL EQUATION DIALOG & SYMBOL KEYPAD
   ========================================================================== */
.mtc-equation-dialog {
	position: absolute;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
	width: 380px;
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
	z-index: 40;
	padding: 16px;
}

.mtc-equation-input {
	width: 100%;
	padding: 10px 12px;
	font-family: monospace;
	font-size: 15px;
	color: #1e3a8a;
	border: 1.5px solid #cbd5e1;
	border-radius: 6px;
	outline: none;
	box-sizing: border-box;
	margin-bottom: 12px;
}

.mtc-equation-input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mtc-equation-keypad {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 6px;
	margin-bottom: 14px;
}

.mtc-math-sym-btn {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	padding: 6px 4px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 700;
	color: #334155;
	cursor: pointer;
	text-align: center;
	transition: all 0.15s ease;
}

.mtc-math-sym-btn:hover {
	background: #eff6ff;
	border-color: #2563eb;
	color: #2563eb;
}

/* ==========================================================================
   7. FLOATING TOOLBARS & STENCIL SWITCHERS
   ========================================================================== */
.mtc-floating-stencil-bar {
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.95);
	border: 1.5px solid #cbd5e1;
	border-radius: 30px;
	padding: 4px 12px;
	display: flex;
	gap: 6px;
	align-items: center;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
	z-index: 20;
	backdrop-filter: blur(4px);
}

.mtc-stencil-pill-btn {
	background: transparent;
	border: none;
	padding: 6px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	color: #475569;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: all 0.15s ease;
}

.mtc-stencil-pill-btn:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.mtc-stencil-pill-btn.active {
	background: #2563eb;
	color: #ffffff;
}

/* ==========================================================================
   8. RESPONSIVE MEDIA QUERIES FOR WHITEBOARD STENCILS
   ========================================================================== */
@media screen and (max-width: 768px) {
	.mtc-stencil-ruler {
		width: 280px;
		height: 50px;
	}

	.mtc-stencil-protractor {
		width: 240px;
		height: 120px;
		border-radius: 120px 120px 0 0;
	}

	.mtc-stencil-compass {
		width: 170px;
		height: 170px;
	}

	.mtc-equation-dialog {
		width: 90%;
	}
}

@media screen and (max-width: 480px) {
	.mtc-floating-stencil-bar {
		top: 8px;
		padding: 2px 6px;
		gap: 2px;
	}

	.mtc-stencil-pill-btn {
		font-size: 10.5px;
		padding: 4px 6px;
	}

	.mtc-stencil-ruler {
		width: 220px;
		height: 44px;
	}

	.mtc-stencil-protractor {
		width: 190px;
		height: 95px;
		border-radius: 95px 95px 0 0;
	}
}