/**
 * Changeloger Block Analytics Page Styles
 *
 * Styles for the block analytics page displaying usage data,
 * statistics, and action buttons for the cha/changeloger block.
 */





/* ===============================================
   Content Grid
   =============================================== */
.cha-ba-content-grid {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 20px;
	align-items: start;

	@media (max-width: 1100px) {
		grid-template-columns: 1fr;
	}
}

/* ===============================================
   Cards
   =============================================== */
.cha-ba-card {
	background: var(--cha-white);
	border: 1px solid var(--cha-border);
	border-radius: var(--cha-radius);
	box-shadow: var(--cha-shadow);
	overflow: hidden;
}

.cha-ba-sidebar {

	.cha-ba-card {
		margin-bottom: 16px;

		&:last-child {
			margin-bottom: 0;
		}
	}
}

.cha-ba-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--cha-border);
	background: var(--cha-bg-light);

	h2 {
		margin: 0;
		font-size: 14px;
		font-weight: 600;
		color: var(--cha-text-primary);
	}
}

.cha-ba-card-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cha-ba-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 8px;
	background: var(--cha-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	border-radius: 12px;
}

.cha-ba-card-body {
	padding: 20px;

	&.cha-ba-no-padding {
		padding: 0;
	}
}

/* ===============================================
   Table
   =============================================== */
.cha-ba-table {
	width: 100%;
	border-collapse: collapse;

	th,
	td {
		padding: 14px 20px;
		text-align: left;
	}

	thead th {
		font-size: 11px;
		font-weight: 600;
		color: var(--cha-text-muted);
		text-transform: uppercase;
		letter-spacing: 0.05em;
		border-bottom: 1px solid var(--cha-border);
		background: var(--cha-bg-light);
	}

	tbody {

		td {
			font-size: 14px;
			color: var(--cha-text-primary);
			border-bottom: 1px solid var(--cha-border-light);
		}

		tr {
			transition: background-color 0.15s ease;

			&:last-child td {
				border-bottom: none;
			}

			&:hover {
				background: var(--cha-bg-light);
			}
		}
	}
}

/* Page Title Cell */
.cha-ba-page-title {
	display: flex;
	align-items: center;
	gap: 10px;

	svg {
		color: var(--cha-text-muted);
		flex-shrink: 0;
	}

	a {
		color: var(--cha-text-primary);
		text-decoration: none;
		font-weight: 500;
		transition: color 0.15s ease;

		&:hover {
			color: var(--cha-primary);
		}
	}
}

/* Type Badge */
.cha-ba-type-badge {
	display: inline-block;
	padding: 3px 10px;
	background: var(--cha-secondary);
	color: var(--cha-primary);
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
}

/* Status Dot */
.cha-ba-status-dot {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;

	&::before {
		content: '';
		width: 8px;
		height: 8px;
		border-radius: 50%;
		flex-shrink: 0;
	}
}

.cha-ba-status-publish {
	color: var(--cha-success);

	&::before {
		background: var(--cha-success);
		box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
	}
}

.cha-ba-status-draft {
	color: var(--cha-warning);

	&::before {
		background: var(--cha-warning);
		box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
	}
}

.cha-ba-status-private {
	color: var(--cha-info);

	&::before {
		background: var(--cha-info);
		box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	}
}

.cha-ba-status-pending {
	color: #9333ea;

	&::before {
		background: #9333ea;
		box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
	}
}

/* Date */
.cha-ba-date {
	font-size: 13px;
	color: var(--cha-text-secondary);
}

/* Actions */
.cha-ba-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cha-ba-action-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--cha-radius-xs);
	color: var(--cha-text-muted);
	transition: all 0.15s ease;
	text-decoration: none;

	&:hover {
		background: var(--cha-secondary);
		color: var(--cha-primary);
	}
}

/* ===============================================
   Empty State
   =============================================== */
.cha-ba-empty-state {
	text-align: center;
	padding: 60px 20px;

	h3 {
		margin: 0 0 8px;
		font-size: 18px;
		font-weight: 600;
		color: var(--cha-text-primary);
	}

	p {
		margin: 0 0 24px;
		font-size: 14px;
		color: var(--cha-text-secondary);
	}
}

.cha-ba-empty-icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--cha-secondary) 0%, #e8e9ff 100%);
	color: var(--cha-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

/* ===============================================
   Info List (Block Information)
   =============================================== */
.cha-ba-info-list {
	list-style: none;
	margin: 0;
	padding: 0;

	li {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 12px 0;
		border-bottom: 1px solid var(--cha-border-light);

		&:last-child {
			border-bottom: none;
			padding-bottom: 0;
		}

		&:first-child {
			padding-top: 0;
		}
	}
}

.cha-ba-info-label {
	font-size: 13px;
	color: var(--cha-text-secondary);
}

.cha-ba-info-value {
	font-size: 13px;
	font-weight: 500;
	color: var(--cha-text-primary);

	code {
		padding: 3px 8px;
		background: var(--cha-bg-light);
		border: 1px solid var(--cha-border);
		border-radius: 4px;
		font-size: 12px;
		color: var(--cha-primary);
	}
}

/* Active / Inactive Badge */
.cha-ba-active-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	background: var(--cha-success-light);
	color: var(--cha-success);
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.cha-ba-active-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cha-success);
	animation: cha-pulse 2s ease-in-out infinite;
}

@keyframes cha-pulse {

	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}

	50% {
		opacity: 0.6;
		transform: scale(0.85);
	}
}

.cha-ba-inactive-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	background: var(--cha-bg-light);
	color: var(--cha-text-muted);
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

/* ===============================================
   Breakdown Chart
   =============================================== */
.cha-ba-breakdown-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cha-ba-breakdown-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.cha-ba-breakdown-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--cha-text-primary);
}

.cha-ba-breakdown-count {
	font-size: 13px;
	font-weight: 600;
	color: var(--cha-primary);
}

.cha-ba-breakdown-bar {
	height: 6px;
	background: var(--cha-border-light);
	border-radius: 3px;
	overflow: hidden;
}

.cha-ba-breakdown-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--cha-primary) 0%, var(--cha-primary-light) 100%);
	border-radius: 3px;
	transition: width 0.5s ease;
	min-width: 4px;
}

/* ===============================================
   Quick Actions
   =============================================== */
.cha-ba-quick-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cha-ba-quick-action {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--cha-bg-light);
	border-radius: var(--cha-radius-sm);
	text-decoration: none;
	color: var(--cha-text-primary);
	transition: all 0.15s ease;

	&:hover {
		background: var(--cha-border-light);
		color: var(--cha-text-primary);
		transform: translateX(2px);
	}

	span {
		font-size: 13px;
		font-weight: 500;
	}
}

.cha-ba-qa-icon {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;

	svg {
		width: 16px;
		height: 16px;
	}
}

/* ===============================================
   Responsive
   =============================================== */
@media (max-width: 768px) {

	.cha-ba-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.cha-ba-table {

		th:nth-child(4),
		td:nth-child(4) {
			display: none;
		}
	}
}

@media (max-width: 480px) {

	.cha-ba-table {

		th:nth-child(2),
		td:nth-child(2),
		th:nth-child(3),
		td:nth-child(3) {
			display: none;
		}
	}
}
