/* ============================================================
	ATTENTIQ DASHBOARD — Ticker + Cards + RPM + Forecast
	All colours use CSS variables from attentiq-admin.css
	All text meets WCAG AA — minimum font-size: 12px
	============================================================ */

/* ── Ticker ───────────────────────────────────────────────── */
.attentiq-ticker-wrap {
	margin: 0 2px 14px;
	background: var(--hero-bg);
	border-radius: 0 0 8px 8px;
	border: 1px solid var(--hero-border);
	overflow: hidden;
	display: flex;
	align-items: stretch;
	height: 36px;
}

/* FIX: was 9px FAIL → 12px; opacity text → explicit accessible colour */
.attentiq-ticker-label {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 14px;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: var(--hero-text-dim);
	border-right: 1px solid var(--hero-border);
	white-space: nowrap;
	background: rgba(255,255,255,0.03);
}

.attentiq-ticker-label-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--hero-mint);
	animation: attentiq-pulse 2s ease-in-out infinite;
	flex-shrink: 0;
}

.attentiq-ticker-track {
	flex: 1;
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
}

.attentiq-ticker-track::before,
.attentiq-ticker-track::after {
	content: '';
	position: absolute;
	top: 0; bottom: 0;
	width: 40px;
	z-index: 2;
	pointer-events: none;
}

.attentiq-ticker-track::before {
	left: 0;
	background: linear-gradient(to right, var(--hero-bg), transparent);
}

.attentiq-ticker-track::after {
	right: 0;
	background: linear-gradient(to left, var(--hero-bg), transparent);
}

.attentiq-ticker-inner {
	display: flex;
	gap: 0;
	white-space: nowrap;
	animation: attentiq-ticker-scroll 40s linear infinite;
	will-change: transform;
}

.attentiq-ticker-inner:hover {
	animation-play-state: paused;
}

@keyframes attentiq-ticker-scroll {
	0%   { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* FIX: was 11px FAIL → 12px; opacity colour → var */
.attentiq-ticker-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0 20px;
	font-size: 12px;
	font-weight: 600;
	color: var(--hero-text-dim);
	border-right: 1px solid var(--hero-border-mid);
	cursor: pointer;
	transition: color 0.15s;
	text-decoration: none;
}

.attentiq-ticker-item:hover {
	color: var(--hero-text-muted);
	text-decoration: none;
	background: rgba(255,255,255,0.04);
}

.attentiq-ticker-post {
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--hero-text-sub);
}

/* FIX: was 11px FAIL → 12px */
.attentiq-ticker-time {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
}

.attentiq-ticker-time.is-up   { color: var(--hero-mint); }
.attentiq-ticker-time.is-down { color: #f87171; }        /* red on dark — passes */
.attentiq-ticker-time.is-flat { color: var(--hero-text-dim); }

/* FIX: was 9px FAIL → 12px */
.attentiq-ticker-arrow {
	font-size: 12px;
	line-height: 1;
}

.attentiq-ticker-arrow.is-up   { color: var(--hero-mint); }
.attentiq-ticker-arrow.is-down { color: #f87171; }

/* FIX: was 11px FAIL → 12px */
.attentiq-ticker-empty {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 0 16px;
	font-size: 12px;
	color: var(--hero-text-dim);
	font-style: italic;
}

/* ── Dashboard cards row ──────────────────────────────────── */
.attentiq-dash-cards {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr 220px;
	gap: 12px;
	margin: 0 2px 14px;
}

.attentiq-dash-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 18px 20px;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.attentiq-dash-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	border-radius: 10px 10px 0 0;
}

.attentiq-dash-card.is-time::before     { background: var(--header); }
.attentiq-dash-card.is-rpm::before      { background: var(--header); }
.attentiq-dash-card.is-forecast::before { background: var(--mint); }
.attentiq-dash-card.is-notif::before    { background: var(--header); }

.attentiq-dash-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 12px;
}

/* FIX: was 10px FAIL → 12px; #9ca3af on white = 2.5:1 FAIL → var(--text-3-aa) = 4.6:1 */
.attentiq-dash-card-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--text-3-aa);
}

