/* static/css/style.css */

:root {
	--primary: #6c5ce7;
	--primary-hover: #5849c7;
	--text: #222;
	--muted: #777;
	--background: #f4f5f7;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;

	font-family: Arial, Helvetica, sans-serif;
	color: var(--text);
	background: var(--background);

	display: flex;
	justify-content: center;
	align-items: center;
}

.container {
	width: 100%;
	max-width: 460px;
	padding: 20px;
}

.card {
	background: white;
	padding: 38px;
	border-radius: 14px;

	border: 1px solid #e8e8e8;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

h1 {
	margin: 0;
	text-align: center;

	font-size: 28px;
	letter-spacing: -0.5px;
}

.subtitle {
	margin: 10px 0 32px;

	text-align: center;
	color: var(--muted);
}

.form-group {
	margin-bottom: 20px;
}

label {
	display: block;
	margin-bottom: 8px;

	font-size: 14px;
	font-weight: 600;
}

input {
	width: 100%;
	padding: 13px 14px;

	border: 1px solid #ddd;
	border-radius: 8px;

	background: #fafafa;
	font-size: 16px;

	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}

input:hover {
	border-color: #bbb;
}

input:focus {
	outline: none;

	background: white;
	border-color: var(--primary);

	box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

button {
	width: 100%;
	margin-top: 8px;
	padding: 14px;

	border: none;
	border-radius: 8px;

	background: var(--primary);
	color: white;

	font-size: 16px;
	font-weight: 600;

	cursor: pointer;

	transition:
		background 0.2s,
		transform 0.15s,
		box-shadow 0.2s;
}

button:hover {
	background: var(--primary-hover);
	box-shadow: 0 5px 14px rgba(108, 92, 231, 0.2);
}

button:active {
	transform: scale(0.98);
}

.search-container {
	max-width: 750px;
}

.search-row {
	display: flex;
	gap: 10px;
}

.search-row input {
	flex: 1;
}

.search-row button {
	width: auto;
	margin: 0;
	padding: 0 24px;
}

#status {
	margin-top: 20px;
	color: var(--muted);
	text-align: center;
}

#presets {
	margin-top: 1rem;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.2rem;
}

.preset-btn {
	padding: 0.5rem;
	width: min-content;
	margin: 0;
}

.results {
	margin-top: 25px;

	display: flex;
	flex-direction: column;
	gap: 10px;
}

.result {
	padding: 12px;

	border: 1px solid #e5e5e5;
	border-radius: 10px;

	background: #fafafa;

	transition: 225ms ease;
}

.result-wrapper {
	display: flex;
	flex-direction: row;
	gap: 2rem;
}

.result:hover {
	border-color: var(--primary);
	transform: translateY(-1px);

	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.result-cover {
	width: 140px;
	height: 90px;

	flex-shrink: 0;

	overflow: hidden;
	border-radius: 7px;

	background: #e9e9e9;
}

.result-cover img {
	width: 100%;
	height: 100%;

	object-fit: cover;

	display: block;
}

.no-cover {
	width: 100%;
	height: 100%;

	display: flex;
	align-items: center;
	justify-content: center;

	font-size: 12px;
	color: #888;
}

.result-content {
	min-width: 0;

	display: flex;
	flex-direction: column;
	justify-content: center;
}

.result-title {
	font-size: 17px;
	font-weight: 600;

	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.result-description {
	margin-top: 5px;

	color: var(--muted);
	font-size: 14px;

	display: -webkit-box;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;

	overflow: hidden;
}

.result-meta {
	margin-top: 10px;

	display: flex;
	align-items: center;
	gap: 7px;

	color: #888;
	font-size: 13px;
}

.meta-separator {
	font-size: 10px;
}

.no-results {
	padding: 25px;

	text-align: center;
	color: var(--muted);
}

.quiz-preview {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e5e5;
}

.preview-question {
	display: flex;

	padding: 1.5rem;
	margin-bottom: 15px;
	background: #ffffff;
	border-radius: 10px;
}

.question-number {
	font-size: 0.8rem;
	font-weight: 700;
	color: #777;
	margin-bottom: 8px;
	text-transform: uppercase;
}

.question-text {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 15px;
}

.question-image {
	width: 100%;
	border-radius: 8px;
}

.preview-question {
	display: flex;
	gap: 1rem;
	padding: 1rem;
}

.question-thumbnail {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20%;
}

.question-thumbnail img {
	width: 100%;
	border-radius: 5px;
	display: block;
}

.question-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
}

.question-number {
	font-size: 0.75rem;
	margin-bottom: 2px;
}

.question-text {
	font-weight: 600;
	margin-bottom: 6px;
}

.preview-answers {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.3rem;
	width: 100%;
}

.preview-answer {
	padding: 0.3rem;
	font-size: 0.8rem;
	background: #f5f5f5;
	border-radius: 5px;
	border: 1px solid #ddd;
}

.preview-answer.correct {
	background: #d4edda;
	border-color: #c3e6cb;
	color: #155724;
}

.preview-loading,
.preview-error {
	padding: 20px;
	text-align: center;
	color: #777;
}

.hidden {
	display: none;
}

@media (max-width: 500px) {
	.card {
		padding: 28px 22px;
	}

	.result-cover {
		width: 100px;
		height: 75px;
	}

	.search-row {
		flex-direction: column;
	}

	.search-row button {
		width: 100%;
		padding: 14px;
	}
}
