/**
 * Jogemoa Tools Layout & Interface Stylesheet
 */

/* Tool Single Layout */
.jm-tool-single-header {
	margin-bottom: 2rem;
}

.jm-tool-single-header h1 {
	font-size: clamp(2rem, 4vw, 2.5rem);
	margin-bottom: 0.5rem;
}

.jm-tool-subtitle {
	font-size: 1.15rem;
	color: var(--jm-text-muted);
	max-width: 780px;
	line-height: 1.6;
}

/* Tool Workspace Container */
.jm-tool-workspace {
	background: var(--jm-surface);
	border: 1px solid var(--jm-border);
	border-radius: var(--jm-radius-lg);
	box-shadow: var(--jm-shadow-md);
	padding: 1.75rem;
	margin-bottom: 3rem;
}

@media (min-width: 768px) {
	.jm-tool-workspace {
		padding: 2.25rem;
	}
}

/* Form Controls & Groups */
.jm-form-group {
	margin-bottom: 1.25rem;
}

.jm-form-group:last-child {
	margin-bottom: 0;
}

.jm-label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--jm-text);
	margin-bottom: 0.4rem;
}

.jm-label-hint {
	font-weight: 400;
	font-size: 0.8rem;
	color: var(--jm-text-muted);
	margin-left: 0.35rem;
}

.jm-input,
.jm-select,
.jm-textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	font-size: 1rem;
	border-radius: var(--jm-radius-md);
	border: 1px solid var(--jm-border);
	background: #FFFFFF;
	color: var(--jm-text);
	transition: var(--jm-transition);
}

.jm-input:focus,
.jm-select:focus,
.jm-textarea:focus {
	outline: none;
	border-color: var(--jm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.jm-textarea {
	min-height: 140px;
	resize: vertical;
	line-height: 1.6;
	font-family: var(--jm-font-sans);
}

.jm-textarea.is-code {
	font-family: var(--jm-font-mono);
	font-size: 0.9rem;
}

/* Input Row Layout */
.jm-form-row {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
	.jm-form-row-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.jm-form-row-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.jm-form-row-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Tool Actions Toolbar */
.jm-tool-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--jm-border);
}

/* Stats / Metrics Bar (Word Counter, etc.) */
.jm-stats-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
	.jm-stats-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.jm-stat-card {
	background: var(--jm-surface-raised);
	border: 1px solid var(--jm-border);
	border-radius: var(--jm-radius-md);
	padding: 0.85rem 1rem;
	text-align: center;
}

.jm-stat-value {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--jm-primary);
	line-height: 1.2;
}

.jm-stat-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--jm-text-muted);
	letter-spacing: 0.03em;
	margin-top: 0.2rem;
}

/* Results Display Box */
.jm-result-box {
	background: var(--jm-surface-raised);
	border: 1px solid var(--jm-border);
	border-radius: var(--jm-radius-md);
	padding: 1.25rem;
	margin-top: 1.5rem;
	position: relative;
}

.jm-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.jm-result-title {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--jm-text);
}

.jm-result-content {
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--jm-text);
	word-break: break-all;
}

.jm-result-content.is-mono {
	font-family: var(--jm-font-mono);
	font-size: 0.95rem;
	white-space: pre-wrap;
	max-height: 350px;
	overflow-y: auto;
}

/* Inline Alerts & Errors */
.jm-alert {
	padding: 0.85rem 1.25rem;
	border-radius: var(--jm-radius-md);
	font-size: 0.9rem;
	margin-bottom: 1.25rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.jm-alert-danger {
	background: var(--jm-danger-bg);
	color: var(--jm-danger);
	border: 1px solid #FECACA;
}

.jm-alert-info {
	background: var(--jm-primary-light);
	color: var(--jm-primary);
	border: 1px solid #BFDBFE;
}

/* Explanatory Content Sections */
.jm-tool-content {
	max-width: var(--jm-container-content);
	margin: 0 auto;
}

.jm-tool-section {
	margin-bottom: 2.5rem;
}

.jm-tool-section h2 {
	font-size: 1.5rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--jm-border);
}

.jm-tool-section h3 {
	font-size: 1.2rem;
	margin-top: 1.25rem;
	margin-bottom: 0.5rem;
}

.jm-privacy-notice {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	background: #ECFDF5;
	border: 1px solid #A7F3D0;
	border-radius: var(--jm-radius-md);
	color: #065F46;
	margin: 2rem 0;
}

.jm-privacy-notice svg {
	width: 1.5rem;
	height: 1.5rem;
	color: var(--jm-success);
	flex-shrink: 0;
	margin-top: 0.1rem;
}

.jm-privacy-notice h4 {
	font-size: 1rem;
	font-weight: 700;
	color: #065F46;
	margin-bottom: 0.25rem;
}

.jm-privacy-notice p {
	font-size: 0.875rem;
	margin: 0;
}

/* FAQ Accordion */
.jm-faq-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.jm-faq-item {
	border: 1px solid var(--jm-border);
	border-radius: var(--jm-radius-md);
	background: var(--jm-surface);
	overflow: hidden;
}

.jm-faq-question {
	width: 100%;
	padding: 1rem 1.25rem;
	text-align: left;
	font-weight: 600;
	font-size: 1rem;
	color: var(--jm-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	background: transparent;
	border: none;
}

.jm-faq-question svg {
	width: 1.25rem;
	height: 1.25rem;
	transition: transform 0.2s ease;
}

.jm-faq-item.is-open .jm-faq-question svg {
	transform: rotate(180deg);
}

.jm-faq-answer {
	padding: 0 1.25rem 1.25rem;
	color: var(--jm-text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	display: none;
}

.jm-faq-item.is-open .jm-faq-answer {
	display: block;
}

/* Related Tools Grid */
.jm-related-tools {
	margin-top: 3.5rem;
	padding-top: 2.5rem;
	border-top: 1px solid var(--jm-border);
}

.jm-related-tools h2 {
	font-size: 1.5rem;
	margin-bottom: 1.5rem;
}