.attentiq-dash-card-icon {
	font-size: 15px;
	line-height: 1;
	color: var(--text);
	opacity: .8;
}

/* ── Total time card ──────────────────────────────────────── */
.attentiq-time-value {
	font-size: 28px;
	font-weight: 800;
	color: var(--text);
	line-height: 1;
	margin-bottom: 4px;
	font-family: var(--font-mono);
}

/* FIX: #6b7280 on white = 4.5:1 borderline → var(--text-2-aa) = 5.0:1 */
.attentiq-time-label {
	font-size: 12px;
	color: var(--text-2-aa);
	margin-bottom: 10px;
}

/* FIX: was 11px FAIL → 12px */
.attentiq-time-trend {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	margin-top: auto;
}

/* FIX: var(--mint) = #00c9a7 on white = 2.3:1 FAIL → var(--mint-text) = 4.6:1 */
.attentiq-time-trend.is-up   { color: var(--mint-text); }
/* FIX: var(--red) = #ef4444 on white = 3.9:1 FAIL → var(--red-text) = 5.1:1 */
.attentiq-time-trend.is-down { color: var(--red-text); }
/* FIX: #9ca3af on white = 2.5:1 FAIL → var(--text-3-aa) */
.attentiq-time-trend.is-flat {
	background: var(--surface-3);
	color: var(--text-3-aa);
	border: 1px solid var(--border);
}

/* FIX: was 11px FAIL → 12px; #d1d5db on white = 1.3:1 FAIL → var(--text-3-aa) */
.attentiq-dash-empty {
	font-size: 12px;
	color: var(--text-3-aa);
	font-style: italic;
	margin-top: auto;
	line-height: 1.4;
}

/* ── RPM card ─────────────────────────────────────────────── */
.attentiq-rpm-main {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-bottom: 4px;
}

/* FIX: var(--header) = #a78bfa on white = 2.4:1 FAIL → var(--header-text) = 4.7:1 */
.attentiq-rpm-value {
	font-size: 28px;
	font-weight: 800;
	color: var(--header-text);
	line-height: 1;
	font-family: var(--font-mono);
}

/* FIX: #9ca3af on white = 2.5:1 FAIL → var(--text-3-aa) */
.attentiq-rpm-unit {
	font-size: 12px;
	color: var(--text-3-aa);
	font-weight: 600;
}

.attentiq-rpm-label {
	font-size: 12px;
	color: var(--text-2-aa);
	margin-bottom: 10px;
}

.attentiq-rpm-lift {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	background: var(--mint-10);
	border: 1px solid var(--border-mint-light);
	border-radius: 7px;
	margin-top: auto;
}

.attentiq-rpm-lift-icon { font-size: 13px; }

/* FIX: was 11px FAIL → 12px */
.attentiq-rpm-lift-text {
	font-size: 12px;
	color: var(--text);
	line-height: 1.35;
}

/* FIX: var(--mint) on white FAIL → var(--mint-text) */
.attentiq-rpm-lift-text strong {
	color: var(--mint-text);
	font-weight: 700;
}

.attentiq-rpm-upgrade {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	background: var(--primary-soft);
	border: 1px solid rgba(108,99,255,0.15);
	border-radius: 5px;
	margin-top: auto;
	text-decoration: none;
	transition: background 0.15s;
}

.attentiq-rpm-upgrade:hover {
	background: var(--surface-3);
	text-decoration: none;
}

/* FIX: was 11px FAIL → 12px; #6c63ff = 3.1:1 FAIL → var(--primary-text) = 4.8:1 */
.attentiq-rpm-upgrade-text {
	font-size: 12px;
	color: var(--primary-text);
	font-weight: 600;
	line-height: 1.35;
}

/* ── Forecast card ────────────────────────────────────────── */
.attentiq-forecast-confidence {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
}

.attentiq-forecast-icon { font-size: 18px; line-height: 1; }

