/**
 * AI360 Agency Dashboard Styles
 */

.ai360agency-client-dashboard,
.ai360agency-client-api-keys,
.ai360agency-client-usage,
.ai360agency-client-billing {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.ai360agency-client-dashboard h2,
.ai360agency-client-api-keys h2,
.ai360agency-client-usage h2,
.ai360agency-client-billing h2 {
	border-bottom: 2px solid #2271b1;
	padding-bottom: 10px;
	margin-bottom: 20px;
}

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

.stat-card {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	border-left: 4px solid #2271b1;
}

.stat-card h3 {
	margin: 0 0 10px 0;
	font-size: 14px;
	color: #666;
	text-transform: uppercase;
	font-weight: 600;
}

.stat-card p {
	margin: 0;
	font-size: 24px;
	font-weight: bold;
	color: #2271b1;
}

/* API Keys Section */
.client-api-keys {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
	margin-top: 30px;
}

.client-api-keys h3 {
	margin-top: 0;
}

.client-api-keys ul {
	list-style: none;
	padding: 0;
}

.client-api-keys li {
	background: #fff;
	padding: 10px 15px;
	margin-bottom: 10px;
	border-radius: 4px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.client-api-keys code {
	background: #f0f0f1;
	padding: 5px 10px;
	border-radius: 3px;
	font-size: 13px;
	flex: 1;
}

/* Tables */
.wp-list-table {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-collapse: collapse;
	width: 100%;
}

.wp-list-table th,
.wp-list-table td {
	padding: 12px 10px;
	text-align: left;
	border-bottom: 1px solid #c3c4c7;
}

.wp-list-table th {
	background: #f9f9f9;
	font-weight: 600;
}

.wp-list-table code {
	background: #f0f0f1;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-family: monospace;
}

/* Usage Stats */
.usage-stats {
	background: #e7f3ff;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 30px;
	border-left: 4px solid #0073aa;
}

.usage-stats p {
	margin: 10px 0;
}

/* Billing Cards */
.billing-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.billing-card {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	text-align: center;
}

.billing-card h3 {
	margin: 0 0 10px 0;
	font-size: 14px;
	color: #666;
	text-transform: uppercase;
	font-weight: 600;
}

.billing-card .amount {
	font-size: 28px;
	font-weight: bold;
	color: #2271b1;
	margin: 0;
}

.billing-note {
	background: #fff3cd;
	padding: 15px;
	border-left: 4px solid #ffc107;
	border-radius: 4px;
	font-size: 14px;
}

/* Status Badges */
.status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.status-active {
	background: #d4edda;
	color: #155724;
}

.status-suspended {
	background: #fff3cd;
	color: #856404;
}

.status-revoked {
	background: #f8d7da;
	color: #721c24;
}

/* API Keys Info Box */
.ai360-api-keys-info {
	margin-top: 30px;
	padding: 20px;
	background: #f9f9f9;
	border-left: 4px solid #0073aa;
	border-radius: 4px;
}

.ai360-api-keys-info h3 {
	margin-top: 0;
}

.ai360-api-keys-info ul {
	margin: 10px 0;
}

.ai360-api-keys-info li {
	margin-bottom: 8px;
}

/* Copy Button Styling */
.ai360-copy-key {
	background: #2271b1;
	color: #fff;
	border: 1px solid #2271b1;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	transition: all 0.2s ease;
}

.ai360-copy-key:hover {
	background: #135e96;
	border-color: #135e96;
}

.ai360-copy-key:disabled {
	background: #ccc;
	border-color: #ccc;
	cursor: not-allowed;
}

/* Buttons */
.button,
button.button {
	background: #2271b1;
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
	transition: all 0.2s ease;
}

.button:hover,
button.button:hover {
	background: #135e96;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.button-secondary {
	background: #f0f0f1;
	color: #2c3338;
	border: 1px solid #c3c4c7;
}

.button-secondary:hover {
	background: #e0e0e1;
}

/* Notifications */
.ai360-notification {
	position: fixed;
	top: 32px;
	right: 20px;
	padding: 15px 20px;
	border-radius: 4px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.2);
	z-index: 9999;
	animation: slideIn 0.3s ease-out;
	min-width: 250px;
	max-width: 400px;
}

.ai360-notification-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.ai360-notification-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.ai360-notification-info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

/* Toast Notifications */
.ai360agency-toast {
	position: fixed;
	top: 32px;
	right: 20px;
	padding: 15px 20px;
	border-radius: 4px;
	box-shadow: 0 3px 10px rgba(0,0,0,0.3);
	z-index: 10000;
	min-width: 250px;
	max-width: 400px;
	transform: translateX(120%);
	transition: transform 0.3s ease-out;
	font-size: 14px;
	font-weight: 500;
}

.ai360agency-toast-show {
	transform: translateX(0);
}

.ai360agency-toast-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-left: 4px solid #28a745;
}

.ai360agency-toast-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-left: 4px solid #dc3545;
}

.ai360agency-toast-info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
	border-left: 4px solid #17a2b8;
}

/* Modal */
.ai360agency-modal {
	display: block;
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0,0,0,0.4);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ai360agency-modal-show {
	opacity: 1;
}

