/**
 * Admin styles for Empty Shortcodes Scanner.
 *
 * @package TomMcFarlin\RESC
 */

/* Variables */
:root {
	--resc-primary: #2271b1;
	--resc-primary-hover: #135e96;
	--resc-success: #00a32a;
	--resc-warning: #dba617;
	--resc-danger: #d63638;
	--resc-muted: #646970;
	--resc-border: #c3c4c7;
	--resc-bg: #f0f0f1;
	--resc-card-bg: #fff;
	--resc-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	--resc-radius: 4px;
}

/* Layout */
.resc-wrap {
	max-width: 1200px;
	margin: 20px 20px 20px 0;
}

/* Header */
.resc-title {
	font-size: 23px;
	font-weight: 400;
	margin: 0 0 8px;
	padding: 0;
}

.resc-description {
	color: var(--resc-muted);
	font-size: 14px;
	margin: 0 0 20px;
	max-width: 700px;
}

/* Donate Notice */
.resc-donate-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 16px 20px;
	margin-bottom: 20px;
	background: linear-gradient(135deg, #fdf6e3 0%, #fef9ec 100%);
	border: 1px solid #e6d5b8;
	border-left: 4px solid #d4a574;
	border-radius: var(--resc-radius);
}

.resc-donate-notice-content {
	display: flex;
	align-items: center;
	gap: 15px;
	flex: 1;
}

.resc-donate-notice-icon {
	font-size: 28px;
	line-height: 1;
}

.resc-donate-notice-text {
	flex: 1;
	font-size: 14px;
	color: #5c4030;
}

.resc-donate-notice-text strong {
	display: block;
	margin-bottom: 2px;
	color: #4a3728;
}

.resc-donate-notice-button {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	background: #d4a574;
	border: none;
	border-radius: var(--resc-radius);
	transition: all 0.2s ease;
	white-space: nowrap;
}

.resc-donate-notice-button:hover {
	color: #fff;
	background: #c4956a;
}

.resc-donate-notice-dismiss {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #a08060;
	cursor: pointer;
	transition: all 0.2s ease;
}

.resc-donate-notice-dismiss:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #6f4e37;
}

.resc-donate-notice-dismiss .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Cards */
.resc-card {
	background: var(--resc-card-bg);
	border: 1px solid var(--resc-border);
	border-radius: var(--resc-radius);
	box-shadow: var(--resc-shadow);
	margin-bottom: 20px;
}

/* Scan Panel */
.resc-scan-panel {
	padding: 20px;
}

.resc-scan-panel-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
}

.resc-scan-info {
	display: flex;
	align-items: center;
	gap: 15px;
}

.resc-scan-info .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--resc-primary);
}

.resc-scan-text strong {
	display: block;
	font-size: 14px;
	margin-bottom: 4px;
}

.resc-scan-text p {
	margin: 0;
	color: var(--resc-muted);
	font-size: 13px;
}

.resc-scan-actions {
	display: flex;
	gap: 10px;
}

.resc-scan-actions .button-primary .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin-right: 4px;
	vertical-align: text-bottom;
}

/* Scan Progress */
.resc-scan-progress {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--resc-border);
}

.resc-progress-bar {
	height: 8px;
	background: var(--resc-bg);
	border-radius: 4px;
	overflow: hidden;
}

.resc-progress-bar-inner {
	height: 100%;
	background: var(--resc-primary);
	width: 0;
	transition: width 0.3s ease;
	animation: resc-progress-indeterminate 1.5s infinite linear;
	background-image: linear-gradient(
		-45deg,
		rgba(255, 255, 255, 0.2) 25%,
		transparent 25%,
		transparent 50%,
		rgba(255, 255, 255, 0.2) 50%,
		rgba(255, 255, 255, 0.2) 75%,
		transparent 75%,
		transparent
	);
	background-size: 40px 40px;
}

@keyframes resc-progress-indeterminate {
	0% {
		width: 0;
		margin-left: 0;
	}
	50% {
		width: 60%;
		margin-left: 20%;
	}
	100% {
		width: 0;
		margin-left: 100%;
	}
}

