/**
 * Activity Log - Admin (aligned with shared PageHero / WP admin theme colors)
 *
 * @package AdvancedUserActivityLog
 */

.wpps-al-wrap {
	--wpps-al-blue: var(--wpps-accent, var(--wp-admin-theme-color, #2271b1));
	--wpps-al-blue-hover: var(--wpps-accent-hover, var(--wp-admin-theme-color-darker-10, #135e96));
	--wpps-al-black: #1d2327;
	--wpps-al-gray: #50575e;
	--wpps-al-muted: #646970;
	--wpps-al-border: #c3c4c7;
	--wpps-al-bg: #f0f0f1;
	--wpps-al-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	--wpps-al-shadow-tight: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	max-width: none;
	margin: 20px 20px 20px 0;
}

/* Hero meta buttons */
.wrap.wpps-al-wrap .wpps-page-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.wrap.wpps-al-wrap .wpps-page-hero__meta .button {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.wrap.wpps-al-wrap .wpps-page-hero__meta .button .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* Buttons – theme-aware accents */
.wpps-al-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	min-height: 40px;
	line-height: 1;
	border-radius: 2px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	box-sizing: border-box;
	border: 1px solid transparent;
}

.wpps-al-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-al-btn-primary {
	background: var(--wpps-al-blue);
	border-color: var(--wpps-al-blue);
	color: #fff;
}

.wpps-al-btn-primary:hover,
.wpps-al-btn-primary:focus {
	background: var(--wpps-al-blue-hover);
	border-color: var(--wpps-al-blue-hover);
	color: #fff;
}

.wpps-al-btn-secondary {
	background: #fff;
	border-color: var(--wpps-al-border);
	color: var(--wpps-al-black);
}

.wpps-al-btn-secondary:hover,
.wpps-al-btn-secondary:focus {
	background: var(--wpps-al-bg);
	border-color: var(--wpps-al-gray);
	color: var(--wpps-al-black);
}

/* Cards – Basic Forms */
.wpps-al-card {
	background: #fff;
	border: 1px solid var(--wpps-al-border);
	border-radius: 4px;
	box-shadow: var(--wpps-al-shadow);
	margin-bottom: 24px;
}

.wpps-al-card-title {
	margin: 0;
	padding: 16px 20px;
	font-size: 16px;
	font-weight: 600;
	border-bottom: 1px solid var(--wpps-al-border);
	color: var(--wpps-al-black);
}

.wpps-al-card-body {
	padding: 20px;
}

/* Logs: no inner card — toolbar + native tablenav / widefat only */
.wpps-al-list {
	margin: 0 0 20px;
}

.wpps-al-list .wpps-al-toolbar {
	padding: 4px 0 12px;
	margin: 0;
}

.wpps-al-list-form {
	margin: 0;
}

/* Toolbar – count + hint left; actions hug the right without a stretched “dead zone” */
.wpps-al-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
}

.wpps-al-toolbar-main {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 14px;
	min-width: 0;
}

.wpps-al-toolbar-count {
	font-size: 14px;
	color: var(--wpps-al-black);
	font-weight: 600;
}

.wpps-al-toolbar-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

/* Filters – two rows × 5 equal columns; actions in column 5 of row 2 */
.wpps-al-filter-row-primary,
.wpps-al-filter-row-secondary {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 16px 20px;
	align-items: end;
}

.wpps-al-filter-row-primary {
	margin-bottom: 16px;
}

.wpps-al-filter-group--actions .wpps-al-filter-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.wpps-al-filter-group-label {
	font-weight: 600;
	font-size: 12px;
	color: var(--wpps-al-gray);
}

.wpps-al-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.wpps-al-filter-group label {
	font-weight: 600;
	font-size: 12px;
	text-transform: none;
	letter-spacing: 0;
	color: var(--wpps-al-gray);
}

.wpps-al-filter-group input,
.wpps-al-filter-group select {
	font-size: 14px;
}

.wpps-al-filter-group input[type="search"],
.wpps-al-filter-group input[type="text"],
.wpps-al-filter-group input[type="date"],
.wpps-al-filter-group select {
	width: 100%;
	max-width: 100%;
}


/* Empty state – Code Snippet inspired */
.wpps-al-empty-state {
	text-align: center;
	padding: 48px 24px;
	margin-top: 16px;
	background: #fff;
	border: 1px solid var(--wpps-al-border);
	border-radius: 4px;
	box-shadow: var(--wpps-al-shadow);
}

.wpps-al-empty-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wpps-al-bg);
	border-radius: 50%;
}

.wpps-al-empty-icon .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--wpps-al-gray);
}

.wpps-al-empty-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: var(--wpps-al-black);
}

