glam/frontend/src/pages/NDEStatsPage.css
2025-12-07 23:08:02 +01:00

1856 lines
34 KiB
CSS

/**
* NDE Statistics Page Styles
* Following Netwerk Digitaal Erfgoed (NDE) house style
*/
/* Page Layout */
.nde-stats-page {
min-height: calc(100vh - 60px);
background: #f5f7fa;
}
/* Header */
.stats-header {
background: linear-gradient(135deg, #0a3dfa 0%, #1e50ff 100%);
color: white;
padding: 2rem 2rem;
box-shadow: 0 2px 8px rgba(10, 61, 250, 0.2);
}
.stats-header .header-content {
max-width: 1200px;
margin: 0 auto;
}
.stats-header h1 {
margin: 0 0 0.5rem 0;
font-size: 2rem;
font-weight: 700;
letter-spacing: -0.02em;
color: white;
}
.stats-header .subtitle {
margin: 0;
font-size: 1.1rem;
color: white;
}
/* Summary Section */
.summary-section {
max-width: 1200px;
margin: -1.5rem auto 0;
padding: 0 1.5rem;
position: relative;
z-index: 10;
}
.summary-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
}
.summary-card {
background: white;
border-radius: 12px;
padding: 1.5rem;
text-align: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.summary-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.card-value {
font-size: 2rem;
font-weight: 700;
color: #0a3dfa;
line-height: 1.2;
}
.card-label {
font-size: 0.875rem;
color: #6b7280;
margin-top: 0.5rem;
font-weight: 500;
}
.card-subtext {
font-size: 0.75rem;
color: #2ecc71;
margin-top: 0.25rem;
font-weight: 600;
}
/* Data Sources Row */
.summary-cards.data-sources-row {
margin-top: 1rem;
}
/* Accent color variants for data source cards */
.summary-card.accent-green .card-value {
color: #27ae60;
}
.summary-card.accent-teal .card-value {
color: #1abc9c;
}
.summary-card.accent-purple .card-value {
color: #9b59b6;
}
.summary-card.accent-orange .card-value {
color: #f39c12;
}
.summary-card.accent-blue .card-value {
color: #3498db;
}
.summary-card.accent-red .card-value {
color: #e74c3c;
}
.summary-card.accent-slate .card-value {
color: #64748b;
}
.summary-card.accent-amber .card-value {
color: #d97706;
}
.summary-card.accent-indigo .card-value {
color: #6366f1;
}
.summary-card.highlight {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.summary-card.highlight .card-value {
color: white;
}
.summary-card.highlight .card-label {
color: rgba(255, 255, 255, 0.9);
}
/* Overview stats content styling */
.overview-stats-content {
display: flex;
flex-direction: column;
gap: 1rem;
}
.overview-stats-content .summary-cards {
margin-bottom: 0;
}
/* Charts Section */
.charts-section {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1.5rem;
}
.charts-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
gap: 1.5rem;
}
/* Chart Container */
.chart-container {
background: white;
border-radius: 12px;
padding: 1.5rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.chart-container.wide {
grid-column: 1 / -1;
}
.chart-title {
margin: 0 0 1rem 0;
font-size: 1rem;
font-weight: 600;
color: #1f2937;
padding-bottom: 0.75rem;
border-bottom: 1px solid #e5e7eb;
}
/* Chart Legend */
.chart-legend {
display: flex;
flex-wrap: wrap;
gap: 0.5rem 1rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid #f3f4f6;
}
.legend-item {
display: flex;
align-items: center;
gap: 0.4rem;
font-size: 0.8rem;
}
.legend-color {
width: 12px;
height: 12px;
border-radius: 3px;
flex-shrink: 0;
}
.legend-label {
color: #4b5563;
}
.legend-value {
color: #9ca3af;
font-size: 0.75rem;
}
/* Timeline Section */
.timeline-section {
margin-top: 1.5rem;
}
.timeline-section .chart-container {
display: flex;
flex-direction: column;
align-items: center;
}
.timeline-section svg {
max-width: 100%;
}
/* Loading & Error States */
.loading-container,
.error-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 400px;
text-align: center;
padding: 2rem;
}
.loading-spinner {
width: 48px;
height: 48px;
border: 4px solid #e1e5eb;
border-top-color: #0a3dfa;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.loading-container p {
margin-top: 1rem;
color: #6b7280;
font-size: 1rem;
}
.error-container h2 {
color: #dc2626;
margin: 0 0 0.5rem 0;
}
.error-container p {
color: #6b7280;
margin: 0 0 1rem 0;
}
.error-hint {
background: #f3f4f6;
padding: 1rem;
border-radius: 8px;
font-size: 0.875rem;
}
.error-hint code {
display: block;
margin-top: 0.5rem;
padding: 0.5rem;
background: #1f2937;
color: #10b981;
border-radius: 4px;
font-family: 'Fira Code', 'Consolas', monospace;
font-size: 0.8rem;
}
/* Footer */
.stats-footer {
max-width: 1200px;
margin: 2rem auto;
padding: 1.5rem;
text-align: center;
border-top: 1px solid #e5e7eb;
}
.stats-footer p {
margin: 0.25rem 0;
font-size: 0.85rem;
color: #9ca3af;
}
/* ========================================
RESPONSIVE DESIGN - Mobile First
======================================== */
/* Large tablets and small desktops */
@media (max-width: 1024px) {
.charts-grid {
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.chart-container svg {
max-width: 100%;
height: auto;
}
}
/* Tablets */
@media (max-width: 768px) {
.stats-header {
padding: 1.5rem 1rem;
}
.stats-header h1 {
font-size: 1.5rem;
}
.stats-header .subtitle {
font-size: 0.95rem;
}
.summary-section {
padding: 0 1rem;
margin-top: -1rem;
}
.summary-cards {
grid-template-columns: repeat(3, 1fr);
gap: 0.75rem;
}
.summary-card {
padding: 1rem;
}
.charts-section {
padding: 0 1rem;
margin: 1.5rem auto;
}
.charts-grid {
grid-template-columns: 1fr;
gap: 1rem;
}
.chart-container {
padding: 1rem;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}
/* SVGs adapt to container width on mobile */
.chart-container svg {
min-width: 100%;
width: 100%;
height: auto;
display: block;
}
/* For charts that truly need horizontal scroll, allow it */
.chart-container.scrollable svg {
min-width: max-content;
width: auto;
}
.card-value {
font-size: 1.5rem;
}
.card-label {
font-size: 0.75rem;
}
/* Global filter bar on mobile */
.global-filter-bar {
margin: 0.75rem 1rem 0;
padding: 0.6rem 1rem;
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.global-filter-bar .clear-all-btn {
margin-left: 0;
margin-top: 0.5rem;
width: 100%;
text-align: center;
}
/* Scatter plot filter chips */
.scatter-type-filter {
justify-content: center;
}
.filter-chip {
padding: 0.25rem 0.5rem;
font-size: 0.65rem;
}
/* Province cartogram filter buttons */
.province-cartogram .type-filter {
justify-content: center;
}
.province-cartogram .filter-btn {
padding: 0.3rem 0.5rem;
font-size: 0.7rem;
}
/* Chart legends on mobile */
.chart-legend {
justify-content: center;
}
.bubble-legend {
justify-content: center;
}
/* Collapsible sections */
.chart-container.collapsible .chart-header {
padding: 0.75rem 1rem;
}
.chart-container.collapsible .chart-header .chart-title {
font-size: 0.9rem;
}
/* Export buttons always visible on touch devices */
.export-buttons {
opacity: 1;
}
}
/* Small phones */
@media (max-width: 480px) {
.stats-header {
padding: 1.25rem 0.75rem;
}
.stats-header h1 {
font-size: 1.25rem;
}
.stats-header .subtitle {
font-size: 0.85rem;
}
.summary-section {
padding: 0 0.75rem;
margin-top: -0.75rem;
}
.summary-cards {
grid-template-columns: repeat(2, 1fr);
gap: 0.5rem;
}
.summary-card {
padding: 0.75rem;
border-radius: 8px;
}
.card-value {
font-size: 1.25rem;
}
.card-label {
font-size: 0.7rem;
}
.card-subtext {
font-size: 0.65rem;
}
.charts-section {
padding: 0 0.75rem;
margin: 1rem auto;
}
.charts-grid {
gap: 0.75rem;
}
.chart-container {
padding: 0.75rem;
border-radius: 8px;
}
.chart-title {
font-size: 0.9rem;
padding-bottom: 0.5rem;
margin-bottom: 0.75rem;
}
/* SVGs adapt to container width on very small screens */
.chart-container svg {
min-width: 100%;
width: 100%;
height: auto;
}
/* Sunburst breadcrumb */
.sunburst-breadcrumb {
font-size: 0.75rem;
}
/* Scatter stats */
.scatter-stats {
font-size: 0.7rem;
text-align: center;
}
/* Selection info */
.scatter-selection-info {
top: 45px;
right: 10px;
padding: 0.3rem 0.5rem;
font-size: 0.7rem;
}
/* Stacked bar hover info */
.stacked-hover-info {
font-size: 0.75rem;
padding: 0.4rem 0.75rem;
}
/* Province tooltip */
.province-cartogram .province-tooltip {
font-size: 0.75rem;
padding: 0.4rem 0.75rem;
gap: 0.5rem;
}
/* Legend items */
.legend-item {
font-size: 0.7rem;
}
.legend-color {
width: 10px;
height: 10px;
}
/* Global filter bar */
.global-filter-bar {
margin: 0.5rem 0.75rem 0;
padding: 0.5rem 0.75rem;
border-radius: 6px;
}
.global-filter-bar .filter-label {
font-size: 0.75rem;
}
.active-filter-tag {
font-size: 0.7rem;
padding: 0.2rem 0.5rem;
}
/* Footer */
.stats-footer {
padding: 1rem 0.75rem;
margin: 1rem auto;
}
.stats-footer p {
font-size: 0.75rem;
}
}
/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
.summary-cards {
grid-template-columns: repeat(6, 1fr);
}
.summary-card {
padding: 0.75rem 0.5rem;
}
.card-value {
font-size: 1.25rem;
}
.card-label {
font-size: 0.65rem;
}
.charts-grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
/* Larger touch targets */
.filter-chip {
min-height: 36px;
min-width: 36px;
display: flex;
align-items: center;
justify-content: center;
}
.province-cartogram .filter-btn {
min-height: 36px;
min-width: 36px;
}
.export-btn {
min-height: 32px;
padding: 0.4rem 0.6rem;
}
.active-filter-tag .remove-filter {
min-width: 24px;
min-height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
/* Always show export buttons on touch */
.export-buttons {
opacity: 1;
}
/* Disable hover effects that don't work on touch */
.summary-card:hover {
transform: none;
}
.filter-chip:hover {
transform: none;
}
}
/* SVG Styling */
.chart-container svg {
display: block;
margin: 0 auto;
}
.chart-container .tick text {
font-family: inherit;
fill: #6b7280;
}
.chart-container .domain {
stroke: #e5e7eb;
}
.chart-container .tick line {
stroke: #e5e7eb;
}
/* Tooltip (for future use) */
.chart-tooltip {
position: absolute;
padding: 0.5rem 0.75rem;
background: rgba(31, 41, 55, 0.95);
color: white;
border-radius: 6px;
font-size: 0.8rem;
pointer-events: none;
z-index: 100;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.chart-tooltip::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 6px solid transparent;
border-top-color: rgba(31, 41, 55, 0.95);
}
/* Province Cartogram */
.province-cartogram {
position: relative;
}
.province-cartogram .type-filter {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin-bottom: 1rem;
padding: 0 0.5rem;
}
.province-cartogram .filter-btn {
padding: 0.35rem 0.65rem;
font-size: 0.75rem;
font-weight: 600;
border: 2px solid #e5e7eb;
border-radius: 6px;
background: #fff;
color: #374151;
cursor: pointer;
transition: all 0.15s ease;
}
.province-cartogram .filter-btn:hover {
border-color: #0a3dfa;
color: #0a3dfa;
}
.province-cartogram .filter-btn.active {
background: #0a3dfa;
border-color: #0a3dfa;
color: #fff;
}
.province-cartogram .province-tooltip {
position: absolute;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
background: rgba(31, 41, 55, 0.95);
color: #fff;
padding: 0.5rem 1rem;
border-radius: 8px;
font-size: 0.85rem;
display: flex;
gap: 0.75rem;
align-items: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.province-cartogram .tooltip-count {
color: rgba(255, 255, 255, 0.8);
font-size: 0.8rem;
}
.province-cartogram .tooltip-type {
color: rgba(255, 255, 255, 0.6);
font-size: 0.75rem;
font-style: italic;
}
/* Province map path styling */
.province-cartogram .province {
transition: fill 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease;
}
.province-cartogram .province:hover {
filter: brightness(0.9);
}
.province-cartogram .province-label,
.province-cartogram .count-label {
text-shadow: 0 0 3px rgba(255,255,255,0.5), 0 0 6px rgba(255,255,255,0.3);
}
/* Collapsible Chart Sections */
.chart-container.collapsible {
border: 1px solid #e5e7eb;
border-radius: 12px;
overflow: hidden;
}
.chart-container.collapsible .chart-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
background: #f9fafb;
cursor: pointer;
user-select: none;
transition: background 0.15s ease;
}
.chart-container.collapsible .chart-header:hover {
background: #f3f4f6;
}
.chart-container.collapsible .chart-header .chart-title {
margin: 0;
font-size: 1rem;
}
.chart-container.collapsible .collapse-icon {
font-size: 1.25rem;
color: #6b7280;
transition: transform 0.2s ease;
}
.chart-container.collapsible.collapsed .collapse-icon {
transform: rotate(-90deg);
}
.chart-container.collapsible .chart-content {
padding: 1rem;
transition: max-height 0.3s ease, opacity 0.2s ease;
overflow: hidden;
}
.chart-container.collapsible.collapsed .chart-content {
max-height: 0;
padding: 0 1rem;
opacity: 0;
}
/* Bubble Chart */
.bubble-legend {
display: flex;
flex-wrap: wrap;
gap: 0.5rem 1rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid #f3f4f6;
}
.bubble-tooltip {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* Sunburst Chart */
.sunburst-breadcrumb {
text-align: center;
font-size: 0.85rem;
color: #6b7280;
margin-bottom: 0.5rem;
min-height: 1.2em;
font-weight: 500;
}
/* Rating Histogram specific styling */
.chart-container svg .bar {
transition: opacity 0.15s ease;
}
/* Scatter Plot */
.scatter-plot {
position: relative;
overflow: hidden;
}
.scatter-type-filter {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin-bottom: 0.75rem;
padding: 0 0.5rem;
}
.filter-chip {
padding: 0.3rem 0.6rem;
font-size: 0.7rem;
font-weight: 600;
border: 2px solid;
border-radius: 20px;
background: transparent;
cursor: pointer;
transition: all 0.15s ease;
}
.filter-chip:hover {
transform: scale(1.05);
}
.filter-chip.active {
color: #fff !important;
}
.filter-chip.clear {
border-color: #ef4444;
color: #ef4444;
background: transparent;
}
.filter-chip.clear:hover {
background: #ef4444;
color: #fff;
}
.scatter-selection-info {
position: absolute;
top: 60px;
right: 15px;
background: rgba(10, 61, 250, 0.9);
color: #fff;
padding: 0.4rem 0.75rem;
border-radius: 6px;
font-size: 0.8rem;
font-weight: 500;
}
.scatter-stats {
margin-top: 0.5rem;
padding: 0 0.5rem;
font-size: 0.8rem;
color: #6b7280;
}
.scatter-tooltip {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
/* Stacked Bar Chart */
.stacked-hover-info {
position: absolute;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
background: rgba(31, 41, 55, 0.95);
color: #fff;
padding: 0.5rem 1rem;
border-radius: 8px;
font-size: 0.85rem;
white-space: nowrap;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* Export Buttons */
.chart-container {
position: relative;
}
.export-buttons {
position: absolute;
top: 0.75rem;
right: 0.75rem;
display: flex;
gap: 0.3rem;
opacity: 0;
transition: opacity 0.2s ease;
}
.chart-container:hover .export-buttons {
opacity: 1;
}
.export-btn {
padding: 0.3rem 0.5rem;
font-size: 0.7rem;
background: #f3f4f6;
border: 1px solid #e5e7eb;
border-radius: 4px;
cursor: pointer;
transition: all 0.15s ease;
color: #374151;
}
.export-btn:hover {
background: #e5e7eb;
border-color: #d1d5db;
}
/* Global Filter Bar */
.global-filter-bar {
max-width: 1200px;
margin: 1rem auto 0;
padding: 0.75rem 1.5rem;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
display: flex;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
}
.global-filter-bar .filter-label {
font-size: 0.85rem;
font-weight: 600;
color: #374151;
}
.global-filter-bar .filter-chips {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
}
.global-filter-bar .clear-all-btn {
margin-left: auto;
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
background: #f3f4f6;
border: 1px solid #e5e7eb;
border-radius: 6px;
cursor: pointer;
color: #6b7280;
transition: all 0.15s ease;
}
.global-filter-bar .clear-all-btn:hover {
background: #ef4444;
border-color: #ef4444;
color: #fff;
}
/* Active filter indicators */
.active-filters {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.active-filter-tag {
display: flex;
align-items: center;
gap: 0.3rem;
padding: 0.25rem 0.6rem;
background: #0a3dfa;
color: #fff;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 500;
animation: tagSlideIn 0.2s ease-out;
}
.active-filter-tag .remove-filter {
background: none;
border: none;
color: rgba(255, 255, 255, 0.8);
cursor: pointer;
padding: 0;
font-size: 1rem;
line-height: 1;
transition: color 0.15s ease, transform 0.15s ease;
}
.active-filter-tag .remove-filter:hover {
color: #fff;
transform: scale(1.2);
}
/* ========================================
ANIMATIONS & TRANSITIONS
======================================== */
/* Keyframe Animations */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes tagSlideIn {
from {
opacity: 0;
transform: translateX(-10px) scale(0.8);
}
to {
opacity: 1;
transform: translateX(0) scale(1);
}
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
@keyframes shimmer {
0% {
background-position: -200% 0;
}
100% {
background-position: 200% 0;
}
}
/* Chart Container Animations */
.chart-container {
animation: fadeInUp 0.4s ease-out;
animation-fill-mode: both;
}
.charts-grid .chart-container:nth-child(1) { animation-delay: 0.05s; }
.charts-grid .chart-container:nth-child(2) { animation-delay: 0.1s; }
.charts-grid .chart-container:nth-child(3) { animation-delay: 0.15s; }
.charts-grid .chart-container:nth-child(4) { animation-delay: 0.2s; }
.charts-grid .chart-container:nth-child(5) { animation-delay: 0.25s; }
.charts-grid .chart-container:nth-child(6) { animation-delay: 0.3s; }
.charts-grid .chart-container:nth-child(7) { animation-delay: 0.35s; }
.charts-grid .chart-container:nth-child(8) { animation-delay: 0.4s; }
.charts-grid .chart-container:nth-child(9) { animation-delay: 0.45s; }
.charts-grid .chart-container:nth-child(10) { animation-delay: 0.5s; }
.charts-grid .chart-container:nth-child(11) { animation-delay: 0.55s; }
.charts-grid .chart-container:nth-child(12) { animation-delay: 0.6s; }
/* Summary Card Animations */
.summary-card {
animation: fadeInUp 0.3s ease-out;
animation-fill-mode: both;
}
.summary-cards .summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-cards .summary-card:nth-child(2) { animation-delay: 0.15s; }
.summary-cards .summary-card:nth-child(3) { animation-delay: 0.2s; }
.summary-cards .summary-card:nth-child(4) { animation-delay: 0.25s; }
.summary-cards .summary-card:nth-child(5) { animation-delay: 0.3s; }
.summary-cards .summary-card:nth-child(6) { animation-delay: 0.35s; }
/* Global Filter Bar Animation */
.global-filter-bar {
animation: fadeInDown 0.3s ease-out;
}
/* Filter Chip Transitions */
.filter-chip {
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-chip:active {
transform: scale(0.95);
}
.filter-chip.active {
animation: scaleIn 0.15s ease-out;
}
/* Province Map Path Transitions */
.province-cartogram .province {
transition: fill 0.25s ease, stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}
.province-cartogram .province.selected {
animation: pulse 1.5s ease-in-out infinite;
}
/* Scatter Plot Point Transitions */
.scatter-plot circle {
transition: opacity 0.3s ease, r 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}
.scatter-plot circle:hover {
transition: r 0.15s ease, stroke-width 0.15s ease;
}
/* Stacked Bar Transitions */
.stacked-bar-chart rect {
transition: opacity 0.3s ease, stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}
.stacked-bar-chart rect:hover {
filter: brightness(1.1);
}
/* Sunburst Path Transitions */
.sunburst-chart path {
transition: opacity 0.3s ease, filter 0.2s ease;
}
/* Tooltip Animations */
.chart-tooltip,
.scatter-tooltip,
.bubble-tooltip {
animation: fadeIn 0.15s ease-out;
}
/* Selection Info Animation */
.scatter-selection-info {
animation: fadeInDown 0.2s ease-out;
}
/* Hover Info Animation */
.stacked-hover-info,
.province-cartogram .province-tooltip {
animation: fadeIn 0.15s ease-out;
}
/* Collapsible Section Transitions */
.chart-container.collapsible .chart-content {
transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.25s ease,
padding 0.35s ease;
}
.chart-container.collapsible .collapse-icon {
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Export Button Transitions */
.export-buttons {
transition: opacity 0.2s ease, transform 0.2s ease;
}
.chart-container:hover .export-buttons {
transform: translateY(0);
}
.export-btn {
transition: all 0.15s ease;
}
.export-btn:active {
transform: scale(0.95);
}
/* Legend Item Transitions */
.legend-item {
transition: opacity 0.2s ease;
}
.legend-item:hover {
opacity: 0.8;
}
/* Donut/Pie Chart Path Transitions */
.chart-container svg path[fill] {
transition: opacity 0.3s ease, filter 0.2s ease;
}
/* Bar Chart Bar Transitions */
.chart-container svg rect.bar {
transition: opacity 0.3s ease, fill 0.2s ease;
}
/* Histogram Bar Transitions */
.rating-histogram rect {
transition: opacity 0.3s ease, fill 0.2s ease;
}
/* Bubble Chart Transitions */
.bubble-chart circle {
transition: opacity 0.3s ease, r 0.2s ease, stroke 0.2s ease;
}
/* Loading State Animation */
.loading-container {
animation: fadeIn 0.3s ease-out;
}
.loading-spinner {
animation: spin 0.8s linear infinite;
}
/* Skeleton Loading Animation (for future use) */
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.loading-spinner {
animation: spin 2s linear infinite;
}
}
/* Chart Update Transitions - for D3 managed elements */
.chart-updating {
opacity: 0.7;
transition: opacity 0.2s ease;
}
.chart-updated {
opacity: 1;
transition: opacity 0.3s ease;
}
/* Focus States for Accessibility */
.filter-chip:focus-visible,
.filter-btn:focus-visible,
.export-btn:focus-visible,
.clear-all-btn:focus-visible {
outline: 2px solid #0a3dfa;
outline-offset: 2px;
}
/* Interactive Element Cursor Styles */
.province-cartogram .province {
cursor: pointer;
}
.sunburst-chart path {
cursor: pointer;
}
.stacked-bar-chart rect {
cursor: pointer;
}
.scatter-plot circle {
cursor: pointer;
}
/* Double-click Hint Styles */
.chart-hint {
text-align: center;
font-size: 0.75rem;
color: #9ca3af;
margin-top: 0.75rem;
padding-top: 0.5rem;
border-top: 1px solid #f3f4f6;
}
.dblclick-hint {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.3rem 0.6rem;
background: #f9fafb;
border-radius: 4px;
font-style: italic;
}
.dblclick-hint::before {
content: '🖱️';
font-style: normal;
}
/* Make hint more visible on hover */
.chart-container:hover .chart-hint {
color: #6b7280;
}
.chart-container:hover .dblclick-hint {
background: #e5e7eb;
}
/* Responsive: hide hint on touch devices since double-tap is awkward */
@media (hover: none) and (pointer: coarse) {
.chart-hint {
display: none;
}
}
/* Small screens: smaller hint text */
@media (max-width: 480px) {
.chart-hint {
font-size: 0.65rem;
margin-top: 0.5rem;
}
.dblclick-hint {
padding: 0.2rem 0.4rem;
}
}
/* Certainty Chart Details */
.certainty-details {
margin-top: 1rem;
padding: 1rem;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #e5e7eb;
}
.certainty-details h4 {
margin: 0 0 0.75rem 0;
font-size: 0.9rem;
font-weight: 600;
color: #374151;
}
.certainty-entries {
display: flex;
flex-direction: column;
gap: 0.5rem;
max-height: 300px;
overflow-y: auto;
}
.certainty-entry {
padding: 0.5rem 0.75rem;
background: white;
border-radius: 6px;
border: 1px solid #e5e7eb;
transition: all 0.15s ease;
}
.certainty-entry:hover {
border-color: #0a3dfa;
box-shadow: 0 2px 4px rgba(10, 61, 250, 0.1);
}
.certainty-entry .entry-name {
font-weight: 500;
font-size: 0.85rem;
color: #1f2937;
margin-bottom: 0.25rem;
}
.certainty-entry .entry-details {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
font-size: 0.75rem;
color: #6b7280;
}
.certainty-entry .entry-city {
color: #374151;
}
.certainty-entry .entry-confidence {
padding: 0.125rem 0.375rem;
background: #fef3c7;
border-radius: 4px;
color: #92400e;
font-weight: 500;
}
.certainty-entry .entry-reason {
color: #dc2626;
font-style: italic;
}
.tooltip-fixed {
position: absolute;
top: 40px;
right: 20px;
padding: 0.5rem 0.75rem;
background: rgba(0, 0, 0, 0.8);
color: white;
border-radius: 4px;
font-size: 0.8rem;
z-index: 100;
pointer-events: none;
}
/* ============================================
DARK MODE STYLES
============================================ */
[data-theme="dark"] .nde-stats-page {
background: #1a1a2e;
}
/* Header */
[data-theme="dark"] .stats-header {
background: linear-gradient(135deg, #1e3a6e 0%, #2a4d8e 100%);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* Summary Cards */
[data-theme="dark"] .summary-card {
background: #252542;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .summary-card:hover {
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .card-value {
color: #6b9aff;
}
[data-theme="dark"] .card-label {
color: #a0a0b0;
}
[data-theme="dark"] .card-subtext {
color: #2ecc71;
}
/* Accent color variants for dark mode */
[data-theme="dark"] .summary-card.accent-green .card-value {
color: #2ecc71;
}
[data-theme="dark"] .summary-card.accent-teal .card-value {
color: #1abc9c;
}
[data-theme="dark"] .summary-card.accent-purple .card-value {
color: #a855f7;
}
[data-theme="dark"] .summary-card.accent-orange .card-value {
color: #f59e0b;
}
[data-theme="dark"] .summary-card.accent-blue .card-value {
color: #3b82f6;
}
[data-theme="dark"] .summary-card.accent-red .card-value {
color: #ef4444;
}
[data-theme="dark"] .summary-card.accent-slate .card-value {
color: #94a3b8;
}
[data-theme="dark"] .summary-card.accent-amber .card-value {
color: #fbbf24;
}
[data-theme="dark"] .summary-card.accent-indigo .card-value {
color: #818cf8;
}
[data-theme="dark"] .summary-card.highlight {
background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}
/* Chart Container */
[data-theme="dark"] .chart-container {
background: #252542;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .chart-title {
color: #e0e0e0;
border-bottom-color: #3d3d5c;
}
/* Chart Legend */
[data-theme="dark"] .chart-legend {
border-top-color: #3d3d5c;
}
[data-theme="dark"] .legend-label {
color: #a0a0b0;
}
[data-theme="dark"] .legend-value {
color: #6b7280;
}
/* Loading & Error States */
[data-theme="dark"] .loading-container,
[data-theme="dark"] .error-container {
color: #e0e0e0;
}
[data-theme="dark"] .loading-spinner {
border-color: #3d3d5c;
border-top-color: #4a7dff;
}
[data-theme="dark"] .loading-container p {
color: #a0a0b0;
}
[data-theme="dark"] .error-container h2 {
color: #ff6b7a;
}
[data-theme="dark"] .error-container p {
color: #a0a0b0;
}
[data-theme="dark"] .error-hint {
background: #1e1e32;
}
[data-theme="dark"] .error-hint code {
background: #0d0d1a;
color: #10b981;
}
/* Footer */
[data-theme="dark"] .stats-footer {
border-top-color: #3d3d5c;
}
[data-theme="dark"] .stats-footer p {
color: #6b7280;
}
/* SVG Styling */
[data-theme="dark"] .chart-container .tick text {
fill: #a0a0b0;
}
[data-theme="dark"] .chart-container .domain {
stroke: #3d3d5c;
}
[data-theme="dark"] .chart-container .tick line {
stroke: #3d3d5c;
}
/* Tooltip */
[data-theme="dark"] .chart-tooltip {
background: rgba(37, 37, 66, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .chart-tooltip::after {
border-top-color: rgba(37, 37, 66, 0.95);
}
/* Province Cartogram */
[data-theme="dark"] .province-cartogram .type-filter {
background: transparent;
}
[data-theme="dark"] .province-cartogram .filter-btn {
border-color: #3d3d5c;
background: #1e1e32;
color: #e0e0e0;
}
[data-theme="dark"] .province-cartogram .filter-btn:hover {
border-color: #4a7dff;
color: #4a7dff;
}
[data-theme="dark"] .province-cartogram .filter-btn.active {
background: #4a7dff;
border-color: #4a7dff;
color: #fff;
}
[data-theme="dark"] .province-cartogram .province-tooltip {
background: rgba(37, 37, 66, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
/* Collapsible Chart Sections */
[data-theme="dark"] .chart-container.collapsible {
border-color: #3d3d5c;
}
[data-theme="dark"] .chart-container.collapsible .chart-header {
background: #1e1e32;
}
[data-theme="dark"] .chart-container.collapsible .chart-header:hover {
background: #2d2d4a;
}
[data-theme="dark"] .chart-container.collapsible .collapse-icon {
color: #a0a0b0;
}
/* Bubble Chart */
[data-theme="dark"] .bubble-legend {
border-top-color: #3d3d5c;
}
/* Sunburst Chart */
[data-theme="dark"] .sunburst-breadcrumb {
color: #a0a0b0;
}
/* Scatter Plot */
[data-theme="dark"] .scatter-type-filter {
background: transparent;
}
[data-theme="dark"] .filter-chip {
background: #1e1e32;
}
[data-theme="dark"] .filter-chip.clear {
border-color: #ef4444;
color: #ef4444;
}
[data-theme="dark"] .filter-chip.clear:hover {
background: #ef4444;
color: #fff;
}
[data-theme="dark"] .scatter-selection-info {
background: rgba(74, 125, 255, 0.9);
}
[data-theme="dark"] .scatter-stats {
color: #a0a0b0;
}
/* Stacked Bar Chart */
[data-theme="dark"] .stacked-hover-info {
background: rgba(37, 37, 66, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
/* Export Buttons */
[data-theme="dark"] .export-btn {
background: #1e1e32;
border-color: #3d3d5c;
color: #e0e0e0;
}
[data-theme="dark"] .export-btn:hover {
background: #2d2d4a;
border-color: #4d4d6c;
}
/* Global Filter Bar */
[data-theme="dark"] .global-filter-bar {
background: #252542;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .global-filter-bar .filter-label {
color: #e0e0e0;
}
[data-theme="dark"] .global-filter-bar .clear-all-btn {
background: #1e1e32;
border-color: #3d3d5c;
color: #a0a0b0;
}
[data-theme="dark"] .global-filter-bar .clear-all-btn:hover {
background: #ef4444;
border-color: #ef4444;
color: #fff;
}
/* Active filter indicators */
[data-theme="dark"] .active-filter-tag {
background: #4a7dff;
}
/* Focus States for Accessibility */
[data-theme="dark"] .filter-chip:focus-visible,
[data-theme="dark"] .filter-btn:focus-visible,
[data-theme="dark"] .export-btn:focus-visible,
[data-theme="dark"] .clear-all-btn:focus-visible {
outline-color: #6b9aff;
}
/* Chart Hints */
[data-theme="dark"] .chart-hint {
color: #6b7280;
border-top-color: #3d3d5c;
}
[data-theme="dark"] .dblclick-hint {
background: #1e1e32;
}
[data-theme="dark"] .chart-container:hover .chart-hint {
color: #a0a0b0;
}
[data-theme="dark"] .chart-container:hover .dblclick-hint {
background: #2d2d4a;
}
/* Certainty Chart Details */
[data-theme="dark"] .certainty-details {
background: #1e1e32;
border-color: #3d3d5c;
}
[data-theme="dark"] .certainty-details h4 {
color: #e0e0e0;
}
[data-theme="dark"] .certainty-entry {
background: #252542;
border-color: #3d3d5c;
}
[data-theme="dark"] .certainty-entry:hover {
border-color: #4a7dff;
box-shadow: 0 2px 4px rgba(74, 125, 255, 0.2);
}
[data-theme="dark"] .certainty-entry .entry-name {
color: #e0e0e0;
}
[data-theme="dark"] .certainty-entry .entry-details {
color: #a0a0b0;
}
[data-theme="dark"] .certainty-entry .entry-city {
color: #c0c0d0;
}
[data-theme="dark"] .certainty-entry .entry-confidence {
background: #3d3520;
color: #fbbf24;
}
[data-theme="dark"] .certainty-entry .entry-reason {
color: #ff6b7a;
}
[data-theme="dark"] .tooltip-fixed {
background: rgba(37, 37, 66, 0.95);
}
/* Skeleton Loading Animation */
[data-theme="dark"] .skeleton {
background: linear-gradient(90deg, #252542 25%, #3d3d5c 50%, #252542 75%);
}