/* FIX: was 10px FAIL → 12px; #9ca3af FAIL → var(--text-3-aa) */
.attentiq-forecast-conf-label {
	font-size: 12px;
	color: var(--text-3-aa);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.attentiq-forecast-chart {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 48px;
	margin-bottom: 8px;
	flex: auto;
}

.attentiq-forecast-bar-wrap {
	flex: 1;
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

.attentiq-forecast-bar {
	width: 100%;
	border-radius: 3px 3px 0 0;
	min-height: 3px;
	transition: height 0.4s ease;
	background: var(--border);
	position: absolute;
	bottom: 40%;
}

.attentiq-forecast-day {
	position: absolute;
	bottom: 0;
	text-align: center;
	/* FIX: was 8px FAIL → 12px; #d1d5db FAIL → var(--text-3-aa) */
	font-size: 12px;
	color: var(--text-3-aa);
	font-weight: 600;
	text-transform: uppercase;
}

.attentiq-forecast-bar.is-today  { background: var(--mint); }
.attentiq-forecast-bar.has-data  { background: var(--header-text-70) }

/* FIX: var(--mint) on white FAIL → var(--mint-text) */
.attentiq-forecast-day.is-today  { color: var(--mint-text); }

/* FIX: was 11px FAIL → 12px; #6b7280 borderline → var(--text-2-aa) */
.attentiq-forecast-projection {
	font-size: 12px;
	color: var(--text-2-aa);
	margin-top: auto;
	border-top: 1px solid var(--border-soft);
	padding-top: 8px;
}

.attentiq-forecast-projection strong {
	color: var(--text);
	font-weight: 700;
}

.attentiq-forecast-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	gap: 6px;
	padding: 8px 0;
}

.attentiq-forecast-empty-icon {
	font-size: 28px;
	opacity: 0.4;
}

/* FIX: was 11px FAIL; #d1d5db FAIL → var(--text-3-aa) */
.attentiq-forecast-empty-text {
	font-size: 12px;
	color: var(--text-3-aa);
	text-align: center;
	line-height: 1.4;
}

/* ── Notification inbox card ──────────────────────────────── */
.attentiq-notif-card {
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.attentiq-notif-card:hover {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(108,99,255,0.08);
}

.attentiq-notif-bell-wrap {
	position: relative;
	display: inline-flex;
	margin-bottom: 12px;
}

.attentiq-notif-bell {
	font-size: 32px;
	line-height: 1;
	opacity: 0.8;
}

.attentiq-notif-badge {
	position: absolute;
	top: -2px; right: -4px;
	width: 14px; height: 14px;
	background: var(--red);
	border-radius: 50%;
	border: 2px solid var(--surface);
	display: none;
}

.attentiq-notif-badge.has-notifs {
	display: block;
	animation: attentiq-badge-pop 0.3s ease;
}

@keyframes attentiq-badge-pop {
	0%   { transform: scale(0); }
	70%  { transform: scale(1.3); }
	100% { transform: scale(1); }
}

.attentiq-notif-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 3px;
}

/* FIX: was 11px FAIL; #9ca3af FAIL → var(--text-3-aa) */
.attentiq-notif-sub {
	font-size: 12px;
	color: var(--text-3-aa);
	line-height: 1.4;
	margin-bottom: auto;
}

/* FIX: was 11px FAIL; #6c63ff = 3.1:1 FAIL → var(--primary-text) */
.attentiq-notif-cta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--primary-text);
	margin-top: 10px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 1400px ) {
	.attentiq-dash-cards { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media ( max-width: 1380px ) {
	.attentiq-hero-inner   { border-radius: 12px !important; margin-bottom: 16px; }
	.attentiq-hero-ticker  { display: none; }
	.attentiq-ticker-wrap  { display: none; }
	.attentiq-dash-cards   { grid-template-columns: 1fr 1fr; }
	.attentiq-wc-highlights { grid-template-columns: 1fr 1fr; }
	.attentiq-wc-highlight-card:last-child { grid-column: 1 / -1; }
}

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

@media ( max-width: 782px ) {
	.attentiq-wc-highlights               { grid-template-columns: 1fr; }
	.attentiq-wc-highlight-card:last-child { grid-column: auto; }
}

@media ( max-width: 520px ) {
	.attentiq-dash-cards { grid-template-columns: 1fr; }
}