Files
Inventory-Manager-CC/web/client/src/components/AnalyticsPanel.css

719 lines
12 KiB
CSS

/* ============================================
Analytics Panel — Minecraft Dashboard
============================================ */
.analytics-panel {
height: 100%;
overflow-y: auto;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
/* ===== Hero Stats Row ===== */
.analytics-hero {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.hero-stat {
display: flex;
align-items: center;
gap: 0.625rem;
padding: 0.625rem 0.875rem;
background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
border: 2px solid #333;
border-radius: 2px;
flex: 1;
min-width: 120px;
position: relative;
overflow: hidden;
transition: border-color 0.2s, transform 0.15s;
}
.hero-stat::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 3px;
height: 100%;
}
.hero-stat--items::before { background: var(--mc-text-green); }
.hero-stat--types::before { background: var(--mc-text-aqua); }
.hero-stat--chests::before { background: var(--mc-text-gold); }
.hero-stat--furnaces::before { background: var(--mc-text-red); }
.hero-stat--recipes::before { background: var(--mc-text-light-purple); }
.hero-stat:hover {
border-color: #555;
transform: translateY(-1px);
}
.hero-stat-icon {
font-size: 1.25rem;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.hero-stat-content {
display: flex;
flex-direction: column;
gap: 0;
}
.hero-stat-value {
font-size: 1rem;
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 #000;
line-height: 1.2;
}
.hero-stat-label {
font-size: 0.45rem;
color: var(--mc-text-gray);
text-transform: uppercase;
letter-spacing: 0.08em;
font-weight: 700;
}
.hero-stat-delta {
font-size: 0.45rem;
font-weight: 700;
letter-spacing: 0.03em;
}
.hero-stat-delta.positive {
color: var(--mc-text-green);
}
.hero-stat-delta.negative {
color: var(--mc-text-red);
}
.hero-active {
color: var(--mc-text-green);
}
/* ===== Analytics Grid ===== */
.analytics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 0.75rem;
}
/* ===== Cards ===== */
.analytics-card {
padding: 0.875rem;
background: linear-gradient(180deg, #3b3b3b 0%, #333 100%);
border: 2px solid #444;
border-radius: 2px;
box-shadow:
inset 0 1px 0 #555,
inset 0 -1px 0 #2a2a2a,
0 4px 12px rgba(0, 0, 0, 0.4);
transition: border-color 0.2s, box-shadow 0.2s;
position: relative;
}
.analytics-card:hover {
border-color: #555;
box-shadow:
inset 0 1px 0 #555,
inset 0 -1px 0 #2a2a2a,
0 6px 20px rgba(0, 0, 0, 0.5);
}
.analytics-card-wide {
grid-column: 1 / -1;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.625rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid #444;
}
.card-header h3 {
font-size: 0.7rem;
color: var(--mc-text-gold);
font-weight: 700;
text-shadow: 1px 1px 0 var(--mc-dark);
text-transform: uppercase;
letter-spacing: 0.06em;
}
.card-badge {
font-size: 0.45rem;
color: var(--mc-text-gray);
background: #2a2a2a;
padding: 0.15rem 0.4rem;
border: 1px solid #444;
border-radius: 1px;
text-transform: uppercase;
letter-spacing: 0.04em;
}
/* ===== Chart Area ===== */
.chart-wrapper {
background: #2a2a2a;
border: 1px solid #333;
border-radius: 1px;
padding: 0.5rem 0.25rem 0.25rem;
}
/* ===== Multi-line Scrollable Chart ===== */
.multiline-chart-container {
position: relative;
width: 100%;
-webkit-user-select: none;
user-select: none;
}
.multiline-chart-container.dragging {
cursor: grabbing;
}
.multiline-chart-container:not(.dragging) {
cursor: crosshair;
}
/* Tooltip */
.chart-tooltip {
position: absolute;
background: #1a1a1acc;
border: 1px solid #555;
border-radius: 2px;
padding: 0.375rem 0.5rem;
pointer-events: none;
z-index: 30;
min-width: 100px;
-webkit-backdrop-filter: blur(4px);
backdrop-filter: blur(4px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}
.chart-tooltip-time {
font-size: 0.5rem;
color: var(--mc-text-gray);
font-weight: 700;
margin-bottom: 0.25rem;
text-transform: uppercase;
letter-spacing: 0.04em;
border-bottom: 1px solid #333;
padding-bottom: 0.2rem;
}
.chart-tooltip-row {
display: flex;
align-items: center;
gap: 0.3rem;
font-size: 0.5rem;
padding: 0.1rem 0;
}
.chart-tooltip-dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex-shrink: 0;
}
.chart-tooltip-name {
color: var(--mc-text-gray);
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 80px;
}
.chart-tooltip-val {
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 #000;
}
/* Scrollbar */
.chart-scrollbar {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.375rem 0 0.125rem;
}
.chart-scrollbar-track {
flex: 1;
height: 6px;
background: #222;
border: 1px solid #333;
border-radius: 3px;
position: relative;
overflow: hidden;
}
.chart-scrollbar-thumb {
position: absolute;
top: 0;
height: 100%;
background: linear-gradient(90deg, #555, #666);
border-radius: 3px;
transition: background 0.15s;
min-width: 12px;
}
.chart-scrollbar-thumb:hover,
.multiline-chart-container.dragging .chart-scrollbar-thumb {
background: linear-gradient(90deg, #777, #888);
}
.chart-scrollbar-hint {
font-size: 0.4rem;
color: #444;
text-transform: uppercase;
white-space: nowrap;
letter-spacing: 0.03em;
}
/* ===== Tracked Items Chips Bar ===== */
.tracked-items-bar {
display: flex;
flex-wrap: wrap;
gap: 0.375rem;
margin-bottom: 0.5rem;
}
.tracked-chip {
display: flex;
align-items: center;
gap: 0.25rem;
padding: 0.2rem 0.4rem;
background: #2a2a2a;
border: 1px solid #555;
border-radius: 2px;
font-size: 0.5rem;
color: var(--mc-text-white);
transition: border-color 0.15s, background 0.15s;
}
.tracked-chip:hover {
background: #333;
}
.tracked-chip-dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex-shrink: 0;
}
.tracked-chip-name {
max-width: 80px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tracked-chip-remove {
background: none;
border: none;
color: #666;
font-size: 0.55rem;
cursor: pointer;
padding: 0 0.15rem;
font-family: 'Silkscreen', monospace;
line-height: 1;
transition: color 0.15s;
}
.tracked-chip-remove:hover {
color: var(--mc-text-red);
}
.svg-chart {
display: block;
width: 100%;
height: auto;
}
.chart-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: var(--mc-text-gray);
font-size: 0.65rem;
gap: 0.375rem;
background: #222;
border: 1px dashed #444;
border-radius: 2px;
padding: 1.5rem;
min-height: 120px;
}
.chart-empty--compact {
min-height: 140px;
}
.chart-empty-icon {
font-size: 1.5rem;
opacity: 0.5;
margin-bottom: 0.25rem;
}
.chart-empty-sub {
font-size: 0.5rem;
color: #555;
}
/* ===== Storage Health Card ===== */
.analytics-card--overview {
display: flex;
flex-direction: column;
}
.overview-split {
display: flex;
align-items: center;
gap: 1rem;
}
.overview-stats-col {
display: flex;
flex-direction: column;
gap: 0.375rem;
flex: 1;
}
.mini-stat {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.375rem 0.5rem;
background: #2a2a2a;
border: 1px solid #333;
border-radius: 1px;
}
.mini-stat-label {
font-size: 0.5rem;
color: var(--mc-text-gray);
text-transform: uppercase;
font-weight: 700;
}
.mini-stat-value {
font-size: 0.7rem;
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 #000;
}
/* ===== Capacity Gauge ===== */
.capacity-gauge {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
}
.capacity-gauge svg {
filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
}
.capacity-gauge-detail {
font-size: 0.45rem;
color: var(--mc-text-gray);
text-transform: uppercase;
text-align: center;
}
/* ===== Category Donut ===== */
.analytics-card--categories {
display: flex;
flex-direction: column;
}
.donut-container {
display: flex;
align-items: center;
gap: 0.75rem;
}
.donut-chart {
flex-shrink: 0;
filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.donut-legend {
display: flex;
flex-direction: column;
gap: 0.25rem;
flex: 1;
min-width: 0;
}
.donut-legend-item {
display: flex;
align-items: center;
gap: 0.375rem;
font-size: 0.5rem;
padding: 0.2rem 0;
}
.donut-dot {
width: 8px;
height: 8px;
border-radius: 1px;
flex-shrink: 0;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}
.donut-legend-label {
color: var(--mc-text-gray);
flex: 1;
text-transform: uppercase;
font-weight: 700;
letter-spacing: 0.03em;
}
.donut-legend-value {
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 #000;
}
/* ===== Bar Chart ===== */
.bar-chart {
display: flex;
flex-direction: column;
gap: 0.3rem;
width: 100% !important;
}
.bar-row {
display: flex;
align-items: center;
gap: 0.375rem;
animation: bar-slide-in 0.4s ease both;
}
@keyframes bar-slide-in {
from {
opacity: 0;
transform: translateX(-8px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.bar-rank {
min-width: 24px;
text-align: center;
font-size: 0.75rem;
line-height: 1;
}
.bar-rank-num {
font-size: 0.5rem;
color: #555;
font-weight: 700;
}
.bar-label {
display: flex;
align-items: center;
gap: 0.3rem;
font-size: 0.5rem;
color: var(--mc-text-gray);
min-width: 90px;
max-width: 100px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.bar-label span {
overflow: hidden;
text-overflow: ellipsis;
}
.bar-track {
flex: 1;
height: 18px;
background: #222;
border: 1px solid #333;
border-radius: 1px;
overflow: hidden;
}
.bar-fill {
height: 100%;
transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
border-radius: 0 1px 1px 0;
box-shadow: 0 0 8px rgba(255, 170, 0, 0.15);
}
.bar-value {
font-size: 0.55rem;
color: var(--mc-text-white);
min-width: 32px;
text-align: right;
font-weight: 700;
text-shadow: 1px 1px 0 #000;
}
/* ===== Item History Search ===== */
.item-history-search {
position: relative;
margin-bottom: 0.625rem;
}
.search-input-wrapper {
position: relative;
display: flex;
align-items: center;
}
.search-icon {
position: absolute;
left: 0.5rem;
font-size: 0.65rem;
opacity: 0.5;
pointer-events: none;
}
.item-history-search .search-input {
width: 100%;
background: #222;
border: 2px solid #444;
color: var(--mc-text-white);
font-family: 'Silkscreen', 'Courier New', monospace;
font-size: 0.6rem;
padding: 0.5rem 0.5rem 0.5rem 1.75rem;
outline: none;
border-radius: 1px;
transition: border-color 0.2s, box-shadow 0.2s;
}
.item-history-search .search-input:focus {
border-color: var(--mc-text-aqua);
box-shadow: 0 0 8px rgba(85, 255, 255, 0.15);
}
.item-history-search .search-input::placeholder {
color: #555;
}
.item-history-dropdown {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: #222;
border: 2px solid #555;
border-top: none;
z-index: 50;
max-height: 200px;
overflow-y: auto;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}
.item-history-option {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.4rem 0.5rem;
cursor: pointer;
font-size: 0.55rem;
color: var(--mc-text-white);
transition: background 0.1s;
border-bottom: 1px solid #2a2a2a;
}
.item-history-option:last-child {
border-bottom: none;
}
.item-history-option:hover {
background: #3a3a3a;
}
.option-count {
margin-left: auto;
color: var(--mc-text-gray);
font-size: 0.45rem;
font-weight: 700;
}
.item-history-chart {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.item-history-label {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.7rem;
color: var(--mc-text-white);
font-weight: 700;
text-shadow: 1px 1px 0 var(--mc-dark);
padding: 0.375rem 0.5rem;
background: #2a2a2a;
border: 1px solid #333;
border-radius: 1px;
}
/* ===== Responsive ===== */
@media (max-width: 900px) {
.analytics-grid {
grid-template-columns: 1fr;
}
.analytics-hero {
flex-wrap: wrap;
}
.hero-stat {
min-width: 100px;
}
.overview-split {
flex-direction: column;
}
.donut-container {
flex-direction: column;
}
}
@media (max-width: 600px) {
.analytics-panel {
padding: 0.5rem;
}
.hero-stat {
min-width: 80px;
padding: 0.5rem;
}
.hero-stat-value {
font-size: 0.85rem;
}
.bar-label {
min-width: 70px;
max-width: 70px;
}
}