/**
 * OpenClaw Customer Portal Styles
 *
 * Styles for the "My AI Agents" tab in WooCommerce My Account.
 *
 * @package OpenClaw_Provisioning
 * @since   1.0.0
 */

/* --- Portal Container --- */
.openclaw-portal {
	max-width: 100%;
}

.openclaw-portal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}

.openclaw-portal-header h2 {
	margin: 0;
	font-size: 1.5em;
	font-weight: 600;
	color: #1e1e1e;
}

.openclaw-refresh-btn {
	white-space: nowrap;
}

/* --- Instances Table --- */
.openclaw-instances-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.openclaw-instances-table {
	width: 100%;
	border-collapse: collapse;
}

.openclaw-instances-table thead th {
	background: #f7f9fc;
	color: #555;
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 12px 16px;
	text-align: left;
	border-bottom: 2px solid #e1e5eb;
	white-space: nowrap;
}

.openclaw-instances-table tbody td {
	padding: 14px 16px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	color: #333;
	vertical-align: middle;
}

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

.openclaw-instances-table tbody tr:hover td {
	background: #fafbfc;
}

/* --- Status Badges --- */
.openclaw-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
	white-space: nowrap;
}

.openclaw-status--running {
	background: #e8f5e9;
	color: #2e7d32;
}

.openclaw-status--provisioning {
	background: #e3f2fd;
	color: #1565c0;
}

.openclaw-status--stopped {
	background: #f5f5f5;
	color: #757575;
}

.openclaw-status--suspended {
	background: #fff3e0;
	color: #e65100;
}

.openclaw-status--error {
	background: #ffebee;
	color: #c62828;
}

.openclaw-status--unknown {
	background: #f5f5f5;
	color: #9e9e9e;
}

/* --- LLM Usage Meter --- */
.openclaw-usage-meter {
	min-width: 160px;
}

.openclaw-meter-bar {
	width: 100%;
	height: 8px;
	background: #e9ecef;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 4px;
}

.openclaw-meter-fill {
	height: 100%;
	border-radius: 4px;
	transition: width 0.3s ease;
}

.openclaw-meter--normal .openclaw-meter-fill {
	background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.openclaw-meter--warning .openclaw-meter-fill {
	background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.openclaw-meter--critical .openclaw-meter-fill {
	background: linear-gradient(90deg, #f44336, #ef5350);
}

.openclaw-meter-label {
	font-size: 11px;
	color: #888;
	display: block;
	white-space: nowrap;
}

.openclaw-usage-byok {
	display: inline-block;
	padding: 2px 8px;
	background: #f5f5f5;
	border-radius: 4px;
	font-size: 12px;
	color: #888;
	font-weight: 500;
}

/* --- Action Buttons --- */
.openclaw-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.openclaw-actions .button {
	font-size: 13px;
	padding: 6px 14px;
	white-space: nowrap;
}

.openclaw-actions .button--small {
	font-size: 12px;
	padding: 5px 12px;
}

.openclaw-actions .button--disabled {
	opacity: 0.6;
	pointer-events: none;
}

.openclaw-restart-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --- Error Message --- */
.openclaw-error-detail {
	font-size: 13px;
	color: #999;
	font-style: italic;
}

/* --- Responsive --- */
@media screen and (max-width: 768px) {
	.openclaw-portal-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.openclaw-instances-table thead {
		display: none;
	}

	.openclaw-instances-table tbody tr {
		display: block;
		padding: 16px;
		margin-bottom: 16px;
		border: 1px solid #e1e5eb;
		border-radius: 6px;
		background: #fff;
	}

	.openclaw-instances-table tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 8px 0;
		border-bottom: 1px solid #f0f0f0;
	}

	.openclaw-instances-table tbody td:last-child {
		border-bottom: none;
		padding-top: 12px;
	}

	.openclaw-instances-table tbody td::before {
		content: attr(data-title);
		font-weight: 600;
		color: #555;
		margin-right: 12px;
		flex-shrink: 0;
	}

	.openclaw-usage-meter {
		min-width: 120px;
		text-align: right;
	}

	.openclaw-actions {
		justify-content: flex-end;
		width: 100%;
	}
}
