body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* Glass Card Effect */
.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Connection Indicator */
.connection-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-indicator.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.connection-indicator.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.green {
    background: #22c55e;
}

.status-dot.red {
    background: #ef4444;
}

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

/* Floating message counter */
.floating-stats {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 1000;
    min-width: 180px;
}

.floating-stats-title {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.floating-stats-value {
    font-size: 28px;
    font-weight: bold;
    color: #06b6d4;
    line-height: 1;
}

.floating-stats-time {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 15px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Cell Display */
.cell-item {
    background: rgba(51, 65, 85, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    height: auto;
}

.cell-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cell-normal {
    border-left: 3px solid #22c55e;
}

.cell-warning {
    border-left: 3px solid #eab308;
    background: rgba(234, 179, 8, 0.1);
}

.cell-danger {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.cell-label {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.cell-value {
    font-weight: 700;
    font-size: 0.8rem;
    color: #ffffff;
}

/* Collapsible Section */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapse-icon {
    transition: transform 0.3s;
    font-size: 1.5rem;
    color: #94a3b8;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Segment Stats */
.segment-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.segment-stat {
    display: inline-block;
    margin-right: 20px;
    font-size: 0.875rem;
}

.segment-stat-label {
    color: #94a3b8;
    margin-right: 4px;
}

.segment-stat-value {
    font-weight: 700;
}

/* Temperature Colors */
.temp-cold {
    color: #22c55e;
}

.temp-warm {
    color: #eab308;
}

.temp-hot {
    color: #ef4444;
}

/* Accumulator Overview Stats */
.stat-card {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #3b82f6;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stat-subtext {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 8px;
}

.stat-mini {
    font-size: 0.7rem;
    color: #cbd5e1;
    margin-top: 4px;
}

/* Segment Overview */
.segment-overview-card {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.segment-overview-voltage-section,
.segment-overview-temp-section {
    cursor: pointer;
    padding: 8px;
    margin: -8px -8px 4px -8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.segment-overview-voltage-section:hover {
    background: rgba(139, 92, 246, 0.1);
}

.segment-overview-temp-section {
    margin: 4px -8px -8px -8px;
}

.segment-overview-temp-section:hover {
    background: rgba(251, 146, 60, 0.1);
}

.segment-overview-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
}

.segment-overview-stats {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
}

.segment-overview-stat {
    flex: 1;
}

.segment-overview-label {
    color: #64748b;
    margin-bottom: 2px;
}

.segment-overview-value {
    font-weight: 700;
    font-size: 0.875rem;
    color: #ffffff;
}