/**
 * Admin styles for Talk to Website plugin.
 *
 * @package TalkToWebsite
 */

/* Admin Page Layout */
.tw-admin-wrap {
	max-width: 1400px;
	margin: 20px 0;
}

.tw-admin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

/* Card Styles */
.tw-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.tw-card h2 {
	margin-top: 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e5e5;
}

.tw-card h3 {
	margin-top: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.tw-info-card {
	background: #f0f6fc;
	border-color: #0073aa;
}

/* Stats Display */
.tw-stats {
	display: grid;
	gap: 15px;
	margin: 20px 0;
}

.tw-stat-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px;
	background: #f6f7f7;
	border-radius: 4px;
}

.tw-stat-label {
	font-weight: 600;
	color: #50575e;
}

.tw-stat-value {
	font-size: 18px;
	font-weight: 700;
	color: #2271b1;
}

/* Post Types List */
.tw-post-types-list {
	list-style: none;
	padding: 0;
	margin: 10px 0 20px 0;
}

.tw-post-types-list li {
	padding: 8px 0;
	border-bottom: 1px solid #e5e5e5;
}

.tw-post-types-list li:last-child {
	border-bottom: none;
}

/* Query Form */
.tw-query-form {
	margin: 20px 0;
}

.tw-query-form textarea {
	width: 100%;
	margin-bottom: 10px;
	padding: 10px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 14px;
	resize: vertical;
}

.tw-query-form textarea:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

/* Answer Container */
.tw-answer-container {
	margin-top: 20px;
	padding: 20px;
	background: #f6f7f7;
	border-radius: 4px;
	border-left: 4px solid #2271b1;
}

.tw-answer-content {
	line-height: 1.6;
	color: #1d2327;
}

/* Status Messages */
.tw-status-message {
	margin-top: 15px;
	padding: 10px;
	border-radius: 4px;
}

.tw-status-message:empty {
	display: none;
}

.tw-success {
	color: #00a32a;
	font-weight: 600;
}

.tw-error {
	color: #d63638;
	font-weight: 600;
}

.tw-loading {
	color: #2271b1;
	font-style: italic;
}

.tw-loading::before {
	content: '⏳ ';
}

/* Shortcode Display */
.tw-shortcode {
	display: inline-block;
	padding: 10px 15px;
	background: #1e1e1e;
	color: #f0f0f0;
	border-radius: 4px;
	font-family: 'Courier New', Courier, monospace;
	font-size: 14px;
	margin: 10px 0;
}

/* Frontend Widget Styles */
.tw-widget {
	max-width: 800px;
	margin: 20px auto;
	padding: 30px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tw-widget h3 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 24px;
	color: #1d2327;
}

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

.tw-question-input {
	width: 100%;
	padding: 12px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 16px;
	font-family: inherit;
	resize: vertical;
	margin-bottom: 10px;
}

.tw-question-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.tw-submit-btn {
	display: inline-block;
	padding: 12px 24px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.tw-submit-btn:hover {
	background: #135e96;
}

.tw-submit-btn:disabled {
	background: #8c8f94;
	cursor: not-allowed;
}

.tw-response {
	padding: 20px;
	background: #f6f7f7;
	border-radius: 4px;
	border-left: 4px solid #2271b1;
	line-height: 1.6;
}

.tw-response:empty {
	display: none;
}

.tw-answer {
	color: #1d2327;
}

.tw-loading {
	text-align: center;
	color: #2271b1;
	font-style: italic;
	padding: 20px;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
	.tw-admin-grid {
		grid-template-columns: 1fr;
	}

	.tw-stat-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}

	.tw-widget {
		padding: 20px;
		margin: 10px;
	}
}

/* WordPress Admin Enhancements */
.toplevel_page_talk-to-website .wp-menu-image img {
	width: 20px;
	height: 20px;
	opacity: 0.6;
}

.toplevel_page_talk-to-website.current .wp-menu-image img,
.toplevel_page_talk-to-website:hover .wp-menu-image img {
	opacity: 1;
}

/* Button Improvements */
.tw-card .button-large {
	padding: 8px 20px;
	height: auto;
	font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.tw-answer-container,
.tw-response {
	animation: fadeIn 0.3s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.tw-widget {
		background: #1e1e1e;
		border-color: #3c3c3c;
		color: #f0f0f0;
	}

	.tw-widget h3 {
		color: #f0f0f0;
	}

	.tw-question-input {
		background: #2d2d2d;
		border-color: #3c3c3c;
		color: #f0f0f0;
	}

	.tw-response {
		background: #2d2d2d;
		border-left-color: #4a9eff;
	}

	.tw-answer {
		color: #f0f0f0;
	}
}

