/**
 * Readability Analyzer - Rhythm Section
 *
 * Sentence rhythm visualization sidebar (mini bar graph).
 *
 * @package AgenticWP
 */

/* ============================================
   Rhythm Card
   ============================================ */

.results-rhythm-card {
	display: flex;
	flex-direction: column;
}

/* Rhythm Info Toggle */
.rhythm-info {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.875rem;
	color: var(--muted);
	background: var(--tool-bg-subtle);
	border-radius: 8px;
	line-height: 1.5;
	animation: fade-in 0.2s ease;
}

.rhythm-info[hidden] {
	display: none;
}

.rhythm-info p {
	margin: 0;
}

/* ============================================
   Rhythm Chart
   ============================================ */

.rhythm-chart {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 80px;
	padding: 0.5rem 0;
	margin-bottom: 1rem;
	overflow-x: auto;
	overflow-y: hidden;
}

/* Individual sentence bar */
.rhythm-bar {
	flex-shrink: 0;
	width: 8px;
	height: var(--bar-height, 4px);
	min-height: 4px;
	border-radius: 2px 2px 0 0;
	transition: height 0.3s ease, background 0.2s ease;
}

/* Sentence length categories */
.rhythm-bar.bar-short {
	background: var(--tool-success);
}

.rhythm-bar.bar-medium {
	background: var(--readability-accent-light);
}

.rhythm-bar.bar-long {
	background: var(--tool-warning);
}

/* Hover state */
.rhythm-bar:hover {
	filter: brightness(1.1);
}

/* Tooltip on hover */
.rhythm-bar {
	position: relative;
	cursor: pointer;
}

.rhythm-bar::after {
	content: attr(data-words) ' words';
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 0.6875rem;
	font-weight: 500;
	color: #fff;
	background: var(--ink);
	padding: 4px 8px;
	border-radius: 4px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	z-index: var(--tool-z-dropdown);
}

.rhythm-bar:hover::after {
	opacity: 1;
}

/* ============================================
   Rhythm Legend
   ============================================ */

.rhythm-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--line);
}

.rhythm-legend .legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.75rem;
	color: var(--muted);
}

.rhythm-legend .legend-item::before {
	content: '';
	width: 12px;
	height: 8px;
	border-radius: 2px;
}

.legend-short::before {
	background: var(--tool-success);
}

.legend-medium::before {
	background: var(--readability-accent-light);
}

.legend-long::before {
	background: var(--tool-warning);
}

/* ============================================
   Empty State
   ============================================ */

.rhythm-chart:empty::before {
	content: 'Sentence rhythm will appear here after analysis';
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
}
