/**
 * Guardian Shield — Admin Stylesheet
 * Modern dark-mode-compatible WordPress admin UI.
 */

/* ── Variables ──────────────────────────────── */
:root {
	--gs-bg:           #0e1b33;
	--gs-surface:      #1a2744;
	--gs-surface-2:    #243259;
	--gs-border:       #2d3e5e;
	--gs-text:         #e2e8f0;
	--gs-text-muted:   #94a3b8;
	--gs-accent:       #3b82f6;
	--gs-accent-hover: #2563eb;
	--gs-success:      #22c55e;
	--gs-warning:      #f59e0b;
	--gs-danger:       #ef4444;
	--gs-critical:     #dc2626;
	--gs-radius:       8px;
	--gs-shadow:       0 4px 24px rgba(0,0,0,.35);
}

/* ── Wrap ───────────────────────────────────── */
.gs-wrap {
	max-width: 1200px;
	padding: 0 0 40px;
	color: var(--gs-text);
}

/* ── Header ─────────────────────────────────── */
.gs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 0 16px;
	border-bottom: 1px solid var(--gs-border);
	margin-bottom: 24px;
}

.gs-header__logo {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gs-header__logo h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--gs-text);
}

.gs-header__logo .dashicons {
	font-size: 28px;
	color: var(--gs-accent);
	width: 28px;
	height: 28px;
}

.gs-header__actions {
	display: flex;
	gap: 8px;
}

/* ── Cards ──────────────────────────────────── */
.gs-card {
	background: var(--gs-surface);
	border: 1px solid var(--gs-border);
	border-radius: var(--gs-radius);
	margin-bottom: 20px;
	box-shadow: var(--gs-shadow);
	overflow: hidden;
}

.gs-card--info {
	border-left: 4px solid var(--gs-accent);
}

.gs-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	border-bottom: 1px solid var(--gs-border);
	background: var(--gs-surface-2);
}

.gs-card__header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--gs-text);
}

.gs-card__body {
	padding: 20px;
}

.gs-card__footer {
	padding: 16px 20px;
	border-top: 1px solid var(--gs-border);
	background: var(--gs-surface-2);
}

/* ── Security Score ─────────────────────────── */
.gs-score-card {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 0;
	background: var(--gs-surface);
	border: 1px solid var(--gs-border);
	border-radius: var(--gs-radius);
	margin-bottom: 20px;
	overflow: hidden;
	box-shadow: var(--gs-shadow);
}

.gs-score-card__gauge {
	padding: 20px;
	background: var(--gs-surface-2);
	display: flex;
	align-items: center;
	justify-content: center;
	border-right: 1px solid var(--gs-border);
}

.gs-gauge {
	width: 100%;
	max-width: 220px;
}

.gs-gauge__score {
	font-size: 36px;
	font-weight: 700;
	font-family: 'Courier New', monospace;
}

.gs-gauge__label {
	font-size: 13px;
}

.gs-gauge__arc {
	transition: stroke-dasharray 1.5s ease-out;
}

.gs-score-card__details {
	padding: 24px;
}

.gs-score-card__details h2 {
	margin: 0 0 16px;
	font-size: 18px;
	color: var(--gs-text);
}

.gs-all-clear {
	color: var(--gs-success);
	font-size: 15px;
	font-weight: 500;
}

.gs-issues h3 {
	color: var(--gs-warning);
	font-size: 13px;
	margin: 0 0 10px;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.gs-issues ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.gs-issue {
	font-size: 13px;
	color: var(--gs-text-muted);
	display: flex;
	align-items: center;
	gap: 6px;
}

.gs-issue__icon {
	color: var(--gs-warning);
}

/* ── Stats Grid ──────────────────────────────── */
.gs-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.gs-stat-card {
	background: var(--gs-surface);
	border: 1px solid var(--gs-border);
	border-radius: var(--gs-radius);
	padding: 20px;
	text-align: center;
	box-shadow: var(--gs-shadow);
	transition: transform .15s ease;
	border-top: 3px solid var(--gs-border);
}

.gs-stat-card:hover {
	transform: translateY(-2px);
}

.gs-stat-card--danger { border-top-color: var(--gs-danger); }
.gs-stat-card--warning { border-top-color: var(--gs-warning); }
.gs-stat-card--safe { border-top-color: var(--gs-success); }
.gs-stat-card--info { border-top-color: var(--gs-accent); }

.gs-stat-card__icon {
	font-size: 28px;
	margin-bottom: 8px;
}

.gs-stat-card__value {
	font-size: 32px;
	font-weight: 700;
	color: var(--gs-text);
	line-height: 1;
	margin-bottom: 4px;
	font-variant-numeric: tabular-nums;
}

.gs-stat-card__label {
	font-size: 12px;
	color: var(--gs-text-muted);
	text-transform: uppercase;
	letter-spacing: .5px;
}

/* ── Tables ──────────────────────────────────── */
.gs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.gs-table thead th {
	background: var(--gs-surface-2);
	color: var(--gs-text-muted);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .5px;
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--gs-border);
}

