/* ============================================================
   Woocom-Pay — Admin Styles
   Responsive: stacks at 900px, full mobile at 600px
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
	--wcp-blue:    #3498db;
	--wcp-navy:    #1a1a2e;
	--wcp-green:   #27ae60;
	--wcp-red:     #e74c3c;
	--wcp-orange:  #e67e22;
	--wcp-border:  #e0e0e0;
	--wcp-radius:  8px;
}

/* ── Page Header ───────────────────────────────────────────── */
.wcp-admin-wrap {
	max-width: 1200px;
}

.wcp-admin-wrap h1 {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 20px;
	font-size: clamp(18px, 3vw, 23px);
}

.wcp-admin-wrap h1 img {
	max-height: 34px;
	width: auto;
	vertical-align: middle;
	flex-shrink: 0;
}

/* ── Settings Grid ─────────────────────────────────────────── */
.wcp-settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

/* ── Card ──────────────────────────────────────────────────── */
.wcp-card {
	background: #fff;
	border: 1px solid var(--wcp-border);
	border-radius: var(--wcp-radius);
	padding: clamp(16px, 3vw, 26px) clamp(16px, 3vw, 28px);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
	min-width: 0;
}

.wcp-card h2 {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wcp-navy);
	padding-bottom: 12px;
	border-bottom: 2px solid var(--wcp-blue);
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* ── Stats Bar ─────────────────────────────────────────────── */
.wcp-stats-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-bottom: 16px;
	background: #fff;
	border: 1px solid var(--wcp-border);
	border-radius: var(--wcp-radius);
	overflow: hidden;
}

.wcp-stat {
	flex: 1 1 auto;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	text-decoration: none;
	border-right: 1px solid var(--wcp-border);
	border-bottom: 1px solid transparent;
	transition: background 0.15s;
	white-space: nowrap;
	text-align: center;
}

.wcp-stat:last-child {
	border-right: none;
}

.wcp-stat:hover,
.wcp-stat.active {
	background: #f0f4ff;
	color: #2980b9;
	text-decoration: none;
}