.resc-progress-text {
	text-align: center;
	margin: 10px 0 0;
	color: var(--resc-muted);
	font-size: 13px;
}

/* Stats Cards */
.resc-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 20px;
}

.resc-stat-card {
	background: var(--resc-card-bg);
	border: 1px solid var(--resc-border);
	border-radius: var(--resc-radius);
	box-shadow: var(--resc-shadow);
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
}

.resc-stat-card .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	padding: 10px;
	border-radius: var(--resc-radius);
}

.resc-stat-warning .dashicons {
	color: var(--resc-warning);
	background: rgba(219, 166, 23, 0.1);
}

.resc-stat-info .dashicons {
	color: var(--resc-primary);
	background: rgba(34, 113, 177, 0.1);
}

.resc-stat-muted .dashicons {
	color: var(--resc-muted);
	background: rgba(100, 105, 112, 0.1);
}

.resc-stat-content {
	display: flex;
	flex-direction: column;
}

.resc-stat-number {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
}

.resc-stat-label {
	font-size: 13px;
	color: var(--resc-muted);
}

/* Tabs */
.resc-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 0;
	border-bottom: 1px solid var(--resc-border);
	background: var(--resc-card-bg);
	border-radius: var(--resc-radius) var(--resc-radius) 0 0;
}

.resc-tab {
	padding: 12px 20px;
	text-decoration: none;
	color: var(--resc-muted);
	font-weight: 500;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
	transition: all 0.2s ease;
}

.resc-tab:hover {
	color: var(--resc-primary);
}

.resc-tab.active {
	color: var(--resc-primary);
	border-bottom-color: var(--resc-primary);
}

.resc-tab-count {
	display: inline-block;
	background: var(--resc-bg);
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	margin-left: 6px;
}

.resc-tab.active .resc-tab-count {
	background: rgba(34, 113, 177, 0.1);
	color: var(--resc-primary);
}

/* Results Card */
.resc-results-card {
	border-radius: 0 0 var(--resc-radius) var(--resc-radius);
	margin-top: 0;
}

/* Tables */
.resc-table {
	width: 100%;
	border-collapse: collapse;
}

.resc-table th,
.resc-table td {
	padding: 12px 15px;
	text-align: left;
	border-bottom: 1px solid var(--resc-border);
}

.resc-table th {
	font-weight: 600;
	background: var(--resc-bg);
	font-size: 13px;
}

.resc-table tbody tr:last-child td {
	border-bottom: none;
}

.resc-table tbody tr:hover {
	background: rgba(0, 0, 0, 0.02);
}

.resc-table code {
	background: var(--resc-bg);
	padding: 3px 6px;
	border-radius: 3px;
	font-size: 12px;
}

/* Column widths */
.resc-col-expand {
	width: 40px;
	text-align: center;
}

.resc-col-count {
	width: 120px;
}

.resc-col-type {
	width: 100px;
}

.resc-col-status {
	width: 100px;
}

.resc-col-actions {
	width: 120px;
	text-align: right;
}

/* Expand button */
.resc-expand-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--resc-muted);
	transition: transform 0.2s ease;
}

.resc-expand-btn:hover {
	color: var(--resc-primary);
}

.resc-expand-btn[aria-expanded="true"] {
	transform: rotate(90deg);
}

.resc-expand-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Child rows */
.resc-row-child td {
	padding: 0;
	background: var(--resc-bg);
}

.resc-row-child:hover {
	background: var(--resc-bg) !important;
}

.resc-child-content {
	padding: 15px 20px;
}

.resc-post-item {
	background: var(--resc-card-bg);
	border: 1px solid var(--resc-border);
	border-radius: var(--resc-radius);
	padding: 15px;
	margin-bottom: 10px;
}

.resc-post-item:last-child {
	margin-bottom: 0;
}

.resc-post-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.resc-post-meta {
	display: flex;
	gap: 10px;
	align-items: center;
}

.resc-post-type {
	font-size: 12px;
	color: var(--resc-muted);
}

