/**
 * Security Scanner Styles.
 *
 * Clean, neutral styling with clear pass/fail indicators.
 *
 * @package WP_Security_Checklist_Scanner
 */

/* Container */
.wpscs-scanner-container {
	max-width: 800px;
	margin: 2em auto;
	padding: 2em;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Header */
.wpscs-scanner-header {
	margin-bottom: 2em;
	text-align: center;
}

.wpscs-scanner-title {
	margin: 0 0 0.5em;
	font-size: 1.75em;
	font-weight: 600;
	color: #23282d;
}

.wpscs-scanner-description {
	margin: 0;
	color: #646970;
	font-size: 0.95em;
	line-height: 1.6;
}

/* Form */
.wpscs-scanner-form {
	margin-bottom: 2em;
}

.wpscs-url-input-wrapper {
	margin-bottom: 1.5em;
}

.wpscs-url-label {
	display: block;
	margin-bottom: 0.5em;
	font-weight: 600;
	color: #23282d;
	font-size: 0.95em;
}

.wpscs-url-input {
	width: 100%;
	padding: 12px 16px;
	font-size: 1em;
	border: 1px solid #ddd;
	border-radius: 3px;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.wpscs-url-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.wpscs-url-input:disabled {
	background-color: #f0f0f1;
	cursor: not-allowed;
	opacity: 0.7;
}

.wpscs-url-error {
	display: none;
	margin-top: 0.5em;
	padding: 0.75em;
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 3px;
	color: #721c24;
	font-size: 0.9em;
}

.wpscs-url-error[style*="block"] {
	display: block;
}

/* Actions */
.wpscs-scanner-actions {
	text-align: center;
}

.wpscs-scan-button {
	display: inline-block;
	padding: 12px 24px;
	font-size: 1em;
	font-weight: 600;
	color: #fff;
	background-color: #2271b1;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	position: relative;
}

.wpscs-scan-button:hover:not(:disabled) {
	background-color: #135e96;
}

.wpscs-scan-button:active:not(:disabled) {
	background-color: #0a4b78;
}

.wpscs-scan-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wpscs-scan-button .wpscs-button-spinner {
	display: none;
}

.wpscs-scan-button.wpscs-scanning .wpscs-button-text {
	opacity: 0.7;
}

.wpscs-scan-button.wpscs-scanning .wpscs-button-spinner {
	display: inline-block;
	margin-left: 8px;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wpscs-spin 0.8s linear infinite;
}

/* Loading State */
.wpscs-scanner-loading {
	text-align: center;
	padding: 2em;
}

.wpscs-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	animation: wpscs-spin 1s linear infinite;
	margin-bottom: 1em;
}

.wpscs-loading-text {
	margin: 0;
	color: #646970;
	font-size: 0.95em;
}

@keyframes wpscs-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Results */
.wpscs-scanner-results {
	margin-top: 2em;
}

.wpscs-results-header {
	margin-bottom: 1.5em;
	padding-bottom: 1em;
	border-bottom: 2px solid #f0f0f1;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 1.5em;
}

.wpscs-results-title-section {
	flex: 1;
	min-width: 200px;
}

.wpscs-results-title {
	margin: 0 0 0.5em;
	font-size: 1.5em;
	font-weight: 600;
	color: #23282d;
}

.wpscs-results-summary {
	font-size: 1em;
	color: #646970;
	font-weight: 500;
}

.wpscs-results-actions {
	display: flex;
	align-items: center;
	gap: 1em;
	flex-wrap: wrap;
}

/* Score Badge */
.wpscs-score-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.75em 1em;
	border-radius: 8px;
	font-weight: 700;
	min-width: 70px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpscs-score-grade {
	font-size: 1.8em;
	line-height: 1;
}

.wpscs-score-percent {
	font-size: 0.85em;
	opacity: 0.9;
	margin-top: 0.2em;
}

.wpscs-score-excellent {
	background-color: #00a32a;
	color: #fff;
}

.wpscs-score-good {
	background-color: #2271b1;
	color: #fff;
}

.wpscs-score-fair {
	background-color: #f0b849;
	color: #fff;
}

.wpscs-score-poor {
	background-color: #d63638;
	color: #fff;
}

.wpscs-score-critical {
	background-color: #8a2424;
	color: #fff;
}

/* Export Buttons */
.wpscs-export-buttons {
	display: flex;
	gap: 0.5em;
}

.wpscs-export-btn {
	padding: 0.6em 1em;
	font-size: 0.9em;
	color: #2271b1;
	background: transparent;
	border: 1px solid #2271b1;
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.wpscs-export-btn:hover {
	background-color: #2271b1;
	color: #fff;
}

/* Check Items */
.wpscs-checks-list {
	display: grid;
	gap: 1.5em;
}

.wpscs-check-item {
	padding: 1.5em;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	transition: box-shadow 0.2s ease;
}

.wpscs-check-item:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpscs-check-item.wpscs-check-pass {
	border-left: 4px solid #00a32a;
}

.wpscs-check-item.wpscs-check-fail {
	border-left: 4px solid #d63638;
}

.wpscs-check-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1em;
	flex-wrap: wrap;
	gap: 1em;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
	padding: 0.5em;
	margin: -0.5em -0.5em 0.5em -0.5em;
	border-radius: 3px;
}

.wpscs-check-header:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.wpscs-check-expand-icon {
	font-size: 0.8em;
	color: #646970;
	margin-left: auto;
	transition: transform 0.2s ease;
}

.wpscs-check-label {
	margin: 0;
	font-size: 1.1em;
	font-weight: 600;
	color: #23282d;
	flex: 1;
	min-width: 200px;
}

.wpscs-check-status {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 0.8em;
	border-radius: 3px;
	font-size: 0.9em;
	font-weight: 600;
	white-space: nowrap;
}

.wpscs-status-pass {
	background-color: #d4edda;
	color: #155724;
}

.wpscs-status-fail {
	background-color: #f8d7da;
	color: #721c24;
}

.wpscs-status-icon {
	font-size: 1.2em;
	line-height: 1;
}

.wpscs-check-content {
	margin-top: 1em;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

.wpscs-check-content-expanded {
	max-height: 1000px;
	opacity: 1;
}

.wpscs-check-content-collapsed {
	max-height: 0;
	opacity: 0;
	margin-top: 0;
}

.wpscs-check-content p {
	margin: 0.75em 0;
	line-height: 1.6;
	color: #50575e;
}

.wpscs-check-content p:first-child {
	margin-top: 0;
}

.wpscs-check-content p:last-child {
	margin-bottom: 0;
}

.wpscs-check-content strong {
	color: #23282d;
	font-weight: 600;
}

.wpscs-check-content code {
	background-color: #f0f0f1;
	padding: 0.2em 0.4em;
	border-radius: 3px;
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.9em;
	color: #23282d;
	white-space: nowrap;
}

/* WordPress Detection */
.wpscs-wordpress-detection {
	margin-top: 1.5em;
	padding: 1em;
	border-radius: 4px;
	text-align: center;
}

.wpscs-detection-status {
	padding: 0.75em 1em;
	border-radius: 3px;
	font-weight: 600;
	font-size: 0.95em;
}

.wpscs-detection-success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.wpscs-detection-failure {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Error Message */
.wpscs-scanner-error {
	padding: 1em;
	margin-top: 1em;
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
	text-align: center;
}

/* Scan History */
.wpscs-scan-history {
	margin-top: 3em;
	padding-top: 2em;
	border-top: 2px solid #f0f0f1;
}

.wpscs-history-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5em;
	flex-wrap: wrap;
	gap: 1em;
}

.wpscs-history-title {
	margin: 0;
	font-size: 1.5em;
	font-weight: 600;
	color: #23282d;
}

.wpscs-clear-history {
	padding: 0.5em 1em;
	font-size: 0.9em;
	color: #d63638;
	background: transparent;
	border: 1px solid #d63638;
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.wpscs-clear-history:hover {
	background-color: #d63638;
	color: #fff;
}

.wpscs-history-list {
	display: grid;
	gap: 1em;
}

.wpscs-history-item {
	padding: 1.5em;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	transition: box-shadow 0.2s ease;
}

.wpscs-history-item:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpscs-history-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1em;
	flex-wrap: wrap;
	gap: 0.5em;
}

.wpscs-history-url {
	font-weight: 600;
	color: #23282d;
	font-size: 1em;
	word-break: break-all;
}

.wpscs-history-date {
	font-size: 0.85em;
	color: #646970;
	white-space: nowrap;
}

.wpscs-history-item-stats {
	display: flex;
	align-items: center;
	gap: 1em;
	margin-bottom: 1em;
}

.wpscs-history-score {
	font-size: 1.5em;
	font-weight: 700;
	color: #00a32a;
}

.wpscs-history-counts {
	font-size: 0.95em;
	color: #646970;
}

.wpscs-history-view {
	padding: 0.6em 1.2em;
	font-size: 0.9em;
	color: #2271b1;
	background: transparent;
	border: 1px solid #2271b1;
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.wpscs-history-view:hover {
	background-color: #2271b1;
	color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
	.wpscs-scanner-container {
		margin: 1em;
		padding: 1.5em;
	}

	.wpscs-scanner-title {
		font-size: 1.5em;
	}

	.wpscs-check-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.wpscs-check-status {
		align-self: flex-start;
	}
}

@media (max-width: 480px) {
	.wpscs-scanner-container {
		padding: 1em;
	}

	.wpscs-url-input {
		font-size: 16px; /* Prevent zoom on iOS */
	}

	.wpscs-scan-button {
		width: 100%;
		padding: 14px 24px;
	}

	.wpscs-check-item {
		padding: 1em;
	}
}

