.chart-container {
    position: relative;
    min-height: 400px;
    height: 500px; /* Fixed height to prevent layout shifts */
    background: white;
    border-radius: 8px;
    padding: 0; /* Usuń padding żeby overlay był poprawnie pozycjonowany */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden; /* Prevent content from breaking container */
}

.chart-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    z-index: 10 !important;
    width: 100% !important;
    height: 100% !important;
}

.filter-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.filter-card .card-header {
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.gap-2 {
    gap: 0.5rem;
}

.chart-controls {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

.chart-controls .btn {
    margin-right: 10px;
}

/* Ensure the filter form doesn't affect chart layout */
.filter-card {
    position: relative;
    z-index: 100;
    margin-bottom: 1rem;
}

/* Chart canvas should maintain its size */
.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Animation for showing/hiding filter form */
.filter-form-hidden {
    display: none !important;
}

.filter-form-visible {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keyboard key styling */
kbd {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    color: #495057;
    display: inline-block;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Selection instruction styling */
#selection-instruction {
    border-left: 4px solid #0d6efd;
}

#selection-instruction kbd {
    background-color: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
}