/*
Theme Name: PolyMath Studio
Description: A custom block theme for interactive math concept education.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: polymath
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready
*/

.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ==========================================================================
   POLYMATH DESIGN SYSTEM & INTERACTIVE CSS
   ========================================================================== */

:root {
	--pm-bg: #0b0f19;
	--pm-bg-secondary: #151d30;
	--pm-card-bg: #1e293b;
	--pm-card-border: #334155;
	--pm-text: #f8fafc;
	--pm-text-muted: #94a3b8;
	--pm-green: #10b981;
	--pm-amber: #f59e0b;
	--pm-cyan: #06b6d4;
	--pm-purple: #8b5cf6;
	--pm-red: #ef4444;
	--pm-font-sans: 'Space Grotesk', system-ui, sans-serif;
	--pm-font-mono: 'JetBrains Mono', monospace;
}

body {
	background-color: var(--pm-bg);
	color: var(--pm-text);
	font-family: var(--pm-font-sans);
	margin: 0;
}

/* Math Monospace Font Utility */
.math-mono, code, pre, .equation-text {
	font-family: var(--pm-font-mono);
	letter-spacing: -0.02em;
}

/* Glass & Glow Card Utilities */
.math-card {
	background: rgba(30, 41, 59, 0.85);
	backdrop-filter: blur(12px);
	border: 1px solid var(--pm-card-border);
	border-radius: 16px;
	padding: 24px;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.math-card:hover {
	border-color: var(--pm-cyan);
	box-shadow: 0 8px 30px rgba(6, 182, 212, 0.15);
	transform: translateY(-2px);
}

/* Hero Canvas & Morph Box */
.hero-canvas-wrapper {
	position: relative;
	background: radial-gradient(circle at center, rgba(6, 182, 212, 0.1) 0%, rgba(11, 15, 25, 0.95) 70%);
	border: 1px solid rgba(56, 189, 248, 0.2);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.hero-canvas-wrapper canvas {
	display: block;
	width: 100%;
}

.hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(16, 185, 129, 0.15);
	color: var(--pm-green);
	border: 1px solid rgba(16, 185, 129, 0.3);
	padding: 6px 16px;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Draggable Polygon Interactive Widget */
.interactive-widget {
	background: var(--pm-bg-secondary);
	border: 1px solid var(--pm-card-border);
	border-radius: 16px;
	padding: 20px;
}

.vertex-handle {
	cursor: grab;
	transition: r 0.2s ease, fill 0.2s ease;
}
.vertex-handle:active {
	cursor: grabbing;
	r: 9;
}

.readout-badge {
	background: rgba(11, 15, 25, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 12px 18px;
	font-family: var(--pm-font-mono);
}

.readout-value {
	color: var(--pm-cyan);
	font-size: 1.25rem;
	font-weight: 700;
}

/* Function Plotter Sliders */
.slider-control {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}
.slider-control label {
	font-family: var(--pm-font-mono);
	font-weight: 700;
	width: 30px;
}
.slider-control input[type="range"] {
	flex: 1;
	accent-color: var(--pm-green);
	cursor: pointer;
}
.slider-val {
	font-family: var(--pm-font-mono);
	color: var(--pm-amber);
	min-width: 40px;
	text-align: right;
}

/* Quiz Pulse Animations */
.quiz-card {
	background: var(--pm-card-bg);
	border: 1px solid var(--pm-card-border);
	border-radius: 16px;
	padding: 24px;
}

.quiz-option {
	display: block;
	width: 100%;
	text-align: left;
	background: var(--pm-bg-secondary);
	border: 1px solid var(--pm-card-border);
	color: var(--pm-text);
	padding: 14px 20px;
	border-radius: 10px;
	margin-top: 10px;
	font-family: var(--pm-font-sans);
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.quiz-option:hover {
	border-color: var(--pm-cyan);
	background: rgba(6, 182, 212, 0.1);
}

@keyframes pulseGreen {
	0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
	70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
	100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseRed {
	0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
	70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.quiz-option.pulse-correct {
	background: rgba(16, 185, 129, 0.2) !important;
	border-color: var(--pm-green) !important;
	color: #ffffff !important;
	animation: pulseGreen 0.8s ease-out;
}

.quiz-option.pulse-wrong {
	background: rgba(239, 68, 68, 0.2) !important;
	border-color: var(--pm-red) !important;
	color: #ffffff !important;
	animation: pulseRed 0.8s ease-out;
}

.quiz-feedback {
	display: none;
	margin-top: 16px;
	padding: 14px 18px;
	border-radius: 10px;
	font-size: 0.95rem;
}

.feedback-correct {
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid var(--pm-green);
	color: var(--pm-green);
}

.feedback-wrong {
	background: rgba(245, 158, 11, 0.15);
	border: 1px solid var(--pm-amber);
	color: var(--pm-amber);
}

/* Step-by-Step Solution Reveal */
.solution-walkthrough {
	background: var(--pm-bg-secondary);
	border: 1px solid var(--pm-card-border);
	border-radius: 16px;
	padding: 24px;
}

.solution-step {
	display: none;
	background: var(--pm-card-bg);
	border-left: 4px solid var(--pm-cyan);
	padding: 16px 20px;
	border-radius: 0 10px 10px 0;
	margin-top: 12px;
}

.solution-step.revealed {
	display: block;
}

.step-num {
	display: inline-block;
	background: var(--pm-cyan);
	color: var(--pm-bg);
	font-weight: 700;
	font-size: 0.8rem;
	padding: 2px 8px;
	border-radius: 4px;
	margin-right: 8px;
}

/* Topic Filter Tabs */
.topic-tabs {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.topic-tab-btn {
	background: var(--pm-card-bg);
	border: 1px solid var(--pm-card-border);
	color: var(--pm-text-muted);
	padding: 10px 20px;
	border-radius: 999px;
	cursor: pointer;
	font-family: var(--pm-font-sans);
	font-weight: 600;
	transition: all 0.2s ease;
}

.topic-tab-btn.active, .topic-tab-btn:hover {
	background: var(--pm-cyan);
	color: var(--pm-bg);
	border-color: var(--pm-cyan);
}

/* Button & Link Styles Override */
.wp-element-button, .pm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--pm-cyan);
	color: var(--pm-bg) !important;
	font-family: var(--pm-font-sans);
	font-weight: 700;
	padding: 12px 24px;
	border-radius: 10px;
	border: none;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.wp-element-button:hover, .pm-btn:hover {
	background: #38bdf8;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.pm-btn-secondary {
	background: rgba(255, 255, 255, 0.08);
	color: var(--pm-text) !important;
	border: 1px solid var(--pm-card-border);
}

.pm-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: var(--pm-text);
}

/* Header & Footer Custom Styling */
.polymath-header {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(11, 15, 25, 0.9);
	backdrop-filter: blur(10px);
	position: sticky;
	top: 0;
	z-index: 100;
}

.polymath-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	background: var(--pm-bg-secondary);
}

.home .wp-block-post-title, .home h1.wp-block-post-title {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	*, ::before, ::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