.wpps-al-empty-desc {
	margin: 0 0 20px;
	color: var(--wpps-al-muted);
	font-size: 14px;
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

/* Table: rely on core list-tables.css for chrome; only tweak Activity Log–specific content */
.wpps-al-wrap .wpps-system-user {
	color: var(--wpps-al-muted);
	font-style: italic;
}

.wpps-al-wrap .column-action {
	white-space: nowrap;
}

.wpps-role-pill {
	background: var(--wpps-al-bg);
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 4px;
}

/* Action badges – line-height matches body text so rows don’t look top-heavy */
.wpps-action-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	line-height: 1.35;
	font-weight: 600;
	text-transform: capitalize;
	letter-spacing: 0.02em;
	white-space: nowrap;
	vertical-align: middle;
}

.wpps-action-badge.wpps-severity-critical {
	box-shadow: inset 3px 0 0 0 #b32d2e;
}

.wpps-action-badge.wpps-severity-warning {
	box-shadow: inset 3px 0 0 0 #dba617;
}

.wpps-action-badge.wpps-severity-success {
	box-shadow: inset 3px 0 0 0 #00a32a;
}

.wpps-action-badge.wpps-severity-info {
	box-shadow: inset 3px 0 0 0 #72aee6;
}

.wpps-action-login {
	background: #d4edda;
	color: #155724;
}
.wpps-action-logout {
	background: #fff3cd;
	color: #856404;
}
.wpps-action-failed_login {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-post_created,
.wpps-action-post_updated {
	background: #cfe2ff;
	color: #084298;
}
.wpps-action-post_deleted,
.wpps-action-post_status_changed {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-plugin_activated,
.wpps-action-plugin_updated {
	background: #d1e7dd;
	color: #0f5132;
}
.wpps-action-plugin_deactivated {
	background: #fff3cd;
	color: #856404;
}
.wpps-action-theme_switched,
.wpps-action-theme_updated {
	background: #cff4fc;
	color: #055160;
}
.wpps-action-user_created,
.wpps-action-user_updated,
.wpps-action-password_reset {
	background: #cfe2ff;
	color: #084298;
}
.wpps-action-user_deleted {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-media_uploaded {
	background: #d1e7dd;
	color: #0f5132;
}
.wpps-action-media_deleted {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-comment_created {
	background: #cff4fc;
	color: #055160;
}
.wpps-action-comment_deleted,
.wpps-action-comment_status_changed {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-option_updated {
	background: #fff3cd;
	color: #856404;
}
.wpps-action-widget_updated {
	background: #cfe2ff;
	color: #084298;
}
.wpps-action-menu_updated,
.wpps-action-menu_deleted {
	background: #cff4fc;
	color: #055160;
}
.wpps-action-module_enabled {
	background: #d1e7dd;
	color: #0f5132;
}
.wpps-action-module_disabled {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-plugin_installed,
.wpps-action-theme_installed {
	background: #d1e7dd;
	color: #0f5132;
}
.wpps-action-core_update_started,
.wpps-action-core_updated {
	background: #cff4fc;
	color: #055160;
}
.wpps-action-user_role_changed {
	background: #fff3cd;
	color: #856404;
}
.wpps-action-term_created,
.wpps-action-term_edited {
	background: #cfe2ff;
	color: #084298;
}
.wpps-action-term_deleted {
	background: #f8d7da;
	color: #721c24;
}
.wpps-action-permalink_changed {
	background: #fff3cd;
	color: #856404;
}
.wpps-action-plugin_deleted,
.wpps-action-theme_deleted {
	background: #f8d7da;
	color: #721c24;
}

/* IP block */
.wpps-ip-details {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
}

.wpps-ip-country {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--wpps-al-gray);
}

.wpps-ip-country .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--wpps-al-muted);
}

/* Responsive */
@media screen and (max-width: 1200px) {
	.wpps-al-filter-row-primary,
	.wpps-al-filter-row-secondary {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}
}

@media screen and (max-width: 782px) {
	.wpps-al-wrap .wp-list-table.widefat {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.wpps-al-wrap .wp-list-table.widefat thead {
		display: none;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody,
	.wpps-al-wrap .wp-list-table.widefat tr {
		display: block;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody tr {
		border: 1px solid var(--wpps-al-border);
		border-radius: 4px;
		margin-bottom: 12px;
		padding: 12px;
		background: #fff;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody td,
	.wpps-al-wrap .wp-list-table.widefat tbody th {
		display: block;
		border: none;
		padding: 8px 0;
		text-align: left;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody td:before,
	.wpps-al-wrap .wp-list-table.widefat tbody th.check-column:before {
		content: attr(data-label) ': ';
		font-weight: 600;
		color: var(--wpps-al-muted);
		margin-right: 8px;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody th.check-column {
		padding-left: 0;
	}

	.wpps-al-wrap .wp-list-table.widefat tbody th.check-column:before {
		content: '';
		margin: 0;
	}

	.wpps-al-wrap .column-date:before {
		content: 'Date: ';
		font-weight: 600;
		color: var(--wpps-al-muted);
		margin-right: 8px;
	}
}

