/* Propagation Dashboard — responsive layout */

.analysis-page {
	padding: 0.5rem;
	max-width: 1200px;
	margin: 0 auto;
}

/* ── WIP banner ── */
.wip-banner {
	background: #fff8e1;
	border: 1px solid #f0c040;
	border-radius: 4px;
	padding: 0.6rem 0.9rem;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #5d4700;
}

/* ── Heatmap custom tooltip ── */
.heatmap-tip {
	display: none;
	position: absolute;
	z-index: 1000;
	background: rgba(30, 30, 30, 0.92);
	color: #f0f0f0;
	font-size: 0.82rem;
	line-height: 1.4;
	padding: 0.45rem 0.65rem;
	border-radius: 4px;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Mode tabs ── */

.mode-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 0;
}

.mode-tab {
	padding: 0.4rem 1.2rem;
	border: 1px solid #ccc;
	border-bottom: none;
	border-radius: 8px 8px 0 0;
	background: #e8e8e8;
	color: #666;
	font-size: 0.85rem;
	font-weight: bold;
	cursor: pointer;
}

.mode-tab:hover {
	background: #ddd;
}

.mode-tab--active {
	background: #fff;
	color: #333;
	border-bottom: 1px solid #fff;
	margin-bottom: -1px;
	z-index: 1;
}

/* ── Compare input row ── */

.compare-input-row {
	display: flex;
	gap: 0.35rem;
	align-items: center;
}

/* ── Compare chips ── */

.compare-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.3rem 0;
	min-height: 0;
}

.compare-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: #f4f4f4;
	border: 1px solid #ccc;
	border-radius: 16px;
	padding: 0.2rem 0.5rem 0.2rem 0.35rem;
	font-size: 0.8rem;
}

.compare-chip-color {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
}

.compare-chip-call {
	font-weight: bold;
}

.compare-chip-count {
	color: #888;
	font-size: 0.75rem;
}

.compare-chip-del {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: #999;
	padding: 0 0.15rem;
}

.compare-chip-del:hover {
	color: #d00;
}

/* ── Controls bar ── */

.analysis-controls-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-top: 1px solid #ccc;
	border-bottom: 1px solid #ccc;
	margin-bottom: 0.5rem;
}

.control-group {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.control-group > label,
.control-group-label {
	font-size: 0.7rem;
	font-weight: bold;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Uniform height for all inline controls */
.analysis-controls-bar input[type="text"],
.analysis-controls-bar select,
.analysis-controls-bar .btn {
	box-sizing: border-box;
	height: 34px;
	padding: 0 0.5rem;
	font-size: 0.85rem;
	border: 1px solid #aaa;
	border-radius: 3px;
	vertical-align: middle;
}

#analysis-call,
#compare-call-input {
	width: 10ch;
	text-transform: uppercase;
}

#analysis-call::placeholder,
#compare-call-input::placeholder {
	text-transform: none;
}

#analysis-datepicker {
	width: 16ch;
}

/* ── Date navigation ── */

.control-group-date-prev,
.control-group-date-next {
	margin-left: -0.5rem;
	margin-right: -0.5rem;
}

.control-label-spacer {
	font-size: 0.7rem;
	visibility: hidden;
}

.btn-date-nav {
	width: 34px;
	padding: 0;
	text-align: center;
	font-size: 1rem;
}

.analysis-controls-bar input[type="text"]:focus,
.analysis-controls-bar select:focus {
	border-color: #4572a7;
	outline: none;
}

.control-separator {
	border-left: 1px solid #ddd;
	height: 34px;
	align-self: flex-end;
	margin: 0 0.1rem;
}

.control-right {
	margin-left: auto;
}

.radio-group {
	display: flex;
	gap: 0.5rem;
	min-height: 32px;
	align-items: center;
	font-size: 0.85rem;
}

.radio-group label {
	cursor: pointer;
}

/* ── Spotter filter ── */

.spotter-filter {
	position: relative;
}

.spotter-filter-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	background: #fff;
	border: 1px solid #aaa;
	border-radius: 3px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	min-width: 220px;
	max-height: 300px;
	display: flex;
	flex-direction: column;
	margin-top: 2px;
}

