
/* Pielach3D styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #000; }
canvas { display: block; }

/* Info Panel */
#info-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 320px;
    max-height: calc(100vh - 32px);
    background: rgba(10, 20, 30, 0.92);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 20px;
    color: #e0e8f0;
    display: none;
    z-index: 100;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    overflow-y: auto;
}
#info-panel.visible { display: block; }
#info-panel h2 {
    font-size: 18px;
    margin-bottom: 4px;
    color: #fff;
}
#info-panel .subtitle {
    font-size: 12px;
    color: #8899aa;
    margin-bottom: 16px;
}
#info-panel .data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
#info-panel .data-item {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
}
#info-panel .data-item .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6a8a9a;
}
#info-panel .data-item .value {
    font-size: 20px;
    font-weight: 600;
    margin-top: 2px;
}
#info-panel .data-item .value.live { color: #4fc3f7; }
#info-panel .data-item .value.static { color: #ffb74d; }
#info-panel .data-item .unit {
    font-size: 12px;
    font-weight: 400;
    color: #8899aa;
    margin-left: 2px;
}
#close-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #8899aa;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
#close-panel:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Cross-section canvas */
#cross-section {
    width: 100%;
    height: 140px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
}

/* Source badges */
.source-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.source-badge.noe { background: #1a5276; color: #85c1e9; }
.source-badge.pegel { background: #5b2c6f; color: #d2b4de; }

/* Live indicator */
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4fc3f7;
    margin-right: 4px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Legend */
#legend {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 30, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 18px;
    color: #c0d0e0;
    font-size: 12px;
    z-index: 100;
    backdrop-filter: blur(8px);
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

/* Loading overlay */
#loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0a141e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: #4fc3f7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: opacity 0.8s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(79,195,247,0.2);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading .title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
#loading .sub { font-size: 12px; color: #6a8a9a; }

/* Responsive */
@media (max-width: 640px) {
    #info-panel { top: 8px; right: 8px; left: 8px; width: auto; max-height: 50vh; }
    #legend { font-size: 10px; padding: 6px 12px; white-space: normal; }
}