.gs-table tbody tr {
	border-bottom: 1px solid var(--gs-border);
	transition: background .1s;
}

.gs-table tbody tr:hover {
	background: var(--gs-surface-2);
}

.gs-table--striped tbody tr:nth-child(even) {
	background: rgba(255,255,255,.02);
}

.gs-table td {
	padding: 10px 12px;
	color: var(--gs-text);
	vertical-align: top;
}

.gs-table td code {
	background: var(--gs-bg);
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 12px;
	color: #60a5fa;
}

.gs-td--time {
	white-space: nowrap;
	color: var(--gs-text-muted) !important;
	font-size: 12px;
}

.gs-td--file {
	max-width: 300px;
}

.gs-td--desc {
	max-width: 300px;
	font-size: 12px;
}

.gs-path {
	display: block;
	color: var(--gs-text-muted);
	font-size: 11px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 280px;
}

.gs-empty {
	text-align: center;
	color: var(--gs-text-muted) !important;
	padding: 30px !important;
}

.gs-row--danger {
	background: rgba(239,68,68,.07) !important;
}

.gs-row--warning {
	background: rgba(245,158,11,.06) !important;
}

/* ── Badges ──────────────────────────────────── */
.gs-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	background: var(--gs-surface-2);
	color: var(--gs-text);
}

