/**
 * Auto Form Builder - WordPress Dashboard Widget.
 *
 * Styles for the plugin widget shown on the main wp-admin dashboard:
 * stat cards, 7-day activity chart, recent submissions list and the
 * quick action buttons.
 */

/* ----- Stat cards ----- */

#auto_form_builder_dashboard_widget .afb-dw-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 4px 0 16px;
}

#auto_form_builder_dashboard_widget .afb-dw-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 12px 6px;
	border-radius: 8px;
	text-decoration: none;
	border: 1px solid transparent;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#auto_form_builder_dashboard_widget .afb-dw-stat:hover,
#auto_form_builder_dashboard_widget .afb-dw-stat:focus {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
}

#auto_form_builder_dashboard_widget .afb-dw-stat-value {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	margin-top: 2px;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-forms {
	background: #eef4ff;
	border-color: #d4e2fc;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-forms .afb-dw-stat-value,
#auto_form_builder_dashboard_widget .afb-dw-stat-forms .afb-dw-stat-label {
	color: #1d4ed8;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-submissions {
	background: #ecfdf3;
	border-color: #d1f0dd;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-submissions .afb-dw-stat-value,
#auto_form_builder_dashboard_widget .afb-dw-stat-submissions .afb-dw-stat-label {
	color: #047857;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-unread {
	background: #fff7ed;
	border-color: #fde4c8;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-unread .afb-dw-stat-value,
#auto_form_builder_dashboard_widget .afb-dw-stat-unread .afb-dw-stat-label {
	color: #c2410c;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-week {
	background: #f5f3ff;
	border-color: #e4defc;
}

#auto_form_builder_dashboard_widget .afb-dw-stat-week .afb-dw-stat-value,
#auto_form_builder_dashboard_widget .afb-dw-stat-week .afb-dw-stat-label {
	color: #6d28d9;
}

/* ----- Sections ----- */

#auto_form_builder_dashboard_widget .afb-dw-section {
	margin-bottom: 16px;
}

#auto_form_builder_dashboard_widget .afb-dw-section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

#auto_form_builder_dashboard_widget .afb-dw-section-title {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #646970;
	margin: 0 0 8px;
}

#auto_form_builder_dashboard_widget .afb-dw-view-all {
	font-size: 12px;
	text-decoration: none;
}

/* ----- Activity chart ----- */

#auto_form_builder_dashboard_widget .afb-dw-chart {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	align-items: end;
	padding: 8px 4px 4px;
	background: #f6f7f7;
	border: 1px solid #eceded;
	border-radius: 8px;
}

#auto_form_builder_dashboard_widget .afb-dw-chart-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

#auto_form_builder_dashboard_widget .afb-dw-chart-count {
	font-size: 11px;
	font-weight: 600;
	color: #50575e;
}

#auto_form_builder_dashboard_widget .afb-dw-chart-track {
	display: flex;
	align-items: flex-end;
	width: 100%;
	max-width: 26px;
	height: 64px;
	background: #eceded;
	border-radius: 4px;
	overflow: hidden;
}

#auto_form_builder_dashboard_widget .afb-dw-chart-bar {
	display: block;
	width: 100%;

	/* Height is set by dashboard-widget.js from the data-count attribute. */
	height: 0;
	min-height: 2px;
	background: linear-gradient(180deg, #4f8ef7 0%, #2271b1 100%);
	border-radius: 4px 4px 0 0;
	transition: height 0.4s ease;
}

#auto_form_builder_dashboard_widget .afb-dw-chart-day {
	font-size: 11px;
	color: #646970;
}

/* ----- Recent submissions list ----- */

#auto_form_builder_dashboard_widget .afb-dw-list {
	margin: 0;
	border: 1px solid #eceded;
	border-radius: 8px;
	overflow: hidden;
}

#auto_form_builder_dashboard_widget .afb-dw-list-item {
	margin: 0;
	border-bottom: 1px solid #eceded;
}

#auto_form_builder_dashboard_widget .afb-dw-list-item:last-child {
	border-bottom: none;
}

#auto_form_builder_dashboard_widget .afb-dw-list-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-decoration: none;
	color: #1d2327;
}

#auto_form_builder_dashboard_widget .afb-dw-list-link:hover,
#auto_form_builder_dashboard_widget .afb-dw-list-link:focus {
	background: #f6f7f7;
}

#auto_form_builder_dashboard_widget .afb-dw-list-dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #c3c4c7;
}

#auto_form_builder_dashboard_widget .afb-dw-is-unread .afb-dw-list-dot {
	background: #2271b1;
}

#auto_form_builder_dashboard_widget .afb-dw-list-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

#auto_form_builder_dashboard_widget .afb-dw-list-title {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#auto_form_builder_dashboard_widget .afb-dw-is-unread .afb-dw-list-title {
	font-weight: 700;
}

#auto_form_builder_dashboard_widget .afb-dw-list-meta {
	font-size: 11px;
	color: #646970;
}

#auto_form_builder_dashboard_widget .afb-dw-list-time {
	flex: 0 0 auto;
	font-size: 11px;
	color: #646970;
	white-space: nowrap;
}

/* ----- Empty state ----- */

#auto_form_builder_dashboard_widget .afb-dw-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 16px 12px;
	margin-bottom: 16px;
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
}

#auto_form_builder_dashboard_widget .afb-dw-empty-icon {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: #a7aaad;
	margin-bottom: 8px;
}

#auto_form_builder_dashboard_widget .afb-dw-empty-text {
	margin: 0;
	color: #50575e;
}

#auto_form_builder_dashboard_widget .afb-dw-empty-note {
	margin: 0;
	padding: 12px;
	background: #f6f7f7;
	border: 1px solid #eceded;
	border-radius: 8px;
	color: #50575e;
}

/* ----- Quick actions ----- */

#auto_form_builder_dashboard_widget .afb-dw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 12px;
	border-top: 1px solid #eceded;
}
