/* ============================================================
	ATTENTIQ SIDE PANEL — CSS
	Matches dashboard design system
	============================================================ */

/* ── Overlay ────────────────────────────────────────────────── */
#attentiq-side-panel-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(26, 23, 48, 0.35);
	z-index: 100000;
	backdrop-filter: blur(2px);
}

#attentiq-side-panel-overlay.is-open {
	display: block;
}

/* ── Panel ──────────────────────────────────────────────────── */
#attentiq-side-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 420px;
	max-width: 100vw;
	height: 100vh;
	background: #ffffff;
	border-left: 1px solid rgba(108, 99, 255, 0.12);
	box-shadow: -4px 0 32px rgba(108, 99, 255, 0.10);
	z-index: 100001;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: 'DM Sans', sans-serif;
}

#attentiq-side-panel.is-open {
	transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────── */
.iq-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px 16px;
	border-bottom: 1px solid var(--border-soft);
	flex-shrink: 0;
}

.iq-panel-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.2px;
}

.iq-panel-subtitle {
	font-size: 12px;
	color: var(--text-3-aa);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 300px;
}

.iq-panel-close {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid rgba(108, 99, 255, 0.15);
	background: #f0effe;
	color: var(--text-3-aa);
	font-size: 11px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
	padding: 0;
}

.iq-panel-close:hover {
	background: rgba(108, 99, 255, 0.15);
	color: #6c63ff;
}

/* ── Body ───────────────────────────────────────────────────── */
.iq-panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.iq-panel-footer {
	padding: 12px 20px;
	border-top: 1px solid rgba(108, 99, 255, 0.10);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.iq-panel-footer-brand {
	font-size: 11px;
	font-weight: 600;
	color: #6b5a8a;
	font-family: 'DM Mono', monospace;
}

/* ── Loading ────────────────────────────────────────────────── */
.iq-panel-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 60px 20px;
	color: #6b5a8a;
	font-size: 13px;
}

/* ── Error ──────────────────────────────────────────────────── */
.iq-panel-error {
	background: #fef2f2;
	border: 1px solid rgba(239, 68, 68, 0.2);
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 13px;
	color: #ef4444;
}

/* ── Post title ─────────────────────────────────────────────── */
.iq-panel-post-title {
	font-size: 16px;
	font-weight: 600;
	color: #1a1731;
	line-height: 1.35;
	letter-spacing: -0.2px;
}

/* ── Score ring ─────────────────────────────────────────────── */
.iq-panel-score-wrap {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #f5f4ff;
	border: 1px solid rgba(108, 99, 255, 0.10);
	border-radius: 10px;
	padding: 16px;
}

.iq-panel-score-ring {
	position: relative;
	width: 72px;
	height: 72px;
	flex-shrink: 0;
}

.iq-panel-score-num {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
	color: #1a1731;
	font-family: 'DM Mono', monospace;
}

.iq-panel-score-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--text-3-aa);
	font-family: 'DM Mono', monospace;
	margin-bottom: 5px;
}

.iq-panel-score-context {
	font-size: 12px;
	color: #1a1731;
	line-height: 1.5;
}

/* ── Section label ──────────────────────────────────────────── */
.iq-panel-section-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--text-3-aa);
	font-family: 'DM Mono', monospace;
	margin-bottom: -8px;
}

/* ── Slot cards grid ────────────────────────────────────────── */
.iq-panel-slot-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.iq-panel-slot-card {
	background: #f5f4ff;
	border: 1px solid var(--border-soft);
	border-radius: 10px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	position: relative;
	transition: box-shadow 0.15s;
}

.iq-panel-slot-card.is-best {
	background: rgba(108, 99, 255, 0.08);
	border-color: rgba(108, 99, 255, 0.25);
}