.gs-badge--green   { background: rgba(34,197,94,.15);  color: #4ade80; }
.gs-badge--red     { background: rgba(239,68,68,.15);  color: #f87171; }
.gs-badge--yellow  { background: rgba(245,158,11,.15); color: #fbbf24; }
.gs-badge--blue    { background: rgba(59,130,246,.15); color: #60a5fa; }

/* ── Severity ────────────────────────────────── */
.gs-severity {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}

.gs-critical { background: rgba(220,38,38,.2);  color: #f87171; }
.gs-high     { background: rgba(239,68,68,.15); color: #fb923c; }
.gs-medium   { background: rgba(245,158,11,.15);color: #fbbf24; }
.gs-low      { background: rgba(34,197,94,.1);  color: #4ade80; }

/* ── Status ──────────────────────────────────── */
.gs-status--active   { color: var(--gs-success); font-size: 12px; }
.gs-status--inactive { color: var(--gs-text-muted); font-size: 12px; }

/* ── Type Badge ──────────────────────────────── */
.gs-type-badge {
	background: var(--gs-bg);
	border: 1px solid var(--gs-border);
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 11px;
	font-family: monospace;
	color: #93c5fd;
}

/* ── Buttons ─────────────────────────────────── */
.gs-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid transparent;
	text-decoration: none;
	transition: all .15s ease;
}

.gs-btn:focus { outline: 2px solid var(--gs-accent); outline-offset: 2px; }

.gs-btn--primary   { background: var(--gs-accent);  color: #fff; border-color: var(--gs-accent-hover); }
.gs-btn--primary:hover { background: var(--gs-accent-hover); color: #fff; }

.gs-btn--secondary { background: var(--gs-surface-2); color: var(--gs-text); border-color: var(--gs-border); }
.gs-btn--secondary:hover { background: var(--gs-border); color: var(--gs-text); }

.gs-btn--danger    { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.gs-btn--danger:hover { background: rgba(239,68,68,.25); }

.gs-btn--success   { background: rgba(34,197,94,.15); color: #4ade80; border-color: rgba(34,197,94,.3); }
.gs-btn--success:hover { background: rgba(34,197,94,.25); }

.gs-btn--outline   { background: transparent; color: var(--gs-accent); border-color: var(--gs-accent); }
.gs-btn--outline:hover { background: rgba(59,130,246,.1); color: var(--gs-accent); }

.gs-btn--sm        { padding: 5px 10px; font-size: 12px; }
.gs-btn--large     { padding: 10px 24px; font-size: 14px; }
.gs-btn:disabled   { opacity: .5; cursor: not-allowed; }

/* ── Settings Grid ───────────────────────────── */
.gs-settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 16px;
}

.gs-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--gs-surface-2);
	border: 1px solid var(--gs-border);
	border-radius: 6px;
	cursor: pointer;
	transition: background .1s;
}

.gs-toggle-row:hover {
	background: rgba(59,130,246,.08);
	border-color: var(--gs-accent);
}

.gs-toggle-row span {
	font-size: 13px;
	color: var(--gs-text);
}

.gs-field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	background: var(--gs-surface-2);
	border: 1px solid var(--gs-border);
	border-radius: 6px;
}

.gs-field-row span {
	font-size: 13px;
	color: var(--gs-text);
	flex: 1;
}

.gs-field-row input[type=text],
.gs-field-row input[type=email],
.gs-field-row input[type=number] {
	background: var(--gs-bg) !important;
	border: 1px solid var(--gs-border) !important;
	color: var(--gs-text) !important;
	border-radius: 4px;
	padding: 4px 8px !important;
}

/* ── Tabs ────────────────────────────────────── */
.gs-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--gs-border);
	padding-bottom: 0;
}

.gs-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px 6px 0 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--gs-text-muted);
	text-decoration: none;
	border: 1px solid transparent;
	border-bottom: none;
	margin-bottom: -1px;
	transition: all .15s;
}

.gs-tab:hover {
	color: var(--gs-text);
	background: var(--gs-surface-2);
}

.gs-tab--active {
	color: var(--gs-accent) !important;
	background: var(--gs-surface);
	border-color: var(--gs-border);
	border-bottom-color: var(--gs-surface);
}

/* ── Inline Form ─────────────────────────────── */
.gs-inline-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.gs-inline-form input {
	background: var(--gs-bg) !important;
	border: 1px solid var(--gs-border) !important;
	color: var(--gs-text) !important;
	border-radius: 4px;
	padding: 6px 10px !important;
}

/* ── Notice / Alert ──────────────────────────── */
.gs-notice {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-top: 12px;
}

.gs-notice--success { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.gs-notice--error   { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.gs-notice--warning { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }

.gs-action-result {
	margin-top: 12px;
	padding: 8px 14px;
	background: var(--gs-surface-2);
	border-radius: 6px;
	font-size: 13px;
}

/* ── Quick Actions ───────────────────────────── */
.gs-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* ── Progress Bar ────────────────────────────── */
.gs-progress-bar {
	background: var(--gs-surface);
	border: 1px solid var(--gs-border);
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 16px;
	position: relative;
	overflow: hidden;
}

.gs-progress-bar__fill {
	position: absolute;
	top: 0; left: 0; bottom: 0;
	background: linear-gradient(90deg, var(--gs-accent), #818cf8);
	width: 0;
	transition: width .3s ease;
	opacity: .3;
}

#gs-progress-text {
	position: relative;
	font-size: 13px;
	color: var(--gs-text);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
	.gs-score-card {
		grid-template-columns: 1fr;
	}
	.gs-score-card__gauge {
		border-right: none;
		border-bottom: 1px solid var(--gs-border);
	}
	.gs-stats-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 600px) {
	.gs-stats-grid {
		grid-template-columns: 1fr;
	}
	.gs-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

/* ── WP Admin Dark Mode Compat ───────────────── */
@media (prefers-color-scheme: dark) {
	.gs-field-row input,
	.gs-inline-form input {
		color-scheme: dark;
	}
}

/* ── Toast Notifications ─────────────────────── */
#gs-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.gs-toast {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--gs-surface);
	border: 1px solid var(--gs-border);
	border-left: 4px solid var(--gs-accent);
	border-radius: 8px;
	padding: 12px 18px;
	min-width: 260px;
	max-width: 400px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.4);
	color: var(--gs-text);
	font-size: 0.875rem;
	pointer-events: all;
	cursor: pointer;
	opacity: 0;
	transform: translateX(30px);
	transition: opacity .35s ease, transform .35s ease;
}

.gs-toast--visible {
	opacity: 1;
	transform: translateX(0);
}

.gs-toast-icon {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
	background: currentColor;
}

.gs-toast-success { color: #22c55e; }
.gs-toast-error   { color: #ef4444; }
.gs-toast-warning { color: #f59e0b; }
.gs-toast-info    { color: #3b82f6; }

/* ── Collapsible sections ────────────────────── */
.gs-collapsible-header {
	cursor: pointer;
	user-select: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.gs-collapse-icon {
	font-size: 0.75rem;
	transition: transform .2s;
}

.gs-collapse-icon--open {
	transform: rotate(180deg);
}

.gs-collapsible-body {
	display: none;
}

/* ── Scan progress bar ───────────────────────── */
#gs-scan-progress-wrap {
	display: none;
	margin: 16px 0;
}

.gs-progress-track {
	background: var(--gs-surface-2);
	border-radius: 99px;
	height: 8px;
	overflow: hidden;
}

#gs-scan-progress-bar,
.gs-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--gs-accent), #60a5fa);
	border-radius: 99px;
	width: 0%;
	transition: width .8s ease;
}

#gs-scan-message {
	margin-top: 8px;
	font-size: 0.8rem;
	color: var(--gs-muted);
}

/* ── Copy button ─────────────────────────────── */
.gs-copy-btn {
	font-size: 0.75rem;
	padding: 3px 10px;
	margin-left: 8px;
	background: var(--gs-surface-2);
	border: 1px solid var(--gs-border);
	border-radius: 4px;
	cursor: pointer;
	color: var(--gs-text);
	transition: background .15s;
}

.gs-copy-btn:hover {
	background: var(--gs-accent);
	color: #fff;
}
