.container {
	max-width: 1100px;
	margin: 0 auto;
	background: white;
	border-radius: 16px;
	padding: 30px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.container header {
	text-align: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 3px solid #667eea;
    height: auto;
}

.container header h1 { color: #2d3748; font-size: 2.2em; margin-bottom: 8px; }
.container .subtitle { color: #718096; font-size: 1em; }

.container .status-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
	padding: 6px 16px;
	background: #f7fafc;
	border-radius: 8px;
	display: inline-flex;
	font-size: 0.85em;
}

.container .status-dot {
	width: 8px; height: 8px; border-radius: 50%;
	background: #48bb78;
}
.container .status-dot.error { background: #f56565; }
.container .status-dot.loading { background: #ed8936; animation: pulse 1s infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Mode tabs --- */
.container .mode-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 25px;
	border-radius: 10px;
	overflow: hidden;
	border: 2px solid #667eea;
}

.container .mode-tab {
	flex: 1;
	padding: 14px 20px;
	background: white;
	color: #667eea;
	border: none;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.container .mode-tab:not(:last-child) { border-right: 2px solid #667eea; }
.container .mode-tab:hover { background: #f0f4ff; }
.container .mode-tab.active { background: #667eea; color: white; }

/* --- Form --- */
.container .form-section {
	background: #f7fafc;
	padding: 25px;
	border-radius: 12px;
	margin-bottom: 20px;
}

.container .form-group { margin-bottom: 18px; }
.container .form-group label {
	display: block;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 6px;
	font-size: 0.95em;
}

.container .form-group input[type="text"],
.container .form-group input[type="number"],
.container .form-group textarea,
.container .form-group select {
	width: 100%;
	padding: 11px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.95em;
	font-family: inherit;
	transition: border-color 0.2s;
}

.container .form-group input:focus,
.container .form-group textarea:focus,
.container .form-group select:focus {
	outline: none;
	border-color: #667eea;
}

.container .form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
}

.container .form-row-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 15px;
}

.container .generate-btn {
	width: 100%;
	padding: 16px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 10px;
	font-size: 1.1em;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.container .generate-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.container .generate-btn:active { transform: translateY(0); }

.container .generate-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.container .generate-btn.loading {
	background: #a0aec0;
	position: relative;
}

.container .generate-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 24px; height: 24px;
	margin: -12px 0 0 -12px;
	border: 3px solid rgba(255,255,255,0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Results --- */
.container .results-section {
	margin-top: 25px;
}

.container .results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 15px;
}

.container .results-header h2 {
	color: #2d3748;
	font-size: 1.3em;
}

.container .results-meta {
	display: flex;
	gap: 8px;
}

.container .tag {
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.8em;
	font-weight: 600;
}

.container .tag-green { background: #c6f6d5; color: #276749; }
.container .tag-blue { background: #bee3f8; color: #2a4365; }
.container .tag-orange { background: #fefcbf; color: #975a16; }
.container .tag-red { background: #fed7d7; color: #9b2c2c; }

/* --- Question Cards --- */
.container .question-card {
	background: white;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 16px;
	transition: border-color 0.2s;
}

.container .question-card:hover { border-color: #667eea; }

.container .question-card .q-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 14px;
}

.container .question-card .q-number {
	background: #667eea;
	color: white;
	width: 32px; height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9em;
	flex-shrink: 0;
}

.container .question-card .q-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.container .question-card .q-text {
	font-size: 1.05em;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 14px;
	line-height: 1.5;
}

.container .options-list {
	list-style: none;
	margin-bottom: 14px;
}

.container .options-list li {
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 6px;
	font-size: 0.95em;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #f7fafc;
	border: 2px solid transparent;
	transition: all 0.2s;
}

.container .options-list li.correct {
	background: #f0fff4;
	border-color: #48bb78;
	font-weight: 600;
}

.container .options-list li .opt-letter {
	width: 26px; height: 26px;
	border-radius: 50%;
	background: #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8em;
	flex-shrink: 0;
}

.container .options-list li.correct .opt-letter {
	background: #48bb78;
	color: white;
}

.container .answer-hint {
	padding: 8px 14px;
	border-radius: 8px;
	font-size: 0.85em;
	font-weight: 600;
	margin-bottom: 10px;
}

.container .answer-hint.single {
	background: #ebf8ff;
	color: #2b6cb0;
	border-left: 4px solid #4299e1;
}

.container .answer-hint.multi {
	background: #fefcbf;
	color: #975a16;
	border-left: 4px solid #ecc94b;
}

/* Matching (párosító) */
.container .matching-container {
	margin-bottom: 14px;
}

.container .matching-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.container .matching-column-label {
	font-weight: 700;
	font-size: 0.85em;
	color: #718096;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
	padding-left: 4px;
}

.container .matching-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 2px solid #e2e8f0;
	background: #f7fafc;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-bottom: 8px;
	min-height: 48px;
	font-size: 0.95em;
	user-select: none;
	position: relative;
}

.container .matching-item:hover {
	border-color: #a0aec0;
	background: #edf2f7;
}

.container .matching-item:focus {
	outline: 3px solid #667eea;
	outline-offset: 2px;
}

.container .matching-item.selected {
	border-color: #667eea;
	background: #ebf4ff;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.container .matching-item.paired {
	cursor: pointer;
	border-width: 2px;
}

.container .matching-item.paired:hover {
	opacity: 0.85;
}

/* Pár színek */
.container .matching-item.pair-1 { border-color: #48bb78; background: #f0fff4; }
.container .matching-item.pair-2 { border-color: #ecc94b; background: #fffff0; }
.container .matching-item.pair-3 { border-color: #4299e1; background: #ebf8ff; }
.container .matching-item.pair-4 { border-color: #9f7aea; background: #faf5ff; }

/* Sorszám badge */
.container .pair-badge {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8em;
	color: white;
	flex-shrink: 0;
	animation: badgeFadeIn 0.25s ease;
}

.container .pair-badge-1 { background: #48bb78; }
.container .pair-badge-2 { background: #ecc94b; color: #744210; }
.container .pair-badge-3 { background: #4299e1; }
.container .pair-badge-4 { background: #9f7aea; }

@keyframes badgeFadeIn {
	from { transform: scale(0); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.container .matching-item-text {
	flex: 1;
}

/* Eredmény állapotok */
.container .matching-item.correct-result {
	border-color: #48bb78 !important;
	background: #f0fff4 !important;
}

.container .matching-item.wrong-result {
	border-color: #fc8181 !important;
	background: #fff5f5 !important;
}

.container .matching-actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
}

.container .matching-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.container .matching-btn-check {
	background: #667eea;
	color: white;
}

.container .matching-btn-check:hover { background: #5a67d8; }

.container .matching-btn-check:disabled {
	background: #cbd5e0;
	cursor: not-allowed;
}

.container .matching-btn-reset {
	background: #edf2f7;
	color: #4a5568;
}

.container .matching-btn-reset:hover { background: #e2e8f0; }

.container .matching-result-text {
	margin-top: 10px;
	padding: 10px 14px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9em;
}

.container .matching-result-text.all-correct {
	background: #c6f6d5;
	color: #276749;
}

.container .matching-result-text.partial {
	background: #fefcbf;
	color: #975a16;
}

.container .matching-result-text.all-wrong {
	background: #fed7d7;
	color: #9b2c2c;
}

/* Megoldás táblázat (értékelés után) */
.container .matching-solution {
	margin-top: 10px;
	font-size: 0.85em;
	color: #718096;
}

.container .matching-solution span.correct-pair { color: #276749; }
.container .matching-solution span.wrong-pair { color: #9b2c2c; text-decoration: line-through; }

@media (max-width: 500px) {
	.container .matching-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* Számolós (calculation) kérdés */
.container .calc-formula-box {
	background: #f0f5ff;
	border: 2px solid #bee3f8;
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 12px;
	font-family: 'Courier New', monospace;
}

.container .calc-formula-label {
	font-weight: 700;
	font-size: 0.8em;
	color: #4a5568;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.container .calc-formula-text {
	font-size: 1.1em;
	color: #2d3748;
	font-weight: 600;
	margin-bottom: 8px;
}

.container .calc-variables {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.container .calc-var-chip {
	background: white;
	border: 1px solid #cbd5e0;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 0.9em;
	color: #4a5568;
}

.container .calc-var-chip strong {
	color: #2d3748;
}

.calc-options {
	list-style: none;
	padding: 0;
	margin: 0 0 12px 0;
}

.container .calc-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-radius: 10px;
	border: 2px solid #e2e8f0;
	background: #f7fafc;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-bottom: 8px;
	user-select: none;
}

.container .calc-option:hover {
	border-color: #a0aec0;
	background: #edf2f7;
}

.container .calc-option.selected {
	border-color: #667eea;
	background: #ebf4ff;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.container .calc-option.correct {
	border-color: #48bb78 !important;
	background: #f0fff4 !important;
}

.container .calc-option.wrong {
	border-color: #fc8181 !important;
	background: #fff5f5 !important;
}

.container .calc-option.disabled {
	cursor: default;
	opacity: 0.85;
}

.container .calc-opt-letter {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9em;
	flex-shrink: 0;
	transition: all 0.2s;
}

.container .calc-option.selected .calc-opt-letter {
	background: #667eea;
	color: white;
}

.container .calc-option.correct .calc-opt-letter {
	background: #48bb78;
	color: white;
}

.container .calc-option.wrong .calc-opt-letter {
	background: #fc8181;
	color: white;
}

.container .calc-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
	margin-bottom: 12px;
}

.container .calc-check-btn {
	padding: 10px 24px;
	border: none;
	border-radius: 8px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	background: #667eea;
	color: white;
}

.container .calc-check-btn:hover { background: #5a67d8; }

.container .calc-check-btn:disabled {
	background: #cbd5e0;
	cursor: not-allowed;
}

.container .calc-result-text {
	margin-top: 10px;
	padding: 10px 14px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9em;
}

.container .calc-result-text.correct {
	background: #c6f6d5;
	color: #276749;
}

.container .calc-result-text.wrong {
	background: #fed7d7;
	color: #9b2c2c;
}

/* Explanation */
.container .explanation {
	background: #ebf8ff;
	border-left: 4px solid #4299e1;
	padding: 12px 16px;
	border-radius: 0 8px 8px 0;
	margin-bottom: 10px;
}

.container .explanation-label {
	font-weight: 700;
	color: #2c5282;
	font-size: 0.85em;
	margin-bottom: 4px;
}

.container .explanation p {
	color: #2d3748;
	font-size: 0.93em;
	line-height: 1.6;
	margin: 0;
}

.container .q-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e2e8f0;
	font-size: 0.82em;
	color: #718096;
}

.container .q-categories span {
	background: #edf2f7;
	padding: 3px 8px;
	border-radius: 4px;
	margin-right: 4px;
}

/* Error card */
.container .error-card {
	background: #fff5f5;
	border: 2px solid #fc8181;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
}

.container .error-card h3 { color: #c53030; margin-bottom: 8px; }
.container .error-card p { color: #742a2a; }

/* JSON toggle */
.container .json-toggle-btn {
	padding: 8px 18px;
	background: #2d3748;
	color: #68d391;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.85em;
	font-weight: 600;
}

.container .json-toggle-btn:hover { background: #1a202c; }

.container .json-panel {
	display: none;
	background: #1a202c;
	border-radius: 10px;
	padding: 20px;
	margin-top: 15px;
	position: relative;
}

.container .json-panel.visible { display: block; }

.container .json-panel pre {
	color: #68d391;
	font-family: 'Courier New', monospace;
	font-size: 0.85em;
	line-height: 1.5;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

.container .json-copy-btn {
	position: absolute;
	top: 10px; right: 10px;
	padding: 6px 14px;
	background: #4299e1;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.8em;
	font-weight: 600;
}

.container .json-copy-btn:hover { background: #3182ce; }

/* Rejected section */
.container .rejected-section {
	margin-top: 20px;
	padding: 15px;
	background: #fffbeb;
	border-radius: 10px;
	border: 1px solid #f6e05e;
}

.container .rejected-section summary {
	cursor: pointer;
	font-weight: 600;
	color: #975a16;
}

.container .rejected-item {
	padding: 8px 12px;
	margin-top: 8px;
	background: white;
	border-radius: 6px;
	font-size: 0.9em;
	border-left: 3px solid #ed8936;
}

/* Responsive */
@media (max-width: 700px) {
	.container .form-row, .form-row-3 { grid-template-columns: 1fr; }
	.container header h1 { font-size: 1.6em; }
	.container .container { padding: 18px; }
	.container .results-header { flex-direction: column; gap: 10px; }
}