.spotter-filter-header {
	display: flex;
	gap: 0.75rem;
	padding: 0.35rem 0.5rem;
	border-bottom: 1px solid #ddd;
	background: #f8f8f8;
}

.btn-link {
	background: none;
	border: none;
	color: #4572a7;
	cursor: pointer;
	font-size: 0.8rem;
	padding: 0;
	text-decoration: underline;
}

.btn-link:hover {
	color: #2a4a7a;
}

.spotter-filter-list {
	overflow-y: auto;
	padding: 0.3rem 0;
}

.spotter-filter-list label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.2rem 0.5rem;
	font-size: 0.8rem;
	cursor: pointer;
	white-space: nowrap;
}

.spotter-filter-list label:hover {
	background: #f0f4ff;
}

.spotter-filter-list .spotter-count {
	color: #999;
	font-size: 0.75rem;
	margin-left: auto;
}

/* ── Status line ── */

/* ── Plot mode toggle ── */

.plot-mode-toggle {
	font-size: 0.85rem;
	padding: 0.25rem 0;
}

.plot-mode-toggle label {
	margin-right: 0.75rem;
	cursor: pointer;
}

.analysis-status {
	font-size: 0.8rem;
	color: #666;
	padding: 0.25rem 0;
	min-height: 1.2em;
}

/* ── No data message ── */

.no-data-msg {
	text-align: center;
	padding: 3rem 1rem;
	color: #999;
	font-size: 1rem;
}

/* ── Chart containers ── */

.chart-box {
	width: 100%;
	max-width: 1100px;
	position: relative;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 0.5rem;
	margin-bottom: 0.75rem;
}

.detail-title {
	font-size: 0.8rem;
	color: #666;
	padding: 0.25rem 0;
	cursor: pointer;
}

/* ── Buttons ── */

.btn {
	box-sizing: border-box;
	padding: 0 0.75rem;
	border: 1px solid #999;
	border-radius: 3px;
	background: #f0f0f0;
	cursor: pointer;
	font-size: 0.85rem;
	height: 34px;
}

.btn:hover:not(:disabled) {
	background: #e0e0e0;
}

.btn-go {
	background: #003300;
	color: #fff;
	border-color: #003300;
	font-weight: bold;
	padding: 0 1rem;
}

.btn-go:hover:not(:disabled) {
	background: #005500;
}


/* ── Live indicator ── */

.live-indicator {
	display: none;
	width: 8px;
	height: 8px;
	background: #2ecc40;
	border-radius: 50%;
	vertical-align: middle;
}

.live-indicator--active {
	display: inline-block;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

/* ── Loading spinner ── */

.spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #ccc;
	border-top-color: #333;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ── Toast notifications ── */

.analysis-toast {
	position: fixed;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%) translateY(100%);
	padding: 0.6rem 1.2rem;
	border-radius: 4px;
	font-size: 0.85rem;
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.analysis-toast--visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.analysis-toast--error {
	background: #fce4e4;
	border: 1px solid #d8000c;
	color: #d8000c;
}

.analysis-toast--info {
	background: #e4f0fc;
	border: 1px solid #0060c0;
	color: #0060c0;
}

/* ── Help dialog ── */

.analysis-help-dialog {
	max-width: 600px;
	padding: 1.5rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.9rem;
	line-height: 1.5;
}

.analysis-help-dialog::backdrop {
	background: rgba(0, 0, 0, 0.3);
}

.analysis-help-dialog h2 {
	margin-top: 0;
	font-size: 1.1rem;
}

.analysis-help-dialog form {
	text-align: right;
	margin-top: 1rem;
}

/* ── Responsive ── */

@media (max-width: 600px) {
	.analysis-controls-bar {
		gap: 0.5rem;
	}

	.control-right {
		margin-left: 0;
	}

	.analysis-controls-bar input[type="text"],
	.analysis-controls-bar select,
	.analysis-controls-bar .btn {
		height: 44px;
		font-size: 1rem;
	}
}

/* ── Print ── */

@media print {
	.analysis-controls-bar,
	.analysis-toast,
	.analysis-help-dialog,
	.analysis-status {
		display: none !important;
	}

	.chart-box {
		break-inside: avoid;
	}
}
