/**
 * Unified Dashboard Widget Styles
 * Uses WordPress core components and styling
 */

.zerospam-dashboard-widget {
	font-size: 13px;
	line-height: 1.5;
}

/* Notices */
.zerospam-notice {
	display: flex;
	align-items: flex-start;
	padding: 12px;
	margin: 0 0 16px 0;
	border-left: 4px solid;
	background: #f9f9f9;
	border-radius: 2px;
}

.zerospam-notice-promo {
	border-left-color: #3F0008;
	background: linear-gradient(135deg, rgba(63, 0, 8, 0.05) 0%, rgba(63, 0, 8, 0.02) 100%);
}

.zerospam-notice-info {
	border-left-color: #2271b1;
	background: #f0f6fc;
}

.zerospam-notice-warning {
	border-left-color: #dba617;
	background: #fcf9e8;
}

.zerospam-notice-error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

.zerospam-notice-icon {
	margin-right: 12px;
	flex-shrink: 0;
}

.zerospam-notice-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.zerospam-notice-promo .dashicons {
	color: #3F0008;
}

.zerospam-notice-info .dashicons {
	color: #2271b1;
}

.zerospam-notice-warning .dashicons {
	color: #dba617;
}

.zerospam-notice-error .dashicons {
	color: #d63638;
}

.zerospam-notice-content {
	flex: 1;
}

.zerospam-notice-content h4 {
	margin: 0 0 8px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.zerospam-notice-content p {
	margin: 0 0 8px 0;
	color: #50575e;
}

.zerospam-notice-content p:last-child {
	margin-bottom: 0;
}

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

.zerospam-stat-card {
	display: flex;
	align-items: center;
	padding: 12px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	transition: box-shadow 0.2s ease;
}

.zerospam-stat-card:hover {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zerospam-stat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: 12px;
	background: #f0f0f1;
	border-radius: 4px;
	flex-shrink: 0;
}

.zerospam-stat-icon.zerospam-brand {
	background: rgba(63, 0, 8, 0.1);
}

.zerospam-stat-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #50575e;
}

.zerospam-stat-icon.zerospam-brand .dashicons {
	color: #3F0008;
}

.zerospam-stat-content {
	flex: 1;
	min-width: 0;
}

.zerospam-stat-value {
	font-size: 22px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.2;
	margin-bottom: 2px;
}

.zerospam-stat-label {
	font-size: 11px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.3;
}

/* Sections */
.zerospam-section {
	margin-bottom: 16px;
}

.zerospam-section:last-child {
	margin-bottom: 0;
}

.zerospam-section-title {
	display: flex;
	align-items: center;
	margin: 0 0 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.zerospam-section-title .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	margin-right: 6px;
	color: #50575e;
}

/* API Usage Progress */
.zerospam-api-usage {
	padding: 12px;
	background: #f9f9f9;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.zerospam-progress-bar {
	height: 8px;
	background: #f0f0f1;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 8px;
}

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

.zerospam-progress-normal {
	background: #00a32a;
}

.zerospam-progress-warning {
	background: #dba617;
}

.zerospam-progress-critical {
	background: #d63638;
}

.zerospam-progress-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #50575e;
}

.zerospam-progress-percentage {
	font-weight: 600;
	color: #1d2327;
}

.zerospam-api-reset {
	margin: 8px 0 0 0;
	font-size: 11px;
	color: #646970;
}

/* Charts */
.zerospam-chart-section {
	padding: 12px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.zerospam-chart-container {
	position: relative;
	height: 200px;
	margin-top: 8px;
}

.zerospam-chart-small {
	height: 180px;
}

/* Collapsible Sections */
.zerospam-collapsible {
	border: 1px solid #c3c4c7;
	border-radius: 0;
	overflow: hidden;
	margin-bottom: 16px;
}

.zerospam-toggle-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0;
	padding: 14px 16px;
	background: #fff;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: #1d2327;
}

.zerospam-toggle-trigger:hover {
	background: #f6f7f7;
}

/* Show border only when accordion is open */
.zerospam-collapsible.is-open .zerospam-toggle-trigger {
	border-bottom: 1px solid #c3c4c7;
}

/* Remove margin when section-title is used as toggle trigger */
.zerospam-toggle-trigger.zerospam-section-title {
	margin: 0;
	padding: 14px 16px;
}

/* Ensure h4 element doesn't add extra spacing */
h4.zerospam-toggle-trigger {
	margin: 0 !important;
	padding: 14px 16px !important;
	line-height: 1.4 !important;
}

/* Override section-title dashicon styles when used in toggle */
.zerospam-toggle-trigger.zerospam-section-title .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	margin-left: 8px;
	margin-right: 0;
	color: #646970;
	order: 2;
}

.zerospam-toggle-icon {
	font-size: 20px;
	width: 20px;
	height: 20px;
	margin-left: 8px;
	margin-right: 0;
	color: #646970;
	flex-shrink: 0;
	transition: transform 0.2s ease;
	order: 2;
}

.zerospam-collapsible.is-open .zerospam-toggle-icon {
	transform: rotate(180deg);
}

.zerospam-collapsible-content {
	display: none;
	padding: 16px;
	background: #fff;
	border-top: none;
}

.zerospam-collapsible.is-open .zerospam-collapsible-content {
	display: block;
}

/* Top Sites List */
.zerospam-top-sites-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zerospam-top-site-item {
	margin: 0 0 8px 0;
	padding: 0;
}

.zerospam-top-site-item:last-child {
	margin-bottom: 0;
}

.zerospam-site-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	background: #f9f9f9;
	border-radius: 3px;
	text-decoration: none;
	color: #2271b1;
	transition: all 0.2s ease;
}

.zerospam-site-link:hover {
	background: #f0f0f1;
	color: #135e96;
}

.zerospam-site-link:focus {
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.zerospam-site-name {
	flex: 1;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zerospam-site-count {
	margin-left: 12px;
	padding: 2px 8px;
	background: #fff;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	color: #1d2327;
	white-space: nowrap;
}

/* Empty State */
.zerospam-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #646970;
}

.zerospam-empty-icon {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: #c3c4c7;
	margin: 0 auto 16px;
}

.zerospam-empty-state h3 {
	margin: 0 0 8px 0;
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.zerospam-empty-state p {
	margin: 0;
	font-size: 13px;
	color: #646970;
}

/* Footer */
.zerospam-widget-footer {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #dcdcde;
}

.zerospam-settings-link {
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	color: #2271b1;
	text-decoration: none;
	transition: color 0.2s ease;
}

.zerospam-settings-link:hover {
	color: #135e96;
}

.zerospam-settings-link:focus {
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
	border-radius: 2px;
}

.zerospam-settings-link .dashicons {
	margin-left: 4px;
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.zerospam-stats-grid {
		grid-template-columns: 1fr;
	}

	.zerospam-stat-card {
		padding: 10px;
	}

	.zerospam-stat-icon {
		width: 36px;
		height: 36px;
		margin-right: 10px;
	}

	.zerospam-stat-value {
		font-size: 20px;
	}
}
