/* ==========================================================================
   IGIT Related Posts – Analytics Page & Dashboard Widget Styles
   ========================================================================== */

/* ── Analytics page layout ───────────────────────────────────────────────── */
.igit-rpwt-analytics-wrap {
	max-width: 960px;
}

.igit-rpwt-analytics-title {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 24px;
	font-size: 23px;
	font-weight: 400;
	color: #1d2327;
}

.igit-rpwt-analytics-period {
	font-size: 12px;
	font-weight: 400;
	color: #646970;
	background: #f0f0f1;
	border-radius: 4px;
	padding: 2px 8px;
}

/* ── Summary stat cards ──────────────────────────────────────────────────── */
.igit-rpwt-stat-cards {
	display: flex;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.igit-rpwt-stat-card {
	flex: 1 1 160px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
	padding: 16px 20px;
}

.igit-rpwt-stat-value {
	font-size: 30px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1;
	margin-bottom: 6px;
}

.igit-rpwt-stat-label {
	font-size: 11px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ── Chart & table cards ─────────────────────────────────────────────────── */
.igit-rpwt-chart-card,
.igit-rpwt-analytics-table-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 24px;
}

.igit-rpwt-chart-card h2,
.igit-rpwt-analytics-table-card h2 {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

/* ── 30-day bar chart ────────────────────────────────────────────────────── */
.igit-rpwt-bar-chart {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 80px;
	padding-bottom: 1px;
	border-bottom: 1px solid #f0f0f1;
}

.igit-rpwt-bar-wrap {
	flex: 1;
	height: 100%;
	display: flex;
	align-items: flex-end;
	cursor: default;
}

.igit-rpwt-bar {
	width: 100%;
	background: #2271b1;
	border-radius: 2px 2px 0 0;
	transition: background 0.15s;
}

.igit-rpwt-bar-wrap:hover .igit-rpwt-bar {
	background: #135e96;
}

.igit-rpwt-chart-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #646970;
	margin-top: 6px;
}

/* ── Analytics table ─────────────────────────────────────────────────────── */
.igit-rpwt-analytics-table th {
	font-weight: 600;
}

.igit-rpwt-analytics-table .igit-rpwt-rank {
	width: 32px;
	color: #646970;
	font-size: 12px;
}

.igit-rpwt-post-cell {
	display: flex !important;
	align-items: center;
	gap: 10px;
}

.igit-rpwt-ath img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
	flex-shrink: 0;
}

.igit-rpwt-post-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.igit-rpwt-post-title {
	font-weight: 500;
	color: #1d2327;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.igit-rpwt-post-title:hover {
	color: #2271b1;
	text-decoration: underline;
}

.igit-rpwt-post-type {
	font-size: 11px;
	color: #646970;
}

.igit-rpwt-click-count {
	white-space: nowrap;
	width: 80px;
}

.igit-rpwt-bar-cell {
	min-width: 120px;
}

.igit-rpwt-inline-bar {
	display: block;
	height: 6px;
	background: #2271b1;
	border-radius: 3px;
	min-width: 4px;
}

.igit-rpwt-no-data {
	color: #646970;
	font-style: italic;
	padding: 16px 0;
}

/* ── Disabled notice ─────────────────────────────────────────────────────── */
.igit-rpwt-analytics-notice {
	background: #fff;
	border: 1px solid #dcdcde;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
	padding: 16px;
	max-width: 520px;
	margin-top: 16px;
}

.igit-rpwt-analytics-notice p {
	margin: 0 0 12px;
}

/* ── Dashboard widget ────────────────────────────────────────────────────── */
.igit-rpwt-widget-total {
	margin: 0 0 12px;
	font-size: 13px;
	color: #1d2327;
}

.igit-rpwt-widget-list {
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.igit-rpwt-widget-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f1;
	font-size: 13px;
}

.igit-rpwt-widget-item:last-child {
	border-bottom: none;
}

.igit-rpwt-widget-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.igit-rpwt-widget-title a {
	color: #1d2327;
	text-decoration: none;
}

.igit-rpwt-widget-title a:hover {
	color: #2271b1;
	text-decoration: underline;
}

.igit-rpwt-widget-bar-wrap {
	width: 56px;
	height: 4px;
	background: #f0f0f1;
	border-radius: 2px;
	overflow: hidden;
	flex-shrink: 0;
}

.igit-rpwt-widget-bar {
	height: 100%;
	background: #2271b1;
	border-radius: 2px;
	display: block;
}

.igit-rpwt-widget-count {
	font-size: 12px;
	font-weight: 600;
	color: #1d2327;
	white-space: nowrap;
	min-width: 28px;
	text-align: right;
}

.igit-rpwt-widget-footer {
	margin: 0;
	font-size: 12px;
	text-align: right;
}

/* ── Analytics tab (inside main settings page) ───────────────────────────── */
.igit-rpwt-analytics-tab-content {
	padding: 4px 0 8px;
}

.igit-rpwt-analytics-tab-content .igit-rpwt-stat-cards {
	margin-top: 16px;
}

/* ── Click Tracking toggle row ───────────────────────────────────────────── */
.igit-rpwt-tracking-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.igit-rpwt-tracking-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--igit-text-muted);
	min-width: 200px;
}

.igit-rpwt-tracking-row .description {
	margin: 4px 0 0;
	flex-basis: 100%;
	padding-left: 0;
	color: var(--igit-text-muted);
	font-size: 12px;
}

/* ── Data management row ─────────────────────────────────────────────────── */
.igit-rpwt-data-manage {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.igit-rpwt-data-size {
	margin: 0;
	font-size: 13px;
	color: var(--igit-text);
}

.igit-rpwt-data-size strong {
	color: var(--igit-text);
}

#igit-rpwt-clear-analytics {
	color: #e05252;
	border-color: #e05252;
}

#igit-rpwt-clear-analytics:hover,
#igit-rpwt-clear-analytics:focus {
	color: #ff6b6b;
	border-color: #ff6b6b;
}

/* ── Source filter tabs ─────────────────────────────────────────────────── */
.igit-rpwt-source-tabs {
	display: inline-flex;
	gap: 4px;
	margin-bottom: 20px;
	padding: 4px;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--igit-border, #2d3155);
	border-radius: 8px;
}

.igit-rpwt-source-tab {
	padding: 5px 16px;
	font-size: 12px;
	font-weight: 500;
	color: var(--igit-text-muted, #8892b4);
	text-decoration: none;
	border-radius: 6px;
	border: 1px solid transparent;
	transition: color 0.15s, background 0.15s, border-color 0.15s;
	line-height: 1.6;
	white-space: nowrap;
}

.igit-rpwt-source-tab:hover {
	color: var(--igit-text, #e2e8f0);
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--igit-border, #2d3155);
	text-decoration: none;
}

.igit-rpwt-source-tab.is-active {
	color: var(--igit-accent, #818cf8);
	background: rgba(129, 140, 248, 0.12);
	border-color: rgba(129, 140, 248, 0.35);
	font-weight: 600;
}