.resc-post-author {
	font-size: 12px;
	color: var(--resc-muted);
	margin-top: 2px;
}

.resc-post-context {
	background: var(--resc-bg);
	padding: 10px 12px;
	border-radius: var(--resc-radius);
	font-family: monospace;
	font-size: 12px;
	line-height: 1.5;
	margin-bottom: 10px;
	word-break: break-word;
}

.resc-post-context mark {
	background: rgba(219, 166, 23, 0.3);
	padding: 2px 0;
}

.resc-post-actions {
	display: flex;
	justify-content: flex-end;
}

.resc-post-actions .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	margin-left: 4px;
	vertical-align: text-bottom;
}

/* Status badges */
.resc-status {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
}

.resc-status-publish {
	background: rgba(0, 163, 42, 0.1);
	color: var(--resc-success);
}

.resc-status-draft {
	background: rgba(100, 105, 112, 0.1);
	color: var(--resc-muted);
}

.resc-status-pending {
	background: rgba(219, 166, 23, 0.1);
	color: var(--resc-warning);
}

.resc-status-future {
	background: rgba(34, 113, 177, 0.1);
	color: var(--resc-primary);
}

.resc-status-private {
	background: rgba(135, 99, 184, 0.1);
	color: #8763b8;
}

/* Shortcode preview in by-post view */
.resc-shortcode-preview {
	margin-bottom: 8px;
}

.resc-shortcode-preview:last-child {
	margin-bottom: 0;
}

.resc-context-preview {
	display: block;
	font-size: 11px;
	color: var(--resc-muted);
	font-family: monospace;
	margin-top: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 300px;
}

.resc-context-preview mark {
	background: rgba(219, 166, 23, 0.3);
	color: inherit;
}

/* Pagination */
.resc-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
	padding: 20px;
	border-top: 1px solid var(--resc-border);
}

.resc-pagination-link {
	display: inline-block;
	padding: 6px 12px;
	text-decoration: none;
	color: var(--resc-primary);
	border: 1px solid var(--resc-border);
	border-radius: var(--resc-radius);
	font-size: 13px;
	transition: all 0.2s ease;
}

.resc-pagination-link:hover {
	background: var(--resc-primary);
	color: #fff;
	border-color: var(--resc-primary);
}

.resc-pagination-link.current {
	background: var(--resc-primary);
	color: #fff;
	border-color: var(--resc-primary);
}

.resc-pagination-link.disabled {
	color: var(--resc-muted);
	cursor: not-allowed;
	opacity: 0.5;
}

.resc-pagination-link.disabled:hover {
	background: transparent;
	color: var(--resc-muted);
	border-color: var(--resc-border);
}

.resc-pagination-ellipsis {
	padding: 6px 8px;
	color: var(--resc-muted);
}

/* Empty State */
.resc-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: var(--resc-muted);
}

.resc-empty-state .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--resc-success);
	margin-bottom: 15px;
}

.resc-empty-state p {
	margin: 0;
	font-size: 14px;
}

.resc-empty-state-large {
	padding: 80px 20px;
}

.resc-empty-state-large .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: var(--resc-primary);
}

.resc-empty-state-large h2 {
	margin: 15px 0 10px;
	font-size: 20px;
	font-weight: 500;
	color: #1d2327;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.resc-wrap {
		margin-right: 10px;
	}

	.resc-donate-notice {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.resc-donate-notice-content {
		flex-direction: column;
		text-align: center;
	}

	.resc-donate-notice-button {
		width: 100%;
		justify-content: center;
	}

	.resc-donate-notice-dismiss {
		position: absolute;
		top: 10px;
		right: 10px;
	}

	.resc-donate-notice {
		position: relative;
	}

	.resc-scan-panel-content {
		flex-direction: column;
		align-items: flex-start;
	}

	.resc-stats {
		grid-template-columns: 1fr;
	}

	.resc-tabs {
		flex-wrap: wrap;
	}

	.resc-col-type,
	.resc-col-status {
		display: none;
	}

	.resc-post-info {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
