/* AI Question Solver - Frontend Styles (mobile-first) */

.aiqs-wrapper {
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.aiqs-wrapper *,
.aiqs-wrapper *::before,
.aiqs-wrapper *::after {
	box-sizing: border-box;
}

.aiqs-card {
	max-width: 720px;
	margin: 0 auto;
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 2px 14px rgba(20, 20, 40, 0.08);
	padding: 18px;
	border: 1px solid #eef0f5;
}

.aiqs-header {
	text-align: center;
	margin-bottom: 18px;
}

.aiqs-title {
	font-size: 24px;
	font-weight: 800;
	margin: 0 0 6px 0;
	color: #1b1f3b;
	background: linear-gradient(90deg, #4f46e5, #0ea5e9);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.aiqs-subtitle {
	margin: 0;
	color: #5b6072;
	font-size: 14px;
}

.aiqs-field {
	margin-bottom: 14px;
}

.aiqs-field label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #22263a;
	margin-bottom: 6px;
}

.aiqs-textarea,
.aiqs-select {
	width: 100%;
	padding: 12px;
	font-size: 16px; /* 16px avoids iOS zoom-on-focus */
	border: 1.5px solid #dfe2ec;
	border-radius: 10px;
	background: #fbfbfe;
	color: #1b1f3b;
	transition: border-color 0.15s ease;
}

.aiqs-textarea:focus,
.aiqs-select:focus {
	outline: none;
	border-color: #4f46e5;
	background: #fff;
}

.aiqs-textarea {
	resize: vertical;
	min-height: 120px;
	line-height: 1.5;
}

.aiqs-char-count {
	text-align: right;
	font-size: 12px;
	color: #8a8fa3;
	margin-top: 4px;
}

.aiqs-row {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

@media (min-width: 560px) {
	.aiqs-row {
		flex-direction: row;
	}
	.aiqs-half {
		flex: 1;
		margin-bottom: 0;
	}
}

.aiqs-image-upload {
	position: relative;
}

.aiqs-image-upload input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.aiqs-upload-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px;
	background: #f1f2fb;
	border: 1.5px dashed #b9beda;
	border-radius: 10px;
	color: #4f46e5;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	text-align: center;
}

.aiqs-upload-btn:hover {
	background: #e8e9fb;
}

.aiqs-image-preview-wrap {
	margin-top: 12px;
	text-align: center;
}

.aiqs-image-preview-wrap img {
	max-width: 100%;
	max-height: 220px;
	border-radius: 10px;
	border: 1px solid #dfe2ec;
	object-fit: contain;
}

.aiqs-remove-btn {
	display: block;
	margin: 8px auto 0 auto;
	background: none;
	border: none;
	color: #d9376e;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 6px 10px;
}

.aiqs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.aiqs-btn {
	flex: 1 1 140px;
	min-height: 48px;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 700;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	transition: transform 0.05s ease, opacity 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.aiqs-btn:active {
	transform: scale(0.98);
}

.aiqs-btn-primary {
	background: linear-gradient(90deg, #4f46e5, #0ea5e9);
	color: #fff;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.aiqs-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.aiqs-btn-secondary {
	background: #f1f2fb;
	color: #363a56;
}

.aiqs-btn-secondary:hover {
	background: #e6e7f7;
}

.aiqs-error {
	margin-top: 14px;
	padding: 12px 14px;
	background: #fdecef;
	border: 1px solid #f4b7c3;
	color: #a11d3d;
	border-radius: 10px;
	font-size: 14px;
}

.aiqs-loading {
	text-align: center;
	padding: 26px 10px;
}

.aiqs-spinner {
	width: 38px;
	height: 38px;
	margin: 0 auto 12px auto;
	border: 4px solid #e3e5f5;
	border-top-color: #4f46e5;
	border-radius: 50%;
	animation: aiqs-spin 0.8s linear infinite;
}

@keyframes aiqs-spin {
	to {
		transform: rotate(360deg);
	}
}

#aiqs-loading-text {
	color: #5b6072;
	font-weight: 600;
	font-size: 14px;
}

.aiqs-results {
	margin-top: 18px;
}

.aiqs-result-card {
	background: #f8f9ff;
	border: 1px solid #e6e8f7;
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 12px;
}

.aiqs-result-card h3 {
	margin: 0 0 8px 0;
	font-size: 15px;
	color: #4f46e5;
	font-weight: 800;
}

.aiqs-result-content {
	font-size: 15px;
	line-height: 1.6;
	color: #22263a;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.aiqs-result-points {
	margin: 0;
	padding-left: 20px;
	color: #22263a;
	font-size: 15px;
	line-height: 1.7;
}

.aiqs-result-points li {
	margin-bottom: 4px;
}

/* Desktop: thoda zyada breathing room */
@media (min-width: 768px) {
	.aiqs-card {
		padding: 28px 32px;
	}
	.aiqs-title {
		font-size: 28px;
	}
}