.wcp-stat-pending.active  { color: var(--wcp-orange); background: #fef6ec; }
.wcp-stat-approved.active { color: var(--wcp-green);  background: #eafaf1; }
.wcp-stat-rejected.active { color: var(--wcp-red);    background: #fdecea; }

/* ── Badges ────────────────────────────────────────────────── */
.wcp-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	white-space: nowrap;
}

.wcp-badge-pending  { background: #fef6ec; color: var(--wcp-orange); border: 1px solid #f5cba7; }
.wcp-badge-approved { background: #eafaf1; color: var(--wcp-green);  border: 1px solid #a9dfbf; }
.wcp-badge-rejected { background: #fdecea; color: var(--wcp-red);    border: 1px solid #f5c6cb; }

/* ── Transactions Table — scrollable on small screens ──────── */
.wcp-table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--wcp-radius);
	border: 1px solid var(--wcp-border);
}

.wcp-transactions-table {
	min-width: 700px;
	border: none !important;
}

.wcp-transactions-table th {
	font-size: 12px;
	white-space: nowrap;
}

.wcp-transactions-table td {
	vertical-align: middle;
}

/* ── Verification Layout ───────────────────────────────────── */
.wcp-verify-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: 20px;
	align-items: start;
}

/* ── Verify Actions ────────────────────────────────────────── */
.wcp-verify-actions {
	display: flex;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.wcp-verify-actions form,
.wcp-verify-actions button {
	flex-shrink: 0;
}

/* ── Screenshot Preview ────────────────────────────────────── */
.wcp-screenshot-preview {
	display: block;
	max-width: 100%;
	height: auto;
	margin-top: 10px;
	border: 1px solid var(--wcp-border);
	border-radius: 6px;
}

/* ── Order Meta Box ────────────────────────────────────────── */
#wcp_order_details table.widefat {
	font-size: 12px;
}

#wcp_order_details table.widefat th {
	width: 40%;
	font-weight: 600;
}

/* ── Rejection Form ────────────────────────────────────────── */
.wcp-reject-form {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 6px;
	padding: 14px 16px;
	margin-top: 12px;
}

.wcp-reject-form textarea {
	width: 100%;
	box-sizing: border-box;
	margin-top: 6px;
	border-radius: 4px;
	border: 1px solid #ccc;
	padding: 8px 10px;
	font-size: 13px;
	resize: vertical;
	min-height: 70px;
}

/* ── Responsive: ≤ 900px — collapse grid ──────────────────── */
@media (max-width: 900px) {
	.wcp-settings-grid {
		grid-template-columns: 1fr;
	}

	.wcp-verify-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Responsive: ≤ 600px — mobile admin ───────────────────── */
@media (max-width: 600px) {
	.wcp-admin-wrap h1 {
		font-size: 17px;
	}

	.wcp-card {
		padding: 14px 14px;
	}

	.wcp-stat {
		padding: 8px 10px;
		font-size: 12px;
	}

	.wcp-verify-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.wcp-verify-actions .button,
	.wcp-verify-actions button {
		width: 100%;
		text-align: center;
	}

	/* Stack stats bar to 2 per row on small phones */
	.wcp-stats-bar {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.wcp-stat {
		border-right: 1px solid var(--wcp-border);
		border-bottom: 1px solid var(--wcp-border);
	}

	.wcp-stat:nth-child(even) {
		border-right: none;
	}

	.wcp-stat:nth-last-child(-n+2) {
		border-bottom: none;
	}
}

/* ── Home button in page header ────────────────────────────── */
.wcp-home-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-left: auto;
	padding: 6px 14px;
	border: 1px solid var(--wcp-border);
	border-radius: 6px;
	background: #fff;
	color: #444;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.wcp-home-btn:hover {
	background: #f0f4ff;
	border-color: var(--wcp-blue);
	color: var(--wcp-blue);
}

/* ── License card ──────────────────────────────────────────── */
.wcp-license-status {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 14px;
	flex-wrap: wrap;
}

.wcp-license-active {
	background: #eafaf1;
	border: 1px solid #a9dfbf;
	color: var(--wcp-green);
}

.wcp-license-inactive {
	background: #fef6ec;
	border: 1px solid #f5cba7;
	color: var(--wcp-orange);
}

.wcp-license-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.wcp-license-active .wcp-license-dot   { background: var(--wcp-green); }
.wcp-license-inactive .wcp-license-dot { background: var(--wcp-orange); }

.wcp-license-key-display {
	font-family: monospace;
	font-size: 13px;
	color: #555;
	letter-spacing: 1px;
	margin-left: auto;
}

/* ── Pro lock banner ───────────────────────────────────────── */
.wcp-pro-lock {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-top: 20px;
	padding: 20px 24px;
	background: #f8f9ff;
	border: 2px dashed #c7d2fe;
	border-radius: 10px;
}

.wcp-pro-lock-icon {
	font-size: 28px;
	flex-shrink: 0;
	line-height: 1;
}

.wcp-pro-lock strong {
	display: block;
	font-size: 14px;
	color: var(--wcp-navy);
	margin-bottom: 4px;
}

.wcp-pro-lock p {
	font-size: 13px;
	color: #555;
	margin: 0;
}

.wcp-pro-lock a {
	color: var(--wcp-blue);
	font-weight: 600;
	margin-left: 6px;
}

/* ── Payment Methods / Gateway settings ────────────────────── */
.wcp-card-full {
	grid-column: 1 / -1;
}

.wcp-gw-block {
	padding: 18px 0 20px;
}

.wcp-gw-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.wcp-gw-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 15px;
}

.wcp-gw-toggle input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--wcp-blue);
	cursor: pointer;
}

.wcp-gw-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 20px;
	background: #e8f4fd;
	color: var(--wcp-blue);
	border: 1px solid #c0d8ef;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.wcp-gw-badge.wcp-gw-built-in {
	background: #eafaf1;
	color: var(--wcp-green);
	border-color: #a9dfbf;
}

.wcp-gw-sep {
	border: none;
	border-top: 1px solid #e8eaed;
	margin: 0;
}

.wcp-gw-fields th {
	width: 180px;
	font-size: 13px;
	padding: 8px 10px 8px 0;
}

.wcp-gw-fields td {
	padding: 6px 0;
}

.wcp-gw-fields input[type="text"],
.wcp-gw-fields input[type="url"],
.wcp-gw-fields input[type="password"],
.wcp-gw-fields input[type="email"] {
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 7px 10px;
	font-size: 13px;
	box-sizing: border-box;
}

.wcp-gw-fields input[type="text"]:focus,
.wcp-gw-fields input[type="url"]:focus,
.wcp-gw-fields input[type="password"]:focus {
	border-color: var(--wcp-blue);
	box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
	outline: none;
}

.wcp-gw-fields .description {
	font-size: 12px;
	color: #666;
	margin-top: 4px;
}

.wcp-gw-fields code {
	background: #f4f5f6;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 11px;
	word-break: break-all;
}

/* ── WordPress admin form-table override ───────────────────── */
@media (max-width: 600px) {
	.wcp-admin-wrap .form-table th,
	.wcp-admin-wrap .form-table td {
		display: block;
		width: 100%;
		padding: 6px 0;
	}

	.wcp-admin-wrap .form-table th {
		padding-top: 14px;
		font-weight: 600;
	}

	.wcp-admin-wrap .form-table input[type="text"],
	.wcp-admin-wrap .form-table input[type="email"],
	.wcp-admin-wrap .form-table textarea {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}
}
