introducing tooltips
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 59s

This commit is contained in:
Tudor
2026-01-09 15:10:39 +00:00
parent 79cf16d6b3
commit c63e0e2682
2 changed files with 448 additions and 22 deletions

View File

@@ -1389,10 +1389,135 @@ body {
margin: 1rem;
max-height: calc(100vh - 2rem);
}
.rankings-controls {
flex-direction: column;
align-items: stretch;
}
}
/* =============================================================================
TOOLTIP SYSTEM
============================================================================= */
/* Info Icon Trigger */
.info-trigger {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
margin-left: 0.25rem;
background: none;
border: none;
cursor: help;
color: var(--text-muted);
opacity: 0.6;
transition: var(--transition);
vertical-align: middle;
border-radius: 50%;
}
.info-trigger:hover,
.info-trigger:focus {
color: var(--accent-teal);
opacity: 1;
}
.info-trigger:focus {
outline: none;
box-shadow: 0 0 0 2px var(--accent-teal);
}
.info-trigger:focus:not(:focus-visible) {
box-shadow: none;
}
.info-trigger:focus-visible {
box-shadow: 0 0 0 2px var(--accent-teal);
}
/* Info Icon SVG */
.info-icon {
width: 12px;
height: 12px;
flex-shrink: 0;
}
.modal-stat-label .info-icon {
width: 14px;
height: 14px;
}
/* Tooltip Container */
.tooltip {
position: absolute;
z-index: 3000;
min-width: 200px;
max-width: 280px;
padding: 0.75rem 1rem;
background: var(--bg-accent);
color: var(--text-inverse);
border-radius: var(--radius-md);
box-shadow: var(--shadow-medium);
font-family: 'DM Sans', sans-serif;
font-size: 0.8125rem;
line-height: 1.5;
text-transform: none;
letter-spacing: normal;
text-align: left;
opacity: 0;
visibility: hidden;
transition: opacity 150ms ease, visibility 150ms ease;
pointer-events: none;
}
.tooltip.visible {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
/* Tooltip Arrow - Top Placement (arrow points down) */
.tooltip[data-placement="top"]::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 8px solid transparent;
border-top-color: var(--bg-accent);
}
/* Tooltip Arrow - Bottom Placement (arrow points up) */
.tooltip[data-placement="bottom"]::after {
content: '';
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
border: 8px solid transparent;
border-bottom-color: var(--bg-accent);
}
/* Tooltip Title */
.tooltip-title {
font-weight: 600;
margin-bottom: 0.25rem;
font-size: 0.875rem;
}
/* Tooltip Note (for context like national average) */
.tooltip-note {
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px solid rgba(250, 247, 242, 0.2);
font-size: 0.75rem;
opacity: 0.8;
}
/* Label wrapper for inline icon */
.stat-label-with-info {
display: inline-flex;
align-items: center;
justify-content: center;
}