.ai360agency-modal-content {
	background-color: #fff;
	margin: 10% auto;
	padding: 0;
	border: 1px solid #888;
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.ai360agency-modal-show .ai360agency-modal-content {
	transform: scale(1);
}

.ai360agency-modal-header {
	padding: 20px;
	background-color: #2271b1;
	color: white;
	border-radius: 8px 8px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.ai360agency-modal-header h3 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
}

.ai360agency-modal-close {
	color: white;
	font-size: 28px;
	font-weight: bold;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	line-height: 28px;
	text-align: center;
	transition: all 0.2s ease;
}

.ai360agency-modal-close:hover,
.ai360agency-modal-close:focus {
	color: #f0f0f0;
	transform: scale(1.1);
}

.ai360agency-modal-body {
	padding: 30px;
}

/* New Key Display in Modal */
.ai360agency-new-key-display {
	text-align: left;
}

.ai360agency-new-key-display p:first-child {
	background: #fff3cd;
	padding: 15px;
	border-left: 4px solid #ffc107;
	border-radius: 4px;
	margin-bottom: 20px;
	color: #856404;
}

.ai360agency-key-container {
	display: flex;
	gap: 10px;
	align-items: center;
	background: #f9f9f9;
	padding: 15px;
	border-radius: 4px;
	margin-bottom: 20px;
	border: 1px solid #e0e0e0;
}

.ai360agency-key-code {
	flex: 1;
	background: #fff;
	padding: 10px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	word-break: break-all;
	border: 1px solid #ddd;
}

.ai360agency-key-container .button {
	white-space: nowrap;
	flex-shrink: 0;
}

.ai360agency-key-info {
	font-size: 14px;
	line-height: 1.8;
	color: #666;
	background: #f9f9f9;
	padding: 15px;
	border-radius: 4px;
	border: 1px solid #e0e0e0;
}

/* Create Key Form */
.ai360agency-create-key-form {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 30px;
	border: 1px solid #e0e0e0;
}

.ai360agency-create-key-form h3 {
	margin-top: 0;
	color: #2271b1;
	font-size: 18px;
}

.ai360agency-form-group {
	margin-bottom: 20px;
}

.ai360agency-form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.ai360agency-form-group input[type="text"] {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

.ai360agency-form-group input[type="text"]:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.ai360agency-form-group small {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 13px;
}

/* Action Buttons in Tables */
.ai360agency-actions {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.ai360agency-actions .button {
	padding: 5px 10px;
	font-size: 12px;
	white-space: nowrap;
}

.ai360agency-edit-key {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

.ai360agency-edit-key:hover {
	background: #005177;
	border-color: #005177;
}

.ai360agency-revoke-key {
	background: #f0ad4e;
	border-color: #f0ad4e;
	color: #fff;
}

.ai360agency-revoke-key:hover {
	background: #ec971f;
	border-color: #ec971f;
}

.ai360agency-delete-key {
	background: #d9534f;
	border-color: #d9534f;
	color: #fff;
}

.ai360agency-delete-key:hover {
	background: #c9302c;
	border-color: #c9302c;
}

/* Status Badges with Agency Prefix */
.ai360agency-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.ai360agency-status-active {
	background: #d4edda;
	color: #155724;
}

.ai360agency-status-suspended {
	background: #fff3cd;
	color: #856404;
}

.ai360agency-status-revoked {
	background: #f8d7da;
	color: #721c24;
}

@keyframes slideIn {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOut {
	from {
		transform: translateX(0);
		opacity: 1;
	}
	to {
		transform: translateX(100%);
		opacity: 0;
	}
}

/* Charts Container */
.ai360-chart-container {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	margin: 20px 0;
}

.ai360-chart-container h3 {
	margin-top: 0;
	color: #2271b1;
	border-bottom: 2px solid #e0e0e0;
	padding-bottom: 10px;
}

.ai360-chart-container canvas {
	max-height: 400px;
}

/* Loading Spinner */
.ai360-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(34,113,177,0.3);
	border-radius: 50%;
	border-top-color: #2271b1;
	animation: spin 0.6s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* Empty State */
.ai360-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #666;
}

.ai360-empty-state .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	opacity: 0.3;
	margin-bottom: 20px;
}

.ai360-empty-state h3 {
	color: #666;
	margin-bottom: 10px;
}

/* Tooltips */
.ai360-tooltip {
	position: relative;
	display: inline-block;
}

.ai360-tooltip .ai360-tooltiptext {
	visibility: hidden;
	width: 200px;
	background-color: #1d2327;
	color: #fff;
	text-align: center;
	border-radius: 4px;
	padding: 8px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	margin-left: -100px;
	opacity: 0;
	transition: opacity 0.3s;
	font-size: 12px;
}

.ai360-tooltip:hover .ai360-tooltiptext {
	visibility: visible;
	opacity: 1;
}

/* Progress Bar */
.ai360-progress {
	width: 100%;
	height: 8px;
	background: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	margin: 10px 0;
}

.ai360-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #2271b1 0%, #4f94d4 100%);
	transition: width 0.3s ease;
}

/* API Key Display */
.ai360-api-key-display {
	background: #f9f9f9;
	padding: 15px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 10px 0;
}

.ai360-api-key-display code {
	flex: 1;
	overflow-x: auto;
	white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
	.client-stats,
	.billing-summary {
		grid-template-columns: 1fr;
	}

	.wp-list-table {
		font-size: 12px;
		display: block;
		overflow-x: auto;
	}

	.wp-list-table th,
	.wp-list-table td {
		padding: 8px 5px;
	}
	
	.ai360-notification,
	.ai360agency-toast {
		right: 10px;
		left: 10px;
		max-width: none;
	}
	
	.ai360-api-key-display {
		flex-direction: column;
		align-items: stretch;
	}
	
	.ai360-chart-container canvas {
		max-height: 300px;
	}

	.ai360agency-modal-content {
		width: 95%;
		margin: 5% auto;
	}

	.ai360agency-key-container {
		flex-direction: column;
	}

	.ai360agency-actions {
		flex-direction: column;
	}

	.ai360agency-actions .button {
		width: 100%;
		text-align: center;
	}
}