.iq-panel-best-badge {
	position: absolute;
	top: -1px;
	right: -1px;
	font-size: 9px;
	font-weight: 700;
	background: #6c63ff;
	color: #fff;
	padding: 2px 7px;
	border-radius: 0 9px 0 6px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.iq-panel-slot-ring {
	position: relative;
	width: 44px;
	height: 44px;
}

.iq-panel-slot-ring-num {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: var(--text);
	font-family: 'DM Mono', monospace;
}

.iq-panel-slot-name {
	font-size: 11px;
	font-weight: 500;
	color: var(--text-3-aa);
	text-align: center;
}

/* ── Revenue ────────────────────────────────────────────────── */
.iq-panel-rev-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.iq-panel-rev-card {
	background: #f5f4ff;
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	padding: 12px 14px;
}

.iq-panel-rev-value {
	font-size: 18px;
	font-weight: 700;
	color: var(--text);
	font-family: 'DM Mono', monospace;
	letter-spacing: -0.3px;
	margin-bottom: 3px;
}

.iq-panel-rev-label {
	font-size: 11px;
	color: var(--text-3-aa);
	font-family: 'DM Mono', monospace;
}

/* ── Notices ────────────────────────────────────────────────── */
.iq-panel-notice {
	border-radius: 8px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.5;
}

.iq-panel-notice--primary {
	background: #ede9ff;
	border-left: 3px solid #6c63ff;
	color: var(--text);
}

.iq-panel-notice--warn {
	background: #fef2f2;
	border-left: 3px solid #ef4444;
	color: var(--text);
}

.iq-panel-upgrade {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--text-3-aa);
}

.iq-panel-upgrade a {
	color: #6c63ff;
	font-weight: 600;
	text-decoration: none;
}

/* ── Ad slot bars ───────────────────────────────────────────── */
.iq-panel-ad-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}


.iq-panel-ad-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 5px;
}

.iq-panel-ad-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 5px;
}

.iq-panel-ad-score {
	font-size: 12px;
	font-weight: 700;
	color: #6c63ff;
	font-family: 'DM Mono', monospace;
}

.iq-panel-bar-track {
	height: 5px;
	background: rgba(108, 99, 255, 0.10);
	border-radius: 99px;
	overflow: hidden;
}

.iq-panel-bar-fill {
	height: 100%;
	background: #6c63ff;
	border-radius: 99px;
	transition: width 0.6s ease;
}

/* Slot tags */
.iq-panel-slot-best-tag {
	font-size: 11px;
	font-weight: 700;
	background: rgba(108, 99, 255, 0.12);
	color: #6c63ff;
	border: 1px solid rgba(108, 99, 255, 0.22);
	border-radius: 99px;
	padding: 1px 6px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.iq-panel-dual-tag {
	font-size: 11px;
	font-weight: 700;
	background: rgba(0, 201, 167, 0.12);
	color: var(--mint-text);
	border: 1px solid rgba(0, 201, 167, 0.22);
	border-radius: 99px;
	padding: 1px 6px;
}

.iq-panel-dual-tag--locked {
	background: rgba(245, 158, 11, 0.10);
	color: var(--amber-text);
	border-color: rgba(245, 158, 11, 0.22);
}

/* ── Actions ────────────────────────────────────────────────── */
.iq-panel-actions {
	display: flex;
	gap: 8px;
	margin-top: auto;
	padding-top: 4px;
}

.iq-panel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.15s;
	font-family: 'DM Sans', sans-serif;
	white-space: nowrap;
}

.iq-panel-btn--primary {
	background: #6c63ff;
	color: #fff;
	border: 1px solid #6c63ff;
}

.iq-panel-btn--primary:hover {
	background: #5a52d5;
	border-color: #5a52d5;
	color: #fff;
}

.iq-panel-btn--ghost {
	background: #fff;
	color: #6c63ff;
	border: 1px solid rgba(108, 99, 255, 0.22);
}

.iq-panel-btn--ghost:hover {
	background: #f0effe;
	color: #6c63ff;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 782px) {
	#attentiq-side-panel {
		width: 100vw;
		border-left: none;
		border-top: 1px solid rgba(108, 99, 255, 0.12);
		height: 92vh;
		top: auto;
		bottom: 0;
		right: 0;
		transform: translateY(100%);
		border-radius: 16px 16px 0 0;
	}

	#attentiq-side-panel.is-open {
		transform: translateY(0);
	}

	.iq-panel-actions {
		flex-direction: column;
	}

	.iq-panel-btn {
		width: auto;
	}
}